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 | 是 | 否 | 平台。 | 取值:
|
Repository | String | 是 | 否 | 仓库名称。 | 无 |
CommitId | String | 否 | 是 | 提交的CommitId。 | 无 |
Organization | String | 否 | 否 | Git组织名称。 | 无 |
RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值:
|
返回值
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"
]
}
}
}
}