System Upgrade workflow via API
search cancel

System Upgrade workflow via API

book

Article ID: 321602

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

HCX Connector/Cloud Manager upgrade can be triggered via standalone/hybridity UI, vCenter Plugin UI under Administration - System Updates section.
Note: HCX 9443 Admin UI can be used for offline upgrades using pre-downloaded bundle only.

For user's automation requirements, HCX Upgrade APIs can be used to trigger upgrade workflow for Connector & Cloud systems.
IMPORTANT: Any user driven automation scripts using below API module/steps should be tested before using in a production environment.

Resolution

HCX Upgrade API

Following are the APIs available on HCX Manager useful for the upgrade process.
Note: In all these APIs, {{hcx_manager}} is the IP/FQDN of HCX Connector or Cloud Manager.

Step 1: Obtain session token for the HCX Manager.
This API requires HCX Manager SSO credentials to generate "x-hm-authorization" code.

POST https://{{hcx_manager}}/hybridity/api/sessions
 
Headers:
Content-Type: application/json
 
Request Body:
{ 
   "username":"[email protected]",
   "password":"<password>"
}

Note: Use vCenter SSO credentials registered with HCX Manager in the request body.

Step 2: Fetch available upgrade notifications.

POST https://{{hcx_manager}}/hybridity/api/upgrade?action=getNotifications
 
Headers:
x-hm-authorization: {{x_hm_auth}}
Content-Type: application/json
 
Request Body:
{"endpointId": "{{system_ID}}" }

Note: Enter "x-hm-authorization" obtained from Step 1. Also, enter "system_ID" obtained from HCX standalone/hybridity UI or vCenter Plugin UI under Administration - Support section.

Step 3: Trigger HCX Manager Upgrade process.

POST https://{{hcx_manager}}/hybridity/api/upgrade?action=start
 
Headers:
x-hm-authorization: {{x_hm_auth}}
Content-Type: application/json
 
Request Body:
{
"endpointId":"{{system_ID}}",
"version":"{{upgradeVersion}}"
}

Note: Enter desired "upgradeVersion" details obtained from Step 2 needed for upgrade.

Step 4: Fetch upgrade progress details.

POST https://{{hcx_manager}}/hybridity/api/upgrade?action=queryStatus
 
Headers:
x-hm-authorization: {{x_hm_auth}}
Content-Type: application/json

Request Body:
{"endpointId":"{{system_ID}}"}