Hosts APIs

Hosts APIs

APIs for managing Hosts

Table of Contents

Note : The ipAddress field in request payload or response body are deprecated and will be removed. Please use fqdn field instead.

1. Get the Hosts

1.1. Prerequisites API

None
Get All Hosts

1.2. Steps API

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4689

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx02.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.101",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "status" : "ASSIGNED",
    "hybrid" : true
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx03.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.102",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "status" : "ASSIGNED",
    "hybrid" : true
  } ]
}

Get ASSIGNED Hosts
This API can be used to fetch all the hosts that are currently assigned to any domain and hence cannot be used for other domain tasks

1.3. Steps API

  • Invoke the API by specifying the "status" as "ASSIGNED".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts?status=ASSIGNED' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts?status=ASSIGNED HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1705

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  } ]
}

Get Hosts by Domain
This API can be used to fetch all the hosts that are currently assigned to a given domain.

1.4. Steps API

  • Invoke the API by specifying the "domainId".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts?domainId=377236f7-4965-4179-895e-eeb4eb9a6ad1' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts?domainId=377236f7-4965-4179-895e-eeb4eb9a6ad1 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1705

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  } ]
}

Get Hosts by Cluster
This API can be used to fetch all the hosts that are currently assigned to a given cluster.

1.5. Steps API

  • Invoke the API by specifying the "clusterId".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts?clusterId=4205afdd-94f5-403e-a051-1a9bba09ef40' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts?clusterId=4205afdd-94f5-403e-a051-1a9bba09ef40 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1705

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  } ]
}

Get Hosts by Storage Type
This API can be used to fetch all the hosts that are currently configured with the given storage type.

Note : Supported storage type is "VSAN".

1.6. Steps API

  • Invoke the API by specifying the "storageType".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts?storageType=VSAN' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts?storageType=VSAN HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1705

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  } ]
}

Get Hosts by Datastore Name
This API can be used to fetch all the hosts that are currently configured with the given datastore.

1.7. Steps API

  • Invoke the API by specifying the "datastoreName".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts?datastoreName=datastore1' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts?datastoreName=datastore1 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1705

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "serialNumber" : null,
    "esxiVersion" : "7.0.0-13006603",
    "sshThumbprint" : null,
    "sslThumbprint" : null,
    "fqdn" : "sfo01-m01-esx01.rainpole.io",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "isPrimary" : false,
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.0,
      "usedFrequencyMHz" : 0.0,
      "cores" : 2,
      "cpuCores" : [ {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      }, {
        "frequencyMHz" : 2497.0,
        "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
        "manufacturer" : "Intel"
      } ]
    },
    "memory" : {
      "totalCapacityMB" : 79999.0,
      "usedCapacityMB" : 0.0
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "usedCapacityMB" : 0.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2",
      "speed" : 0,
      "unit" : "MB"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3",
      "speed" : 0,
      "unit" : "MB"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED",
    "compatibleStorageType" : "VSAN",
    "hybrid" : false
  } ]
}

[_gethosts] API [_gethost] API

2. Get a Host

2.1. Prerequisites API

The following data is required

  • ID of the host

2.2. Steps API

  • Invoke the API by providing the ID of the host as input.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts/c0703437-6746-470b-9e1c-f9d3bbc9b1c1' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts/c0703437-6746-470b-9e1c-f9d3bbc9b1c1 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1556

