Azure devops 如何通过Azure DevOps Rest API获得给定服务连接的批准和检查?

Azure devops 如何通过Azure DevOps Rest API获得给定服务连接的批准和检查?,azure-devops,yaml,azure-pipelines,serviceconnection,Azure Devops,Yaml,Azure Pipelines,Serviceconnection,在浏览了Azure DevOps REST API文档和一些猜测端点的失败尝试后,似乎没有提到如何查看或创建与给定服务连接关联的“批准和检查”: 关于如何做到这一点,或者关于服务连接的批准/检查的RESTAPI文档在哪里,有什么想法吗 作为背景信息,当通过REST API创建服务连接时,我们的目标是为服务连接分配一个检查,以便它使用给定的YAML模板,因为服务连接本身已经作为自动流的一部分创建。您可以使用未记录的REST API: POST https://dev.azure.com/{or

在浏览了Azure DevOps REST API文档和一些猜测端点的失败尝试后,似乎没有提到如何查看或创建与给定服务连接关联的“批准和检查”:

关于如何做到这一点,或者关于服务连接的批准/检查的RESTAPI文档在哪里,有什么想法吗


作为背景信息,当通过REST API创建服务连接时,我们的目标是为服务连接分配一个检查,以便它使用给定的YAML模板,因为服务连接本身已经作为自动流的一部分创建。

您可以使用未记录的REST API:

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/configurations?api-version=5.2-preview.1
以下是其请求主体的一个示例:

{
    "type": {
        "name": "ExtendsCheck"
    },
    "settings": {
        "extendsChecks": [
            {
                "repositoryType": "git",
                "repositoryName": "{project}/{repository}",
                "repositoryRef": "refs/heads/master",
                "templatePath": "templates.yml"
            }
        ]
    },
    "resource": {
        "type": "endpoint",
        "id": "{service connection id}",
        "name": "{service connection name}"
    }
}

要获取服务连接id,您可以使用REST API或。

您可以使用未记录的REST API:

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/configurations?api-version=5.2-preview.1
以下是其请求主体的一个示例:

{
    "type": {
        "name": "ExtendsCheck"
    },
    "settings": {
        "extendsChecks": [
            {
                "repositoryType": "git",
                "repositoryName": "{project}/{repository}",
                "repositoryRef": "refs/heads/master",
                "templatePath": "templates.yml"
            }
        ]
    },
    "resource": {
        "type": "endpoint",
        "id": "{service connection id}",
        "name": "{service connection name}"
    }
}
要获取服务连接id,可以使用RESTAPI或