Leases - Update
更新保留租约的持续时间或管道保护状态。
PATCH https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases/{leaseId}?api-version=7.1
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
lease
|
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。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| daysValid |
integer (int32) |
考虑租约有效的天数。 有效期超过 100 年的保留租约(36500 天)将显示为保留生成“永远”。 |
| protectPipeline |
boolean |
如果设置,此租约也会阻止在租约仍然有效时删除管道。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 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_execute | 授予访问生成项目(包括生成结果、定义和请求)以及排队生成、更新生成属性的功能,以及通过服务挂钩接收有关生成事件的通知的能力。 |
定义
| 名称 | 说明 |
|---|---|
|
Retention |
有效的保留租约可防止自动系统删除管道运行。 |
|
Retention |
对保留租约的保留参数的更新。 |
RetentionLease
有效的保留租约可防止自动系统删除管道运行。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdOn |
string (date-time) |
创建租约时。 |
| definitionId |
integer (int32) |
运行的管道定义。 |
| leaseId |
integer (int32) |
此租约的唯一标识符。 |
| ownerId |
string |
标识保留租约所有者的非唯一字符串。 |
| protectPipeline |
boolean |
如果设置,此租约也会阻止在租约仍然有效时删除管道。 |
| runId |
integer (int32) |
此租约保护的管道运行。 |
| validUntil |
string (date-time) |
租约的最后一天被视为有效。 |
RetentionLeaseUpdate
对保留租约的保留参数的更新。
| 名称 | 类型 | 说明 |
|---|---|---|
| daysValid |
integer (int32) |
考虑租约有效的天数。 有效期超过 100 年的保留租约(36500 天)将显示为保留生成“永远”。 |
| protectPipeline |
boolean |
如果设置,此租约也会阻止在租约仍然有效时删除管道。 |