Поставщики источника - ветви списка - Что такое имя поставщика? - PullRequest
0 голосов
/ 20 декабря 2018

Source Providers - List Branches:

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

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

Может кто-нибудь сказать мне, для чего предназначена строка" providerName "?

1 Ответ

0 голосов
/ 20 декабря 2018

Это имя поставщика источника.Если вы используете собственный Git TFVC или Azure Devops, вам не нужно использовать этот API - существуют специальные API для TFVC и Git.

Если вы используете внешний поставщик Git, такой как GitHubили BitBucket, это правильное место.Вам нужно сообщить 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
      }
    }
  ]
}
...