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 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
automation
|
path | True |
string |
自動化帳戶的名稱。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._]+$ |
Azure 資源群組的名稱。 |
|
source
|
path | True |
string |
原始檔控制名稱。 |
|
subscription
|
path | True |
string |
取得可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。 |
|
api-version
|
query | True |
string |
用戶端 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| properties.autoSync |
boolean |
原始檔控制件的自動同步處理。 預設值為 false。 |
| properties.branch |
string |
原始檔控制的存放庫分支。 |
| properties.description |
string |
原始檔控制的使用者描述。 |
| properties.folderPath |
string |
原始檔控制的資料夾路徑。 路徑必須是相對的。 |
| properties.publishRunbook |
boolean |
原始檔控制的自動發佈。 預設值是「true」。 |
| properties.securityToken |
原始檔控制存放庫的授權令牌。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
還行 |
|
| Other Status Codes |
描述作業失敗原因的自動化錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| 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"
}
}
定義
| 名稱 | Description |
|---|---|
|
created |
建立資源的身分識別類型。 |
|
Error |
作業失敗的錯誤回應 |
|
Source |
原始檔控制的定義。 |
|
Source |
|
|
Source |
提供給更新原始檔控制作業的參數。 |
|
source |
來源類型。 必須是其中一個 VsoGit、VsoTfvc、GitHub。 |
|
system |
與建立和上次修改資源相關的元數據。 |
|
token |
令牌類型。 必須是 PersonalAccessToken 或 Oauth。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorResponse
作業失敗的錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
錯誤碼 |
| message |
string |
錯誤訊息,指出作業失敗的原因。 |
SourceControl
原始檔控制的定義。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string (arm-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 Resource Manager 元數據。 |
|
| type |
string |
資源的類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts” |
SourceControlSecurityTokenProperties
| 名稱 | 類型 | Description |
|---|---|---|
| accessToken |
string maxLength: 1024 |
存取令牌。 |
| refreshToken |
string maxLength: 1024 |
刷新令牌。 |
| tokenType |
令牌類型。 必須是 PersonalAccessToken 或 Oauth。 |
SourceControlUpdateParameters
提供給更新原始檔控制作業的參數。
| 名稱 | 類型 | Description |
|---|---|---|
| properties.autoSync |
boolean |
原始檔控制件的自動同步處理。 預設值為 false。 |
| properties.branch |
string |
原始檔控制的存放庫分支。 |
| properties.description |
string |
原始檔控制的使用者描述。 |
| properties.folderPath |
string |
原始檔控制的資料夾路徑。 路徑必須是相對的。 |
| properties.publishRunbook |
boolean |
原始檔控制的自動發佈。 預設值是「true」。 |
| properties.securityToken |
原始檔控制存放庫的授權令牌。 |
sourceType
來源類型。 必須是其中一個 VsoGit、VsoTfvc、GitHub。
| 值 | Description |
|---|---|
| VsoGit | |
| VsoTfvc | |
| GitHub |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |
tokenType
令牌類型。 必須是 PersonalAccessToken 或 Oauth。
| 值 | Description |
|---|---|
| PersonalAccessToken | |
| Oauth |