Check Evaluations - Evaluate

启动管道中检查的评估

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/runs?api-version=7.1-preview.1
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/runs?$expand={$expand}&api-version=7.1-preview.1

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

api-version
query True

string

要使用的 API 版本。 应将其设置为“7.1-preview.1”才能使用此版本的 API。

$expand
query

CheckSuiteExpandParameter

请求正文

名称 类型 说明
context

JObject

表示 JSON 对象。

id

string

resources

Resource[]

响应

名称 类型 说明
200 OK

CheckSuite

成功的操作

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

名称 说明
vso.build_execute 授予访问生成项目(包括生成结果、定义和请求)的能力,以及对生成进行排队、更新生成属性以及通过服务挂钩接收有关生成事件的通知的能力。

示例

Sample Request

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/runs?api-version=7.1-preview.1

{
  "id": "64dc0df7-f224-4b3b-a251-f67cbe9cf7a3",
  "resources": [
    {
      "type": "queue",
      "id": "1",
      "name": "Default"
    }
  ],
  "context": {
    "PlanId": 1,
    "Pipeline.Id": 2,
    "GraphNode.Id": 3
  }
}

Sample Response

request-Context: appId=cid-v1:a892bfef-0287-4640-9f5e-cffc90fbcf94
access-Control-Expose-Headers: Request-Context
{
  "status": "canceled",
  "message": "",
  "completedDate": "2020-11-19T12:59:09.6567354Z",
  "checkRuns": [
    {
      "id": "c579b5e1-9722-42e1-981e-63e004e6cb69",
      "createdDate": "2020-11-19T12:59:09.6567354Z",
      "completedDate": "2020-11-19T12:59:09.6567354Z",
      "checkConfigurationRef": {
        "id": 15,
        "type": {
          "id": "e1a1fc6c-c278-4492-ae1c-c42f8697612c",
          "name": "Authorization"
        },
        "url": "https://dev.azure.com/fabrikam/d6b3e0ea-8197-4dec-831b-50e2e06ff95f/_apis/pipelines/checks/configurations/15",
        "resource": {
          "type": "queue",
          "id": "1"
        }
      },
      "status": "canceled",
      "resultMessage": "Check aborted. This could be because the run was canceled or another check on the stage failed."
    }
  ],
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/d6b3e0ea-8197-4dec-831b-50e2e06ff95f/_apis/pipelines/checks/runs"
    }
  },
  "id": "64dc0df7-f224-4b3b-a251-f67cbe9cf7a3",
  "context": {
    "PlanId": 1,
    "Pipeline.Id": 2,
    "GraphNode.Id": 3
  }
}

定义

名称 说明
CheckConfigurationRef
CheckRun
CheckRunStatus
CheckSuite
CheckSuiteExpandParameter
CheckSuiteRequest
CheckType
JObject

表示 JSON 对象。

ReferenceLinks

表示 REST 引用链接集合的类。

Resource

CheckConfigurationRef

名称 类型 说明
id

integer

检查配置 ID。

resource

Resource

配置检查的资源。

type

CheckType

检查配置类型

url

string

可以从中获取配置的检查的 URL。

CheckRun

名称 类型 说明
checkConfigurationRef

CheckConfigurationRef

completedDate

string

createdDate

string

id

string

resultMessage

string

status

CheckRunStatus

CheckRunStatus

名称 类型 说明
all

string

approved

string

canceled

string

completed

string

failed

string

none

string

queued

string

rejected

string

running

string

timedOut

string

CheckSuite

名称 类型 说明
_links

ReferenceLinks

参考链接。

checkRuns

CheckRun[]

与给定检查套件请求关联的检查运行列表。

completedDate

string

给定检查套件请求的完成日期

context

JObject

检查套件请求的评估上下文

id

string

管道业务流程协调程序为管道检查运行资源列表中的请求生成的唯一套件 ID 管道业务流程协调程序将使用此标识符映射阶段上的检查请求

message

string

给定检查套件请求的可选消息

status

CheckRunStatus

总体检查针对给定套件请求运行状态。 这是检查套件状态

CheckSuiteExpandParameter

名称 类型 说明
none

string

resources

string

CheckSuiteRequest

名称 类型 说明
context

JObject

表示 JSON 对象。

id

string

resources

Resource[]

CheckType

名称 类型 说明
id

string

获取或设置检查类型 ID。

name

string

检查类型的名称。

JObject

表示 JSON 对象。

名称 类型 说明
item

string

type

string

获取此 JToken 的节点类型。

表示 REST 引用链接集合的类。

名称 类型 说明
links

object

链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读。

Resource

名称 类型 说明
id

string

资源的 ID。

name

string

资源的名称。

type

string

资源的类型。