源提供者-列表分支-什么是providerName?

时间:2018-12-20 15:33:02

标签: azure-devops azure-devops-rest-api

源提供商-列出分支机构:

https://docs.microsoft.com/en-us/rest/api/azure/devops/build/source%20providers/list%20branches?view=azure-devops-rest-5.0

“获取https://dev.azure.com/ {organization} / {project} / _ apis / sourceProviders / {providerName} /branches?api-version=5.0-preview.1”

谁能告诉我“ providerName”字符串的含义?

1 个答案:

答案 0 :(得分:1)

用于源提供者的名称。如果您使用的是TFVC或Azure Devops本地Git,则无需使用此API,因为TFVC和Git特定于API。

如果您使用的是GitHub或BitBucket之类的外部Git提供程序,那么这里是正确的地方。您需要告诉API 您要查询的外部提供商。

这就是为什么在“列表” API的“列表分支”条目的正上方列出了一个页面的原因-它列出了您帐户的可用来源提供商。

GET https://dev.azure.com/{organization}/{project}/_apis/sourceproviders?api-version=5.0-preview.1

调用该API应该返回以下内容:

{
  "count": 7,
  "value": [
    {
      "name": "GitHubEnterprise",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "pullRequest",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "unsupported",
            "buildForks": "supported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": true,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": true,
        "queryFileContents": true,
        "queryPathContents": true,
        "queryPullRequest": false,
        "queryRelatedWorkItems": false,
        "queryRepositories": true,
        "queryTopRepositories": false,
        "queryWebhooks": true,
        "sourceLinks": true,
        "yamlDefinition": true
      }
    },
    {
      "name": "Svn",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "polling",
          "defaultPollingInterval": 180,
          "supportedCapabilities": {
            "branchFilters": "unsupported",
            "pathFilters": "required",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "unsupported",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": false,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": false,
        "queryFileContents": false,
        "queryPathContents": false,
        "queryPullRequest": false,
        "queryRelatedWorkItems": false,
        "queryRepositories": false,
        "queryTopRepositories": false,
        "queryWebhooks": false,
        "sourceLinks": false,
        "yamlDefinition": false
      }
    },
    {
      "name": "GitHub",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "pullRequest",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "unsupported",
            "buildForks": "supported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": true,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": true,
        "queryFileContents": true,
        "queryPathContents": true,
        "queryPullRequest": true,
        "queryRelatedWorkItems": true,
        "queryRepositories": true,
        "queryTopRepositories": true,
        "queryWebhooks": true,
        "sourceLinks": true,
        "yamlDefinition": true
      }
    },
    {
      "name": "Bitbucket",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "pullRequest",
          "notificationType": "webhook",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": false,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": true,
        "queryFileContents": false,
        "queryPathContents": false,
        "queryRelatedWorkItems": false,
        "queryPullRequest": false,
        "queryRepositories": true,
        "queryTopRepositories": false,
        "queryWebhooks": false,
        "sourceLinks": true,
        "yamlDefinition": false
      }
    },
    {
      "name": "Git",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "polling",
          "defaultPollingInterval": 180,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": false,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": false,
        "queryFileContents": false,
        "queryPathContents": false,
        "queryPullRequest": false,
        "queryRelatedWorkItems": false,
        "queryRepositories": false,
        "queryTopRepositories": false,
        "queryWebhooks": false,
        "sourceLinks": false,
        "yamlDefinition": false
      }
    },
    {
      "name": "TfsGit",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "required",
            "pathFilters": "supported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": true,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": false,
        "queryFileContents": true,
        "queryPathContents": true,
        "queryPullRequest": true,
        "queryRelatedWorkItems": true,
        "queryRepositories": false,
        "queryTopRepositories": false,
        "queryWebhooks": false,
        "sourceLinks": true,
        "yamlDefinition": true
      }
    },
    {
      "name": "TfsVersionControl",
      "supportedTriggers": [
        {
          "type": "continuousIntegration",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "unsupported",
            "pathFilters": "required",
            "batchChanges": "supported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "gatedCheckIn",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "unsupported",
            "pathFilters": "required",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        },
        {
          "type": "schedule",
          "notificationType": "none",
          "defaultPollingInterval": 0,
          "supportedCapabilities": {
            "branchFilters": "unsupported",
            "pathFilters": "unsupported",
            "batchChanges": "unsupported",
            "buildForks": "unsupported"
          }
        }
      ],
      "supportedCapabilities": {
        "createLabel": true,
        "discoverExistingYamlDefinitions": false,
        "queryBranches": false,
        "queryFileContents": true,
        "queryPathContents": true,
        "queryPullRequest": false,
        "queryRelatedWorkItems": true,
        "queryRepositories": false,
        "queryTopRepositories": false,
        "queryWebhooks": false,
        "sourceLinks": false,
        "yamlDefinition": false
      }
    }
  ]
}