{
  "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
  "serialNumber" : null,
  "esxiVersion" : "7.0.0-13006603",
  "sshThumbprint" : null,
  "sslThumbprint" : null,
  "fqdn" : "sfo01-m01-esx01.rainpole.io",
  "hardwareVendor" : "VMware, Inc.",
  "hardwareModel" : "VMware Virtual Platform",
  "isPrimary" : false,
  "ipAddresses" : [ {
    "ipAddress" : "10.0.0.100",
    "type" : "MANAGEMENT"
  } ],
  "cpu" : {
    "frequencyMHz" : 4994.0,
    "usedFrequencyMHz" : 0.0,
    "cores" : 2,
    "cpuCores" : [ {
      "frequencyMHz" : 2497.0,
      "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
      "manufacturer" : "Intel"
    }, {
      "frequencyMHz" : 2497.0,
      "model" : "Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz",
      "manufacturer" : "Intel"
    } ]
  },
  "memory" : {
    "totalCapacityMB" : 79999.0,
    "usedCapacityMB" : 0.0
  },
  "storage" : {
    "totalCapacityMB" : 781250.0,
    "usedCapacityMB" : 0.0,
    "disks" : [ {
      "capacityMB" : 390625.0,
      "diskType" : "HDD"
    }, {
      "capacityMB" : 390625.0,
      "diskType" : "FLASH"
    } ]
  },
  "physicalNics" : [ {
    "deviceName" : "vmnic0",
    "macAddress" : "02:00:1b:31:93:d2",
    "speed" : 0,
    "unit" : "MB"
  }, {
    "deviceName" : "vmnic1",
    "macAddress" : "02:00:1b:31:93:d3",
    "speed" : 0,
    "unit" : "MB"
  } ],
  "domain" : {
    "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
  },
  "cluster" : {
    "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
  },
  "status" : "ASSIGNED",
  "compatibleStorageType" : "VSAN",
  "hybrid" : false
}

[_gethosts] API [_gethost] API

3. Get the unmanaged hosts based on a Criterion

This API is used to get the unmanaged hosts from vCenter that meets a specific criterion.

3.1. Prerequisites API

  • The cluster in a domain to which hosts are to be added must exist.

  • There must be a host already added to the cluster VCenter.

Get the unmanaged hosts from vCenter based on a criterion

3.2. Steps API

  • Get the ID of the cluster to which hosts are going to be added

  • TIP: Get the Clusters

  • Filter the response by cluster name and get the respective ID

  • Invoke the Get Hosts Criteria API to list all the criteria supported.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/criteria' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/criteria HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 183

{
  "elements" : [ {
    "name" : "UNMANAGED_HOSTS_IN_VCENTER",
    "arguments" : { },
    "description" : "All unmanaged hosts that are not in inventory but there in vCenter"
  } ]
}
  • Pick one of the criterion and post a query with its name attribute

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/queries' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "UNMANAGED_HOSTS_IN_VCENTER"
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/queries HTTP/1.1
Content-Type: application/json
Content-Length: 43
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "UNMANAGED_HOSTS_IN_VCENTER"
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/queries/622671d0ab32-2d54bb6c-637a-49a4-a94c
Content-Type: application/json
Content-Length: 168

{
  "queryInfo" : {
    "status" : "IN_PROGRESS",
    "completed" : false,
    "processing" : true,
    "failure" : false
  },
  "result" : {
    "elements" : [ ]
  }
}
  • Read the tracking URL returned as Location header in the previous step.

  • Poll the tracking URL until the "status" is not "IN_PROGRESS".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/queries/622671d0ab32-2d54bb6c-637a-49a4-a94c' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/hosts/queries/622671d0ab32-2d54bb6c-637a-49a4-a94c HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 348

{
  "queryInfo" : {
    "status" : "COMPLETED",
    "completed" : true,
    "processing" : false,
    "failure" : false
  },
  "result" : {
    "elements" : [ {
      "fqdn" : "sfo-w01-esx01.sfo.rainpole.io",
      "ipAddresses" : [ {
        "ipAddress" : "10.0.0.100",
        "type" : "MANAGEMENT"
      } ],
      "hybrid" : false
    } ]
  }
}

4. Get the hosts discovered by HCI manager

This API is used to get the hosts discovered by the HCI manager.

4.1. Prerequisites API

  • The hosts must be imaged and be discovered by HCI Manager

  • The HCI Manager must be discoverable by the SDDC Manager

  • The HCI Manager SSL FQDN and SSL Thumbprint

