This API will be called to get information about a specific host. The JSON specification of the host must be returned.

VMware needs information about the host before the host can be used to perform various Lifecycle Management (LCM) operations such as bring-up, add host, and so on. The host ID of the host whose specification is to be returned is sent with the GET request.

The JSON specification must contain the host ID, user name, password, IP information, and so on of each host. Additionally, certain tags must also be included in the JSON response. The tags must include the server profile ID, a boolean value to indicate if the host is reserved or not, and so on.

Procedure

  1. The following GET request will be sent to the server:
    https://{{server_ip}}:9443/api/v1/get_host/{hostId}
  2. A successful call must return the JSON specification file with the host ID, root credentials, IP details for VMKs, uplink NICs, and so on.
    {
      "hostId": "c27f33ac-8507-46ab-bb8d-43d80dac3f6b",
      "userName": "root",
      "password": [
        "S",
        "k",
        "o",
        "d",
        "a",
        "1",
        "!"
      ],
      "esxiMgmtNwSpec": {
        "ipSpec": {
          "ip": "172.17.11.101",
          "subnet": "255.255.255.0",
          "gateway": "172.17.11.1",
          "vlanId": "0",
          "fqdn": "esxmb1.lab.vmw"
        }
      },
      "vmotionNwSpec": {
        "ipSpec": {
          "ip": "172.17.10.131",
          "subnet": "255.255.255.0",
          "gateway": "172.17.10.1",
          "vlanId": "0"
        }
      },
      "vsanNwSpec": {
        "ipSpec": {
          "ip": "172.17.12.121",
          "subnet": "255.255.255.0",
          "gateway": "172.17.12.1",
          "vlanId": "0"
        }
      },
      "nfsNwSpec": {
          "ipSpec": {
            "ip": "172.17.13.10",
            "subnet": "255.255.255.0",
            "gateway": "172.17.13.10",
            "vlanId": "0"
          }
        },
      "pnicSpec": {
        "uplink1": {
            "name": "vmnic0"
          },
          "uplink2": {
            "name": "vmnic1"
          },
          "uplink3": {
            "name": "vmnic2"
          },
          "uplink4": {
            "name": "vmnic3"
          }
      },
    "tags": {
          "ServerProfile": "SP1",
          "dcAssociation" :"e1701974-a0ef-4e23-9881-7b2a9aa62259", 
          "isReserved" : "true",
          "Zone": "availabilityDomain1"
       }
    }