You must log in to the server and establish a session before you can begin to use the VCPS APIs.

Prerequisites

The following information must be present in the config.properties file:
  • Key username as HCB_REST_API_USERNAME
  • Key password as HCB_REST_API_PASSWORD in encrypted form

Procedure

  1. The following POST request will be sent to the server:
    https://{{server_ip}}:9443/api/v1/session
    The user name and password is sent in the body of the request:
    curl --location --request POST "https://{{server_ip}}:9443/api/v1/session" \
      --header "Content-Type: application/json" \
      --data "{
        \"userName\":\"vcpps\",
        \"password\":\"VMware1!\"
    }"
    
  2. A successful call will create a session and return the session ID.
    {
        "JSESSIONID":"60F38BD96635823FEFB95E79DBBB6ED7"
    }
    

What to do next

Save the session ID as you will need to provide the ID when you call the other VCPS APIs.