Leases - Get Retention Leases By User Id
返回指定用户拥有的任何租约,可以选择限定为单个管道定义并运行。
GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?userOwnerId={userOwnerId}&api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?userOwnerId={userOwnerId}&definitionId={definitionId}&runId={runId}&api-version=7.1
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
|
project
|
path | True |
string |
项目 ID 或项目名称 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。 |
|
user
|
query | True |
string (uuid) |
要搜索的用户 ID。 |
|
definition
|
query |
integer (int32) |
用于将搜索限制为特定管道定义的可选参数。 |
|
|
run
|
query |
integer (int32) |
一个可选参数,用于将搜索限制为单个管道运行。 需要 definitionId。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
成功作 |
安全性
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) |
租约的最后一天被视为有效。 |