共用方式為


Leases - Update

更新保留租用的持續時間或管線保護狀態。

PATCH https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases/{leaseId}?api-version=7.1

URI 參數

名稱 位於 必要 類型 Description
leaseId
path True

integer (int32)

要更新之租用的標識碼。

organization
path True

string

Azure DevOps 組織的名稱。

project
path True

string

項目識別碼或項目名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。

要求本文

名稱 類型 Description
daysValid

integer (int32)

考慮租用有效的天數。 有效期超過 100 年(36500 天)的保留租用會顯示為保留組建「永遠」。

protectPipeline

boolean

如果設定,此租用也會防止在租用仍然有效時刪除管線。

回應

名稱 類型 Description
200 OK

RetentionLease

成功作業

安全性

oauth2

類型: oauth2
Flow: 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

範圍

名稱 Description
vso.build_execute 授與存取組建成品的能力,包括建置結果、定義和要求,以及能夠將組建排入佇列、更新組建屬性,以及透過服務攔截接收建置事件的相關通知的能力。

定義

名稱 Description
RetentionLease

有效的保留租用可防止自動化系統刪除管線執行。

RetentionLeaseUpdate

保留租用之保留參數的更新。

RetentionLease

有效的保留租用可防止自動化系統刪除管線執行。

名稱 類型 Description
createdOn

string (date-time)

建立租用時。

definitionId

integer (int32)

執行的管線定義。

leaseId

integer (int32)

此租用的唯一標識碼。

ownerId

string

識別保留租用擁有者的非唯一字串。

protectPipeline

boolean

如果設定,此租用也會防止在租用仍然有效時刪除管線。

runId

integer (int32)

此租用所保護的管線。

validUntil

string (date-time)

租用的最後一天會被視為有效。

RetentionLeaseUpdate

保留租用之保留參數的更新。

名稱 類型 Description
daysValid

integer (int32)

考慮租用有效的天數。 有效期超過 100 年(36500 天)的保留租用會顯示為保留組建「永遠」。

protectPipeline

boolean

如果設定,此租用也會防止在租用仍然有效時刪除管線。