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

Source Control - List By Automation Account

检索源代码控件列表。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls?api-version=2023-11-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls?$filter={$filter}&api-version=2023-11-01

URI 参数

名称 必需 类型 说明
automationAccountName
path True

string

自动化帐户的名称。

resourceGroupName
path True

string

Azure 资源组的名称。

Regex pattern: ^[-\w\._]+$

subscriptionId
path True

string

获取唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。

api-version
query True

string

客户端 API 版本。

$filter
query

string

要应用于操作的筛选器。

响应

名称 类型 说明
200 OK

SourceControlListResult

确定

Other Status Codes

ErrorResponse

描述操作失败原因的自动化错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

List sourceControls

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourceControls?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl1",
      "name": "sampleSourceControl1",
      "properties": {
        "creationTime": "2017-03-28T22:59:00.937+00:00",
        "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
        "repoUrl": "https://github.com/SampleUserRepro/PowerShell-1",
        "branch": "master",
        "folderPath": "/sampleFolder/sampleFolder2",
        "autoSync": true,
        "publishRunbook": true,
        "sourceType": "GitHub",
        "description": "my description"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl2",
      "name": "sampleSourceControl2",
      "properties": {
        "creationTime": "2017-03-28T22:59:00.937+00:00",
        "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
        "repoUrl": "https://github.com/SampleUserRepro/PowerShell-2",
        "branch": "master",
        "folderPath": "/sampleFolder/sampleFolder2",
        "autoSync": true,
        "publishRunbook": true,
        "sourceType": "GitHub",
        "description": "my description"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl3",
      "name": "sampleSourceControl3",
      "properties": {
        "creationTime": "2017-03-28T22:59:00.937+00:00",
        "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
        "repoUrl": "https://github.com/SampleUserRepro/PowerShell-3",
        "branch": "master",
        "folderPath": "/sampleFolder/sampleFolder2",
        "autoSync": true,
        "publishRunbook": true,
        "sourceType": "GitHub",
        "description": "my description"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl4",
      "name": "sampleSourceControl4",
      "properties": {
        "creationTime": "2017-03-28T22:59:00.937+00:00",
        "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
        "repoUrl": "https://github.com/SampleUserRepro/PowerShell-4",
        "branch": "master",
        "folderPath": "/sampleFolder/sampleFolder2",
        "autoSync": true,
        "publishRunbook": true,
        "sourceType": "GitHub",
        "description": "my description"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl5",
      "name": "sampleSourceControl5",
      "properties": {
        "creationTime": "2017-03-28T22:59:00.937+00:00",
        "lastModifiedTime": "2017-03-28T22:59:00.937+00:00",
        "repoUrl": "https://github.com/SampleUserRepro/PowerShell-5",
        "branch": "master",
        "folderPath": "/sampleFolder/sampleFolder2",
        "autoSync": true,
        "publishRunbook": true,
        "sourceType": "GitHub",
        "description": "my description"
      }
    }
  ]
}

定义

名称 说明
ErrorResponse

操作失败的错误响应

SourceControl

源代码管理的定义。

SourceControlListResult

列表源代码管理操作的响应模型。

sourceType

源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。

ErrorResponse

操作失败的错误响应

名称 类型 说明
code

string

错误代码

message

string

指示操作失败原因的错误消息。

SourceControl

源代码管理的定义。

名称 类型 说明
id

string

资源的完全限定资源 ID

name

string

资源的名称

properties.autoSync

boolean

源代码管理自动同步。 默认值为 false。

properties.branch

string

源代码管理存储库分支。 将分支作为 VsoTfvc 的空字符串包含在内。

properties.creationTime

string

创建时间。

properties.description

string

说明。

properties.folderPath

string

源代码管理的文件夹路径。

properties.lastModifiedTime

string

上次修改时间。

properties.publishRunbook

boolean

源代码管理自动发布。 默认为 true。

properties.repoUrl

string

源代码管理存储库 URL。

properties.sourceType

sourceType

源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。

type

string

资源类型。

SourceControlListResult

列表源代码管理操作的响应模型。

名称 类型 说明
nextLink

string

下一个链接。

value

SourceControl[]

源代码控件列表。

sourceType

源类型。 必须是 VsoGit、VsoTfvc、GitHub 之一。

名称 类型 说明
GitHub

string

VsoGit

string

VsoTfvc

string