You can use the UCP Advisor REST API to perform various administrative tasks. The specific API operations are described and run in the Swagger user interface that is displayed from UCP Advisor.
Accessing the UCP Advisor REST API
Access the UCP Advisor REST API from the Administration window.
Alternatively, if the UCP service is running and you know the IP address for the UCP controller VM, you can access the REST APIs in Swagger at: https://<controller-vm-ip>:23015/swagger-ui.html.
In the Navigator pane, click Administration.
Click the Rest API tab.
Click API Documentation.
Click a collection name to expand the list of operations for that collection.
Initiating a UCP Advisor API session
You must generate session authorization tokens for the UCP systems managed by UCP Advisor before you can run any administrative API operations on those systems.
Access the UCP Advisor API and then run the GetAppliances and Connect operations in the System collection to generate the session X-auth-Token required by all other API operations.
Access the UCP Advisor API.
Expand the System collection, and then click getAppliances (GET https://<UCP Advisor controller VM IP address> 23015/v1/services/system/actions/GetAppliances/invoke).
Click Try it out, and then click Execute.
The response body lists information for each of the registered and discovered UCP systems associated with the vCenter system.
In the System collection, click connect (POST https://<UCP Advisor controller VM IP address> 23015/v1/services/system/actions/Authenticate/invoke).
Click Try it out.
In the payload pane, enter the following for the UCP system to which you want to connect:
- applianceId: The "Id" parameter from the GetAppliances response body.
- password: The vCenter SSO password.
- username: The vCenter SSO username.
- vcenterIp: The vCenter IP address.
The X-Auth-Token is returned in the response body. Use this required session authorization token for all subsequent API operations for this UCP system.Response Body