Source Control - Update
更新源代码管理。
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}?api-version=2024-10-23
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
automation
|
path | True |
string |
自动化帐户的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._]+$ |
Azure 资源组的名称。 |
|
source
|
path | True |
string |
源代码管理名称。 |
|
subscription
|
path | True |
string |
获取唯一标识Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.autoSync |
boolean |
源代码管理自动同步。 默认值为 false。 |
| properties.branch |
string |
源代码管理的存储库分支。 |
| properties.description |
string |
源代码管理的用户说明。 |
| properties.folderPath |
string |
源代码管理的文件夹路径。 路径必须是相对路径。 |
| properties.publishRunbook |
boolean |
源代码管理自动发布。 默认值为 true。 |
| properties.securityToken |
源代码管理存储库的授权令牌。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
好的 |
|
| Other Status Codes |
描述操作失败原因的自动化错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Update a source control
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourceControls/sampleSourceControl?api-version=2024-10-23
{
"properties": {
"branch": "master",
"folderPath": "/folderOne/folderTwo",
"autoSync": true,
"publishRunbook": true,
"securityToken": {
"accessToken": "******",
"tokenType": "PersonalAccessToken"
},
"description": "my description"
}
}
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl",
"name": "sampleSourceControl",
"properties": {
"creationTime": "2017-03-28T22:59:00.937+00:00",
"lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
"repoUrl": "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
"branch": "master",
"folderPath": "/folderOne/folderTwo",
"autoSync": true,
"publishRunbook": true,
"sourceType": "VsoGit",
"description": "my description"
}
}
定义
| 名称 | 说明 |
|---|---|
|
created |
创建资源的标识的类型。 |
|
Error |
操作失败的错误响应 |
|
Source |
源代码管理的定义。 |
|
Source |
|
|
Source |
提供给更新源代码管理作的参数。 |
|
source |
源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。 |
|
system |
与创建和上次修改资源相关的元数据。 |
|
token |
令牌类型。 必须是 PersonalAccessToken 或 Oauth。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorResponse
操作失败的错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码 |
| message |
string |
指示操作失败的原因的错误消息。 |
SourceControl
源代码管理的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
资源的完全限定的资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
资源的名称 |
| properties.autoSync |
boolean |
源代码管理自动同步。 默认值为 false。 |
| properties.branch |
string |
源代码管理的存储库分支。 将分支作为 VsoTfvc 的空字符串包含在内。 |
| properties.creationTime |
string (date-time) |
创建时间。 |
| properties.description |
string |
说明。 |
| properties.folderPath |
string |
源代码管理的文件夹路径。 |
| properties.lastModifiedTime |
string (date-time) |
上次修改时间。 |
| properties.publishRunbook |
boolean |
源代码管理自动发布。 默认值为 true。 |
| properties.repoUrl |
string |
源代码管理的存储库 URL。 |
| properties.sourceType |
源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
SourceControlSecurityTokenProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| accessToken |
string maxLength: 1024 |
访问令牌。 |
| refreshToken |
string maxLength: 1024 |
刷新令牌。 |
| tokenType |
令牌类型。 必须是 PersonalAccessToken 或 Oauth。 |
SourceControlUpdateParameters
提供给更新源代码管理作的参数。
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.autoSync |
boolean |
源代码管理自动同步。 默认值为 false。 |
| properties.branch |
string |
源代码管理的存储库分支。 |
| properties.description |
string |
源代码管理的用户说明。 |
| properties.folderPath |
string |
源代码管理的文件夹路径。 路径必须是相对路径。 |
| properties.publishRunbook |
boolean |
源代码管理自动发布。 默认值为 true。 |
| properties.securityToken |
源代码管理存储库的授权令牌。 |
sourceType
源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。
| 值 | 说明 |
|---|---|
| VsoGit | |
| VsoTfvc | |
| GitHub |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
tokenType
令牌类型。 必须是 PersonalAccessToken 或 Oauth。
| 值 | 说明 |
|---|---|
| PersonalAccessToken | |
| Oauth |