Collect Lease expiration using API
search cancel

Collect Lease expiration using API

book

Article ID: 387804

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

In Aria Automation, you may need to find VMs that expire in a specific date range using the API. 

For example, in a large environment where you may have hundreds of pages of deployments, you may need to search for VMs that will expire soon, so that the lease can be extended.

Environment

Aria Automation 8.x (vRA) (vRealize Automation)

Cause

You cannot export a list in the UI, and sorting the deployments list in the UI may not be helpful due to the number of VMs. In this situation, the API can be utilized to collect a smaller sub-set base on the date.

Resolution

This is an example of the API call to get VMs that expire in the specified date range using cURL, which can be run from the Automation Appliance via SSH. You can also use postman or something similar. 


curl -vk -X 'GET' \

  'https://<Aria_Automation_FQDN>/deployment/api/deployments?expiresAt=%5B2025-01-00T00:00:00.000Z,2025-02-01T00:00:00.000Z%5D' \

  -H 'accept: application/json' \

  -H 'Authorization: <Bearer Token>'

  1. You will need to first obtain the Bearer token for authorization.
         https://knowledge.broadcom.com/external/article/346005/generate-an-access-token-and-bearer-toke.html 

  2. Replace <Bearer Token> with the token you obtained

  3. Replace <Aria_Automation_FQDN> with the FQDN of your Aria Automation appliance

  4. Change the date range filter at the end of the URL to the desired time frame.

         To set the range to February 2nd, 2025 to August 8th, 2025, it would look like this:  

    Example:
    expiresAt=%5B2025-02-01T00:00:00.000Z,2025-08-01T00:00:00.000Z%5D'