HCX - Connector and Cloud Manager Upgrade using REST API
search cancel

HCX - Connector and Cloud Manager Upgrade using REST API

book

Article ID: 328978

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

This document describes the process of performing Software Upgrades on HCX Cloud Manager and Connector using REST API's.

Resolution

1.    Grab the XHM Auth Token to be used in all the API calls made to the HCX manager. 

       URL: https://<hcx_manager_ip>/hybridity/api/sessions
       METHOD: POST
       BODY: Pass the HCX manager credentials JSON as payload in the POST call. “{'username': ‘###########’, 'password': ‘###########’}”
       REQUEST HEADERS:  content-type: text/plain
                                             accept: application/json
       RESPONSE CONTENT: x-hm-authorization

 

2.    Next we need to trigger the HCX manager to get the latest version available from HCX Command and Control. This  API also provides other vital information like endpointId and Version that will be required to be passed in the upgrade API body. 
Please Note, This API call can also shows Older Releases, the first entry in the Response will be latest version with Build Number (this will be the default selection and will be passed on to the Upgrade API). It is always recommended to upgrade to the latest version, if there has been an exception made for your system to go on a different upgrade, please select the respective version and pass it in the Upgrade API.

 
      URL: https://<hcx_manager_ip>/hybridity/api/upgrade?action=getNotifications
      METHOD: POST
      BODY: Pass the NULL values for endpointId and version JSON (This is required to trigger the Update Notification on the system) in the post call. {“endpointId": "", "version": “”}
      REQUEST HEADERS:  x-hm-authorization: <access_token >
                                             content-type: application/json
                                             accept: application/json
      RESPONSE CONTENT: {'endpointId': '#######################################', 'version': '4.3.0.0.19064502'}


3.    We perform the upgrade on the system. Please Note: This will be a service affecting API call, the system will reboot.

       URL: https://<hcx_manager_ip>/hybridity/api/upgrade?action=start
       METHOD: POST
       BODY: Pass the version and endpointId obtained from getNotifications as JSON.
       REQUEST HEADER: x-hm-authorization: <access_token>
                                          content-type: application/json
                                          accept: application/json

4.    Finally we verify if the system has been upgraded to the desired version.

      URL:  https://<hcx_manager_ip>/hybridity/api/hcspAppliances
      METHOD: POST 
      BODY: Pass this as JSON body {"action": "query", "filter": {"local": "true"}} 
      REQUEST HEADER: x-hm-authorization: <access_token>
                                         content-type: application/json
                                         accept: application/json
      RESPONSE CONTENT: [{'systemName': ‘hcx_fqdn', 'systemType': 'HCX Cloud', 'version': 'current_running_version'}]