Leases - Add
Adds new leases for pipeline runs.
POST https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?api-version=6.0-preview.1
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
organization
|
path | True |
|
The name of the Azure DevOps organization. |
|
project
|
path | True |
|
Project ID or project name |
|
api-version
|
query | True |
|
Version of the API to use. This should be set to '6.0-preview.1' to use this version of the api. |
Request Body
| Name | Type | Description |
|---|---|---|
| body |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
successful operation |
Security
accessToken
Personal access token. Use any value for the user name and the token as the password.
Type:
basic
Definitions
|
New |
|
|
Retention |
A valid retention lease prevents automated systems from deleting a pipeline run. |
NewRetentionLease
| Name | Type | Description |
|---|---|---|
| daysValid |
|
The number of days to consider the lease valid. |
| definitionId |
|
The pipeline definition of the run. |
| ownerId |
|
User-provided string that identifies the owner of a retention lease. |
| protectPipeline |
|
If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. |
| runId |
|
The pipeline run to protect. |
RetentionLease
A valid retention lease prevents automated systems from deleting a pipeline run.
| Name | Type | Description |
|---|---|---|
| createdOn |
|
When the lease was created. |
| definitionId |
|
The pipeline definition of the run. |
| leaseId |
|
The unique identifier for this lease. |
| ownerId |
|
Non-unique string that identifies the owner of a retention lease. |
| runId |
|
The pipeline run protected by this lease. |
| validUntil |
|
The last day the lease is considered valid. |