Get Access to the vCloud API with Performance Cloud VMware (NSX-T)

 

TABLE OF CONTENTS

Notes

In the example below, we are using a software named Postman and the CAN URL for Performance Cloud VMware, but you could use any compatible API platform. The USA URL would work the same way too.

Sherweb will not provide any type of support for the use of the mentioned tool or any other 3rd party software. Please refer to the software vendor's support website for any support requests. 

Requirements

Have Postman installed

Procedure

Step 1 – Create a new collection & Authenticate to the API

  1. In Postman, create a new collection.

    Graphical user interface, application

Description automatically generated


  2. Give a name to the new collection and change the authorization type to Basic Auth.

    Une image contenant texte

Description générée automatiquement


  3. Enter the username and password and click on Save.

    The username to enter is your [Sherweb Cloud username] + [@] + [Performance Cloud VMware organisation]
    Example: john@domain.com@orgname

    Une image contenant texte

Description générée automatiquement


  4. Create a new request.

    Graphical user interface, application

Description automatically generated


  5. Execute the folowing query:

    GET https://performancecloud-vdc.sherweb.com/api/versions

      
    Une image contenant texte

Description générée automatiquement


  6. Confirm you properly authenticated with the authorization value in Headers tab.

    Une image contenant texte

Description générée automatiquement


Step 2 - Discover the supported API versions


With the GET call previously performed, validate the API versions supported to make sure your API calls are supported.

Une image contenant table

Description générée automatiquement


Step 3 - Establish a session

In the Headers section, create a new key like this:

Key: Accept

Value: Application/*+xml;version=35.2

Note: version should be the latest version available from Step 2

Une image contenant texte

Description générée automatiquement


Create a session to vCloud Director using basic auth

Note: Using this method with the x-vcloud-authorization value, the session will be reset after few hours.

Execute the following query to confirm you have successfully created a session to vcloud director:
  

POST https://performancecloud-vdc.sherweb.com/api/sessions
  

You should receive a "200 OK" response to confirm it is successful.

Une image contenant texte

Description générée automatiquement

 

Take note of the x-vcloud-authorization value

Une image contenant texte, capture d’écran, intérieur

Description générée automatiquement


Create a new key in the Headers section

Key: x-vcloud-authorization

Value: value from previous step

 

Graphical user interface, application

Description automatically generated


Create a session to vCloud Director using bearer token

 

In Tests tab, enter the following lines and click on Send:

 

var bearer = postman.getResponseHeader("X-VMWARE-VCLOUD-ACCESS-TOKEN")

pm.environment.set("X-VMWARE-VCLOUD-ACCESS-TOKEN",bearer)

Une image contenant table

Description générée automatiquement

 

Get the X-VMWARE-VCLOUD-ACCESS-TOKEN value.


Une image contenant texte

Description générée automatiquement


Go to the Authorization tab. Change the authorization type from Inherit from parent to Bearer Token.

Set the value from previous step and click on Save.

Graphical user interface, text, application

Description automatically generated


Test query to get org information


Execute the following query:

GET https://performancecloud-vdc.sherweb.com/api/org

The result should look like this:

Graphical user interface, text, application, email

Description automatically generated


Step 4 - Perform queries

Here are some queries as examples.
 

References

https://developer.broadcom.com/