4.2. Steps to get the VCF unmanaged hosts discovered by HCI Manager API

  • Enlist all the criteria available - invoke the Get Host Criterion API to list all the criteria supported.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts/criteria' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts/criteria HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1217

{
  "elements" : [ {
    "name" : "HOST_COMPATIBLE_WITH_CLUSTER_USING_PNICS",
    "arguments" : {
      "storageType" : "Storage type of host",
      "clusterId" : "ID of the cluster"
    },
    "description" : "Return all hosts that are compatible with a cluster"
  }, {
    "name" : "UNMANAGED_HOSTS_IN_HCIMGR",
    "arguments" : {
      "hciManagerFqdn" : "HCI Manager FQDN",
      "hciManagerSslThumbprint" : "HCI Manager SSL Thumbprint"
    },
    "description" : "Return all the unmanaged hosts discovered by HCI manager through auto discovery"
  }, {
    "name" : "UNMANAGED_HOSTS_IN_HCIMGR_MANUAL_DISCOVERY",
    "subCriteria" : [ {
      "name" : "UNMANAGED_HOSTS_IN_HCIMGR_MANUAL_DISCOVERY",
      "arguments" : {
        "managementIp" : "Un-managed host management IP address",
        "rootPassword" : "Un-managed host root password"
      },
      "description" : "Return all the unmanaged hosts discovered by HCI manager through manual discovery"
    } ],
    "arguments" : {
      "hciManagerFqdn" : "HCI Manager FQDN",
      "hciManagerSslThumbprint" : "HCI Manager SSL Thumbprint"
    },
    "description" : "Return all the unmanaged hosts discovered by HCI manager through manual discovery"
  } ]
}
  • Pick the UNMANAGED_HOSTS_IN_HCIMGR criterion and get inputs needed for host query

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts/criteria/UNMANAGED_HOSTS_IN_HCIMGR' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts/criteria/UNMANAGED_HOSTS_IN_HCIMGR HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 270

{
  "name" : "UNMANAGED_HOSTS_IN_HCIMGR",
  "arguments" : {
    "hciManagerFqdn" : "HCI Manager FQDN",
    "hciManagerSslThumbprint" : "HCI Manager SSL Thumbprint"
  },
  "description" : "Return all the unmanaged hosts discovered by HCI manager through auto discovery"
}
  • Execute the hosts query criterion with the name, arguments and description attributes

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts/queries' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "UNMANAGED_HOSTS_IN_HCIMGR",
  "arguments" : {
    "hciManagerFqdn" : "sfo01-m01-vxrm-2.rainpole.io",
    "hciManagerSslThumbprint" : "2F:3F:C3:D6:A8:00...."
  },
  "description" : "Return all the unmanaged hosts discovered by HCI manager"
}'

HTTP Request

POST /v1/hosts/queries HTTP/1.1
Content-Type: application/json
Content-Length: 254
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "UNMANAGED_HOSTS_IN_HCIMGR",
  "arguments" : {
    "hciManagerFqdn" : "sfo01-m01-vxrm-2.rainpole.io",
    "hciManagerSslThumbprint" : "2F:3F:C3:D6:A8:00...."
  },
  "description" : "Return all the unmanaged hosts discovered by HCI manager"
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/hosts/queries/cde13fc6-f3d9-44c5-9aa0-f4b1fe01d18d
Content-Type: application/json
Content-Length: 183

{
  "queryInfo" : {
    "status" : "IN_PROGRESS",
    "queryId" : "cde13fc6-f3d9-44c5-9aa0-f4b1fe01d18d",
    "completed" : false,
    "processing" : true,
    "failure" : false
  }
}
  • Read the task tracking URL returned in Location header from the previous step

  • Poll the tracking URL until the "status" is not "IN_PROGRESS". The results would be available in the results property of the response JSON

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/hosts/queries/23dbc8bc-4981-4006-bf2d-5f0c9467ab79' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/hosts/queries/23dbc8bc-4981-4006-bf2d-5f0c9467ab79 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 9996

