Artifact Sources - Create Or Update
创建或替换现有项目源。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}?api-version=2018-09-15
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
lab
|
path | True |
string |
实验室的名称。 |
|
name
|
path | True |
string |
ArtifactSource 的名称 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| location |
string |
资源的位置。 |
| properties.armTemplateFolderPath |
string |
包含 Azure 资源管理器模板的文件夹。 |
| properties.branchRef |
string |
项目源的分支引用。 |
| properties.displayName |
string |
项目源的显示名称。 |
| properties.folderPath |
string |
包含项目的文件夹。 |
| properties.securityToken |
string |
要向项目源进行身份验证的安全令牌。 |
| properties.sourceType |
项目源的类型。 |
|
| properties.status |
指示项目源是否已启用(值:Enabled,Disabled)。 |
|
| properties.uri |
string |
项目源的 URI。 |
| tags |
object |
资源的标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“ArtifactSource”更新作成功 |
|
| 201 Created |
资源“ArtifactSource”创建作成功 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
ArtifactSources_CreateOrUpdate
示例请求
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}?api-version=2018-09-15
{
"properties": {
"armTemplateFolderPath": "{armTemplateFolderPath}",
"branchRef": "{branchRef}",
"displayName": "{displayName}",
"folderPath": "{folderPath}",
"securityToken": "{securityToken}",
"sourceType": "{VsoGit|GitHub|StorageAccount}",
"status": "{Enabled|Disabled}",
"uri": "{artifactSourceUri}"
},
"tags": {
"tagName1": "tagValue1"
}
}
示例响应
{
"name": "{artifactSourceName}",
"type": "Microsoft.DevTestLab/labs/artifactsources",
"id": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}",
"location": "{location}",
"properties": {
"armTemplateFolderPath": "{armTemplateFolderPath}",
"branchRef": "{branchRef}",
"createdDate": "2020-12-16T16:53:02.4830866-07:00",
"displayName": "{displayName}",
"folderPath": "{folderPath}",
"provisioningState": "Succeeded",
"securityToken": "{securityToken}",
"sourceType": "{VsoGit|GitHub|StorageAccount}",
"status": "{Enabled|Disabled}",
"uniqueIdentifier": "{uniqueIdentifier}",
"uri": "{artifactSourceUri}"
},
"tags": {
"tagName1": "tagValue1"
}
}
{
"name": "{artifactSourceName}",
"type": "Microsoft.DevTestLab/labs/artifactsources",
"id": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}",
"location": "{location}",
"properties": {
"armTemplateFolderPath": "{armTemplateFolderPath}",
"branchRef": "{branchRef}",
"createdDate": "2020-12-16T16:53:02.4830866-07:00",
"displayName": "{displayName}",
"folderPath": "{folderPath}",
"provisioningState": "Created",
"securityToken": "{securityToken}",
"sourceType": "{VsoGit|GitHub|StorageAccount}",
"status": "{Enabled|Disabled}",
"uniqueIdentifier": "{uniqueIdentifier}",
"uri": "{artifactSourceUri}"
},
"tags": {
"tagName1": "tagValue1"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Artifact |
项目源的属性。 |
|
Enable |
指示项目源是否已启用(值:Enabled,Disabled)。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Source |
项目源的类型。 |
ArtifactSource
项目源的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的标识符。 |
| location |
string |
资源的位置。 |
| name |
string |
资源的名称。 |
| properties.armTemplateFolderPath |
string |
包含 Azure 资源管理器模板的文件夹。 |
| properties.branchRef |
string |
项目源的分支引用。 |
| properties.createdDate |
string (date-time) |
项目源的创建日期。 |
| properties.displayName |
string |
项目源的显示名称。 |
| properties.folderPath |
string |
包含项目的文件夹。 |
| properties.provisioningState |
string |
资源的预配状态。 |
| properties.securityToken |
string |
要向项目源进行身份验证的安全令牌。 |
| properties.sourceType |
项目源的类型。 |
|
| properties.status |
指示项目源是否已启用(值:Enabled,Disabled)。 |
|
| properties.uniqueIdentifier |
string |
资源的唯一不可变标识符(Guid)。 |
| properties.uri |
string |
项目源的 URI。 |
| tags |
object |
资源的标记。 |
| type |
string |
资源的类型。 |
EnableStatus
指示项目源是否已启用(值:Enabled,Disabled)。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
SourceControlType
项目源的类型。
| 值 | 说明 |
|---|---|
| VsoGit | |
| GitHub | |
| StorageAccount |