cURL Examples of Performing Discovery and Planning Operations
The following cURL command examples show the syntax for performing life cycle operations such as discovering and managing product associations, listing updates, performing pre-checks, and retrieving reports.
List Product Catalog
This example lists all compatible versions of VMware products that can be associated with vCenter Server.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/product-catalog'
List Products Registered with vCenter Server
This example lists all VMware products associated with vCenter Server including manually added products.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/associated-products'
Add a New Product
This example associates a VMware product with vCenter Server.
curl -H "Content-Type: application/json" -X POST -d '{"name" :"vRealize Automation", "version": "6.8.9"}' -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/associated-products' -k -i
Get Product Details
This example retrieves details about a product associated with vCenter Server.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/products/com.vmware.vRA-6.8.9'
Modify a Product
This example updates a VMware product associated with vCenter Server. You can modify only manually added products.
curl -H "Content-Type: application/json" -X PATCH -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/associated-products/com.vmware.vRealOrche_7.3.1' -k -d '{"spec":{"deployments": ["<ip_address>"]}}'
Delete a Product
This example delete or dissociates a VMware product associated with vCenter Server. You can delete or dissociate only manually added products.
curl -X DELETE -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/products/com.vmware.vRA-6.8.9'
Create an Interoperability Report
This example generates an interoperability report for all VMware products associated with vCenter Server against a specific vCenter Server version.
curl -X POST -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/discovery/interop-report?vmw-task=true' -k -d '{"spec":{"target_version":"6.7.0.2000"}}' -H "Content-Type: application/json"
List Available Updates
This example lists all available and applicable updates for vCenter Server versions discovered in your environment. The list can contain minor, in-place, updates and major, migration-based, upgrades. The operation calculates which updates or upgrades are applicable based on the current vCenter Server version.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/update/pending'
Get Update Details
This example retrieves details about a specific vCenter Server update. The update is identified by the ID provided in the URL. The update can be either a minor, in-place, update or a major, migration-based, upgrade.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/update/pending/7.0.0.20000'
Run Update Pre-Checks
This example performs source update pre-checks and identifies whether the provided update ID corresponds to a minor update or a major upgrade. In case of a minor update, the operation invokes the appropriate update API. In case of a major upgrade, the operation downloads and installs the requirements.rpm file for the upgrade. The pre-check can be a long-running task, which you can monitor by using the task ID that the operation returns.
curl -X POST -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/update/pending/7.0.0.50000/precheck-report?vmw-task=true' -k
Monitor the Pre-Check Task
This example tracks the status, progress, and retrieves the final result of the pre-check operation.
curl -X GET -u [email protected]:<password> 'https://<server>:5480/rest/cis/tasks/3f77223f-1edb-4992-9c48-2d75d7b3b91d:com.vmware.vcenter.lcm.update.precheck_report' -k
Get Report
This example retrieves information about the location of the actual report for downloading.
curl -X GET -u [email protected]:<password> 'https://<server>:443/api/vcenter/lcm/reports/abcd123_report.csv'