ALIYUN::PAI::CodeSource类型用于创建代码配置到PAI。
语法
{
"Type": "ALIYUN::PAI::CodeSource",
"Properties": {
"Accessibility": String,
"CodeRepo": String,
"DisplayName": String,
"MountPath": String,
"WorkspaceId": String,
"CodeRepoAccessToken": String,
"CodeCommit": String,
"CodeBranch": String,
"CodeRepoUserName": String,
"Description": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Accessibility | String | 是 | 是 | 代码配置的可见性。 | 取值如下。
|
CodeRepo | String | 是 | 是 | 代码仓库地址。 | 无 |
DisplayName | String | 是 | 是 | 代码配置名称。 | 无 |
MountPath | String | 是 | 是 | 代码本地挂载目录。 | 无 |
WorkspaceId | String | 是 | 否 | 工作空间ID。 | 无 |
CodeRepoAccessToken | String | 否 | 是 | 代码仓库访问 Token。 | 无 |
CodeCommit | String | 否 | 是 | 代码 CommitId。 | 无 |
CodeBranch | String | 否 | 是 | 代码分支。 | 无 |
CodeRepoUserName | String | 否 | 是 | 代码仓库的用户名。 | 无 |
Description | String | 否 | 是 | 代码配置的描述信息。 | 无 |
返回值
Fn::GetAtt
CodeRepo:代码仓库地址。
Description:代码配置的描述信息。
Accessibility:代码配置的可见性。
CreateTime:代码配置创建时间。
WorkspaceId:工作空间ID。
CodeBranch:代码仓库分支。
MountPath:代码的本地挂载目录。
CodeSourcesId:代码源配置ID。
CodeRepoAccessToken:访问代码仓库的Token。
GmtModifyTime:代码配置修改时间。
UserId:代码配置源的创建者ID。
CodeCommit:代码CommitId。
DisplayName:代码源配置名字。
CodeRepoUserName:代码仓库的用户名。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
ExtensionResource:
Type: ALIYUN::PAI::CodeSource
Properties:
MountPath: /root/code/
DisplayName: demo1893
CodeRepo: https://github.com/aliyun/Resource-Orchestration-Service-Cloud-Development-Kit.git
Accessibility: PRIVATE
WorkspaceId: '17283523466333'
Description: test code desc.
CodeBranch: master
Outputs:
CodeRepo:
Description: Code repository address.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeRepo
Description:
Description: A detailed description of the code configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- Description
Accessibility:
Description: Visibility of the code configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- Accessibility
CreateTime:
Description: The creation time of the code.
Value:
Fn::GetAtt:
- ExtensionResource
- CreateTime
WorkspaceId:
Description: The ID of the workspace.
Value:
Fn::GetAtt:
- ExtensionResource
- WorkspaceId
CodeBranch:
Description: Code repository branch.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeBranch
MountPath:
Description: The local Mount Directory of the code.
Value:
Fn::GetAtt:
- ExtensionResource
- MountPath
CodeSourcesId:
Description: The ID of the created code configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeSourcesId
CodeRepoAccessToken:
Description: The Token used to access the code repository.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeRepoAccessToken
GmtModifyTime:
Description: Code configuration modification time. The time format is iso8601.
Value:
Fn::GetAtt:
- ExtensionResource
- GmtModifyTime
UserId:
Description: The ID of the creator of the code configuration source.
Value:
Fn::GetAtt:
- ExtensionResource
- UserId
CodeCommit:
Description: The code CommitId.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeCommit
DisplayName:
Description: Code source configuration name.
Value:
Fn::GetAtt:
- ExtensionResource
- DisplayName
CodeRepoUserName:
Description: The user name of the code repository.
Value:
Fn::GetAtt:
- ExtensionResource
- CodeRepoUserName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::PAI::CodeSource",
"Properties": {
"MountPath": "/root/code/",
"DisplayName": "demo1893",
"CodeRepo": "https://github.com/aliyun/Resource-Orchestration-Service-Cloud-Development-Kit.git",
"Accessibility": "PRIVATE",
"WorkspaceId": "17283523466333",
"Description": "test code desc.",
"CodeBranch": "master"
}
}
},
"Outputs": {
"CodeRepo": {
"Description": "Code repository address.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeRepo"
]
}
},
"Description": {
"Description": "A detailed description of the code configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Description"
]
}
},
"Accessibility": {
"Description": "Visibility of the code configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Accessibility"
]
}
},
"CreateTime": {
"Description": "The creation time of the code.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CreateTime"
]
}
},
"WorkspaceId": {
"Description": "The ID of the workspace.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"WorkspaceId"
]
}
},
"CodeBranch": {
"Description": "Code repository branch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeBranch"
]
}
},
"MountPath": {
"Description": "The local Mount Directory of the code.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"MountPath"
]
}
},
"CodeSourcesId": {
"Description": "The ID of the created code configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeSourcesId"
]
}
},
"CodeRepoAccessToken": {
"Description": "The Token used to access the code repository.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeRepoAccessToken"
]
}
},
"GmtModifyTime": {
"Description": "Code configuration modification time. The time format is iso8601.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"GmtModifyTime"
]
}
},
"UserId": {
"Description": "The ID of the creator of the code configuration source.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"UserId"
]
}
},
"CodeCommit": {
"Description": "The code CommitId.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeCommit"
]
}
},
"DisplayName": {
"Description": "Code source configuration name.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"DisplayName"
]
}
},
"CodeRepoUserName": {
"Description": "The user name of the code repository.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CodeRepoUserName"
]
}
}
}
}
该文章对您有帮助吗?