【发布时间】:2019-05-21 03:35:57
【问题描述】:
源提供者 - 列出分支:
“GET https://dev.azure.com/{organization}/{project}/_apis/sourceProviders/{providerName}/branches?api-version=5.0-preview.1”
谁能告诉我“providerName”字符串是干什么用的?
【问题讨论】:
标签: azure-devops azure-devops-rest-api
源提供者 - 列出分支:
“GET https://dev.azure.com/{organization}/{project}/_apis/sourceProviders/{providerName}/branches?api-version=5.0-preview.1”
谁能告诉我“providerName”字符串是干什么用的?
【问题讨论】:
标签: azure-devops azure-devops-rest-api
它是源提供者的名称。如果您使用的是 TFVC 或 Azure Devops-native Git,则不需要使用此 API - 有 TFVC 和 Git 特定的 API。
如果您使用的是外部 Git 提供程序,例如 GitHub 或 BitBucket,那么这里就是正确的选择。您需要告诉 API 您尝试查询哪个外部提供商。
这就是为什么在“List”API 的“List Branches”条目上方直接列出一个页面的原因——它列出了您帐户的可用源提供程序。
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
}
}
]
}
【讨论】: