你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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 参数

名称 必需 类型 说明
labName
path True

string

实验室的名称。

name
path True

string

ArtifactSource 的名称

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
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

SourceControlType

项目源的类型。

properties.status

EnableStatus

指示项目源是否已启用(值:Enabled,Disabled)。

properties.uri

string

项目源的 URI。

tags

object

资源的标记。

响应

名称 类型 说明
200 OK

ArtifactSource

资源“ArtifactSource”更新作成功

201 Created

ArtifactSource

资源“ArtifactSource”创建作成功

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

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"
  }
}

定义

名称 说明
ArtifactSource

项目源的属性。

EnableStatus

指示项目源是否已启用(值:Enabled,Disabled)。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

SourceControlType

项目源的类型。

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

SourceControlType

项目源的类型。

properties.status

EnableStatus

指示项目源是否已启用(值: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

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

SourceControlType

项目源的类型。

说明
VsoGit
GitHub
StorageAccount