Поставщики источника - ветви списка - Что такое имя поставщика?

Поставщики источников - список ветвей:

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 ответ

Это для имени поставщика источника. Если вы используете собственный 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
      }
    }
  ]
}
Другие вопросы по тегам