Builds - Get Retention Leases For Build

获取应用于特定生成的所有保留租约。

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/leases?api-version=7.1

URI 参数

名称 必需 类型 说明
buildId
path True

integer (int32)

生成的 ID。

organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。

响应

名称 类型 说明
200 OK

RetentionLease[]

成功作

安全性

oauth2

类型: oauth2
流向: accessCode
授权 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 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

作用域

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

定义

RetentionLease

有效的保留租约可防止自动系统删除管道运行。

名称 类型 说明
createdOn

string (date-time)

创建租约时。

definitionId

integer (int32)

运行的管道定义。

leaseId

integer (int32)

此租约的唯一标识符。

ownerId

string

标识保留租约所有者的非唯一字符串。

protectPipeline

boolean

如果设置,此租约也会阻止在租约仍然有效时删除管道。

runId

integer (int32)

此租约保护的管道运行。

validUntil

string (date-time)

租约的最后一天被视为有效。