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
automationAccountName
path True

string

自動化帳戶的名稱。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

sourceControlName
path True

string

原始檔控制的名稱。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

要求本文

名稱 類型 Description
properties.autoSync

boolean

原始檔控制件的自動同步處理。 預設值為 false。

properties.branch

string

原始檔控制的存放庫分支。

properties.description

string

原始檔控制的使用者描述。

properties.folderPath

string

原始檔控制的資料夾路徑。 路徑必須是相對的。

properties.publishRunbook

boolean

原始檔控制的自動發佈。 預設值是「true」。

properties.securityToken

SourceControlSecurityTokenProperties

原始檔控制存放庫的授權令牌。

回覆

名稱 類型 Description
200 OK

SourceControl

Azure 運作順利完成。

Other Status Codes

ErrorResponse

未預期的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Update a source control

範例要求

PATCH https://management.azure.com/subscriptions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourceControls/sampleSourceControl?api-version=2024-10-23

{
  "properties": {
    "description": "my description",
    "autoSync": true,
    "branch": "master",
    "folderPath": "/folderOne/folderTwo",
    "publishRunbook": true,
    "securityToken": {
      "accessToken": "******",
      "tokenType": "PersonalAccessToken"
    }
  }
}

範例回覆

{
  "name": "sampleSourceControl",
  "id": "/subscriptions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl",
  "properties": {
    "description": "my description",
    "autoSync": true,
    "branch": "master",
    "creationTime": "2017-03-28T22:59:00.937+00:00",
    "folderPath": "/folderOne/folderTwo",
    "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
    "publishRunbook": true,
    "repoUrl": "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
    "sourceType": "VsoGit"
  }
}

定義

名稱 Description
createdByType

建立資源的身分識別類型。

ErrorAdditionalInfo

資源管理錯誤附加資訊。

ErrorDetail

錯誤詳細資料。

ErrorResponse

錯誤回應

SourceControl

原始檔控制的定義。

SourceControlSecurityTokenProperties
SourceControlUpdateParameters

提供給更新原始檔控制作業的參數。

SourceType

來源類型。 必須是其中一個 VsoGit、VsoTfvc、GitHub。

systemData

與建立和上次修改資源相關的元數據。

TokenType

令牌類型。 必須是 PersonalAccessToken 或 Oauth。

createdByType

建立資源的身分識別類型。

值 Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

資源管理錯誤附加資訊。

名稱 類型 Description
info

object

附加資訊。

type

string

其他資訊類型。

ErrorDetail

錯誤詳細資料。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤附加資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳情

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

錯誤物件。

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

SourceType

來源類型。 必須是其中一個 VsoGit、VsoTfvc、GitHub。

systemData

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

TokenType

令牌類型。 必須是 PersonalAccessToken 或 Oauth。

SourceControlUpdateParameters

提供給更新原始檔控制作業的參數。

名稱 類型 Description
properties.autoSync

boolean

原始檔控制件的自動同步處理。 預設值為 false。

properties.branch

string

原始檔控制的存放庫分支。

properties.description

string

原始檔控制的使用者描述。

properties.folderPath

string

原始檔控制的資料夾路徑。 路徑必須是相對的。

properties.publishRunbook

boolean

原始檔控制的自動發佈。 預設值是「true」。

properties.securityToken

SourceControlSecurityTokenProperties

原始檔控制存放庫的授權令牌。

SourceType

來源類型。 必須是其中一個 VsoGit、VsoTfvc、GitHub。

值 Description
VsoGit

VsoGit

VsoTfvc

VsoTfvc

GitHub

GitHub

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string (date-time)

資源建立的時間戳(UTC)。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string (date-time)

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。

TokenType

令牌類型。 必須是 PersonalAccessToken 或 Oauth。

值 Description
PersonalAccessToken

個人存取令牌

Oauth

奧特