{
  "queryInfo" : {
    "status" : "COMPLETED",
    "completed" : true,
    "processing" : false,
    "failure" : false
  },
  "result" : {
    "elements" : [ {
      "serialNumber" : "7PH1XK20000000",
      "esxiVersion" : "7.0.2-17630552",
      "sshThumbprint" : "SHA256:BJx3DqKGSmEPkJ0znDC5TA8LQtaWbsCD0deiSkGfdV8",
      "sslThumbprint" : "62:EF:8D:87:EA:7B:AD:92:90:6A:A2:CA:62:DF:08:82:27:44:BC:9C",
      "hardwareVendor" : "Dell, Inc.",
      "hardwareModel" : "VxRail E560",
      "isPrimary" : false,
      "ipAddresses" : [ {
        "ipAddress" : "192.168.10.218",
        "type" : "MANAGEMENT"
      } ],
      "cpu" : {
        "frequencyMHz" : 2095.0,
        "usedFrequencyMHz" : 0.0,
        "cores" : 32
      },
      "memory" : {
        "totalCapacityMB" : 391806.0,
        "usedCapacityMB" : 0.0
      },
      "storage" : {
        "totalCapacityMB" : 8.001639084E12,
        "usedCapacityMB" : 0.0,
        "disks" : [ {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        } ]
      },
      "physicalNics" : [ {
        "deviceName" : "vmnic0",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic1",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic2",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic3",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic4",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic5",
        "speed" : 10000
      } ],
      "status" : "UNASSIGNED_USEABLE",
      "hybrid" : false
    }, {
      "serialNumber" : "7PGXWK20000000",
      "esxiVersion" : "7.0.2-17630552",
      "sshThumbprint" : "SHA256:Dw25E7seW54B5WS9Z3+/+GjHiggbrvsWNtOEnAT4kQM",
      "sslThumbprint" : "F0:D3:36:6A:DD:6A:21:BA:05:E3:A7:58:FC:2E:C7:CD:1B:8C:11:68",
      "hardwareVendor" : "Dell, Inc.",
      "hardwareModel" : "VxRail E560",
      "isPrimary" : true,
      "ipAddresses" : [ {
        "ipAddress" : "192.168.10.207",
        "type" : "MANAGEMENT"
      } ],
      "cpu" : {
        "frequencyMHz" : 2095.0,
        "usedFrequencyMHz" : 0.0,
        "cores" : 32
      },
      "memory" : {
        "totalCapacityMB" : 391806.0,
        "usedCapacityMB" : 0.0
      },
      "storage" : {
        "totalCapacityMB" : 8.001639084E12,
        "usedCapacityMB" : 0.0,
        "disks" : [ {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        } ]
      },
      "physicalNics" : [ {
        "deviceName" : "vmnic0",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic1",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic2",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic3",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic4",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic5",
        "speed" : 10000
      } ],
      "status" : "UNASSIGNED_USEABLE",
      "hybrid" : false
    }, {
      "serialNumber" : "7FVRHK20000000",
      "esxiVersion" : "7.0.2-17630552",
      "sshThumbprint" : "SHA256:1CnGAcC30TkNuQIe/CiRF89+OY47mKLTvOLVpnKQkSo",
      "sslThumbprint" : "87:B5:B9:0F:57:4A:61:F2:03:4A:50:55:6C:F1:77:CD:DD:76:CC:77",
      "hardwareVendor" : "Dell, Inc.",
      "hardwareModel" : "VxRail E560",
      "isPrimary" : false,
      "ipAddresses" : [ {
        "ipAddress" : "192.168.10.201",
        "type" : "MANAGEMENT"
      } ],
      "cpu" : {
        "frequencyMHz" : 2095.0,
        "usedFrequencyMHz" : 0.0,
        "cores" : 32
      },
      "memory" : {
        "totalCapacityMB" : 391806.0,
        "usedCapacityMB" : 0.0
      },
      "storage" : {
        "totalCapacityMB" : 8.001639084E12,
        "usedCapacityMB" : 0.0,
        "disks" : [ {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        } ]
      },
      "physicalNics" : [ {
        "deviceName" : "vmnic0",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic1",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic2",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic3",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic4",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic5",
        "speed" : 10000
      } ],
      "status" : "UNASSIGNED_USEABLE",
      "hybrid" : false
    }, {
      "serialNumber" : "7PHWWK20000000",
      "esxiVersion" : "7.0.2-17630552",
      "sshThumbprint" : "SHA256:p1g9Pjtq/S+u3I6orWPAMOWEtdAewXEVR3usUTIxjCs",
      "sslThumbprint" : "EF:56:9E:0B:13:A5:9C:13:08:01:EF:F6:53:7D:E9:DA:BC:A8:37:F6",
      "hardwareVendor" : "Dell, Inc.",
      "hardwareModel" : "VxRail E560",
      "isPrimary" : false,
      "ipAddresses" : [ {
        "ipAddress" : "192.168.10.141",
        "type" : "MANAGEMENT"
      } ],
      "cpu" : {
        "frequencyMHz" : 2095.0,
        "usedFrequencyMHz" : 0.0,
        "cores" : 32
      },
      "memory" : {
        "totalCapacityMB" : 391806.0,
        "usedCapacityMB" : 0.0
      },
      "storage" : {
        "totalCapacityMB" : 8.001639084E12,
        "usedCapacityMB" : 0.0,
        "disks" : [ {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        } ]
      },
      "physicalNics" : [ {
        "deviceName" : "vmnic0",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic1",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic2",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic3",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic4",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic5",
        "speed" : 10000
      } ],
      "status" : "UNASSIGNED_USEABLE",
      "hybrid" : false
    }, {
      "serialNumber" : "7FTZHK20000000",
      "esxiVersion" : "7.0.2-17630552",
      "sshThumbprint" : "SHA256:FuQtBoZu7/9+1qp/6d05v54uxLY1v8KhBXwb0Npf0CE",
      "sslThumbprint" : "02:AE:62:97:CF:9A:34:C6:34:0D:0C:A7:FE:9F:E8:35:E0:BE:82:7E",
      "hardwareVendor" : "Dell, Inc.",
      "hardwareModel" : "VxRail E560",
      "isPrimary" : false,
      "ipAddresses" : [ {
        "ipAddress" : "192.168.10.186",
        "type" : "MANAGEMENT"
      } ],
      "cpu" : {
        "frequencyMHz" : 2095.0,
        "usedFrequencyMHz" : 0.0,
        "cores" : 32
      },
      "memory" : {
        "totalCapacityMB" : 391806.0,
        "usedCapacityMB" : 0.0
      },
      "storage" : {
        "totalCapacityMB" : 8.001639084E12,
        "usedCapacityMB" : 0.0,
        "disks" : [ {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 4.00088457E11,
          "diskType" : "FLASH"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        }, {
          "capacityMB" : 1.200243695E12,
          "diskType" : "HDD"
        } ]
      },
      "physicalNics" : [ {
        "deviceName" : "vmnic0",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic1",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic2",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic3",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic4",
        "speed" : 10000
      }, {
        "deviceName" : "vmnic5",
        "speed" : 10000
      } ],
      "status" : "UNASSIGNED_UNUSEABLE",
      "hybrid" : false
    } ]
  }
}

Last updated 2024-08-27 16:13:54 -0700

Operations
GET
Get Tags Assigned To Host
PUT
Assign Tags To Host
DELETE
Remove Tags From Host
POST
Post Query
POST
Post Hosts Prechecks 1
GET
Get Hosts
Get all hosts
GET
Get Host
Get a host by its ID
GET
Get Host Tag Manager Url
GET
Get Assignable Tag For Host
GET
Get Tags Assigned To Hosts
GET
Get Host Query Response
GET
Get Hosts Prechecks Response
GET
Get Criteria
GET
Get Criterion