DATASOURCE::OOS::GitCodeRepo

DATASOURCE::OOS::GitCodeRepo类型用于生成用户指定的GitHub/Gitee仓库代码的地址。

语法

{
  "Type": "DATASOURCE::OOS::GitCodeRepo",
  "Properties": {
    "Owner": String,
    "Platform": String,
    "Repository": String,
    "CommitId": String,
    "Organization": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Owner

String

Git账户名。

Platform

String

平台。

取值:

  • github

  • gitee

Repository

String

仓库名称。

CommitId

String

提交的CommitId。

Organization

String

Git组织名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

AuthorizedUrl:指定的GitHub/Gitee仓库代码的地址

示例

YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Repository:
    Type: String
    Description:
      en: Git repository.
    Required: true
  Owner:
    Type: String
    Description:
      en: Git account.
    Required: true
  Platform:
    Type: String
    Description:
      en: Git platform.
    AllowedValues:
      - github
      - gitee
    Required: true
Resources:
  GitCodeRepo:
    Type: DATASOURCE::OOS::GitCodeRepo
    Properties:
      Repository:
        Ref: Repository
      Owner:
        Ref: Owner
      Platform:
        Ref: Platform
Outputs:
  AuthorizedUrl:
    Description: Authorized url.
    Value:
      Fn::GetAtt:
        - GitCodeRepo
        - AuthorizedUrl

JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Repository": {
      "Type": "String",
      "Description": {
        "en": "Git repository."
      },
      "Required": true
    },
    "Owner": {
      "Type": "String",
      "Description": {
        "en": "Git account."
      },
      "Required": true
    },
    "Platform": {
      "Type": "String",
      "Description": {
        "en": "Git platform."
      },
      "AllowedValues": [
        "github",
        "gitee"
      ],
      "Required": true
    }
  },
  "Resources": {
    "GitCodeRepo": {
      "Type": "DATASOURCE::OOS::GitCodeRepo",
      "Properties": {
        "Repository": {
          "Ref": "Repository"
        },
        "Owner": {
          "Ref": "Owner"
        },
        "Platform": {
          "Ref": "Platform"
        }
      }
    }
  },
  "Outputs": {
    "AuthorizedUrl": {
      "Description": "Authorized url.",
      "Value": {
        "Fn::GetAtt": [
          "GitCodeRepo",
          "AuthorizedUrl"
        ]
      }
    }
  }
}