Deployments can be configured to automatically expire after a fixed duration. The length of this duration is called the lease.
A lease can be applied via:
Once a lease is applied to the deployment, the Deployments UI will show the expiration date:
curl -k --location --request POST 'https://<FQDN_or_regional_endpoint>/deployment/api/deployments/<deploymentid>/requests?apiVersion=2020-08-25' \
--header 'Authorization: Bearer <bearertoken>' \
--header 'Content-Type: application/json' \
--data-raw '{
"actionId": "Deployment.ChangeLease",
"inputs": {
"Lease Expiration Date": "<NEW LEASE_EXPIRY DATE - FORMAT: 2022-09-25T14:50:00.000Z>"
}
}'
If the Lease was set using Day 2 action or API you can update the Lease via these methods without having any restriction, however, if you used Lease Policy the Change Lease will be limited to the Max Lease Limit and Maximum Total Lease configured in the Lease Policy, if you need to extend the lease more than Maximum Total Lease you will need two steps:
If you want to reduce the lease, update the Lease Policy. The change will be enforced without needing to run a day 2 action or API call.
Note: Keep in mind that before updating a Lease Policy, it is suggested to use the PREVIEW functionality as a policy can modify multiple deployments at the same time.
Additional information:
This article includes the following examples.
In this example, the deployments were created having a lease policy that limits the lease to 5 days. The goal in this example is to set the expiration date to 3 months.
curl -k --location --request POST 'https://FQDNorRegionalEndpoint/deployment/api/deployments/deploymentid/requests?apiVersion=2020-08-25' \
--header 'Authorization: Bearer bearertoken' \
--header 'Content-Type: application/json' \
--data-raw '{
"actionId": "Deployment.ChangeLease",
"inputs": {
"Lease Expiration Date": "NEW LEASE_EXPIRY DATE-FORMAT: 2022-09-25T14:50:00.000Z"
}
}'
curl -k --location --request POST 'https://vra.example.local/deployment/api/deployments/78d0a28c-fd0d-46de-9ebc-045922a58af5/requests?apiVersion=2020-08-25' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjY0NDczMTU2OTMxMzM2NjM0OTAifQ.eyJp(...)c3MiOiJodHRwOi8vaWRlbnRpdHktc2VydmljZS5wcmVsdWRlLnN2Yy5jbHVzdGVyLmxvY2FsOjg
hN4FkEg2tJvxjTPTv1ejEfnEj4jj9Eit4T0E0Kd9wOLxdMr4jp9zorjJmDH2N_GriyWqTegLySBqYirTVXbsbuQ' \
--header 'Content-Type: application/json' \
--data-raw '{
"actionId": "Deployment.ChangeLease",
"inputs": {
"Lease Expiration Date": "2024-01-31T14:50:00.000Z"
}
}'
curl -k --location --request POST 'https://FQDNorRegionalEndpoint/deployment/api/deployments/deploymentid/requests?apiVersion=2020-08-25' \
--header 'Authorization: Bearer bearertoken' \
--header 'Content-Type: application/json' \
--data-raw '{
"actionId": "Deployment.ChangeLease",
"inputs": {
}
}'