Hosts APIs

Hosts APIs

APIs for managing Hosts

Table of Contents

1. Get the Hosts

1.1. Prerequisites

None
Get All Hosts

1.2. Steps

  • 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: 4440

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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",
    "esxiVersion" : "7.0.0-13006603",
    "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",
    "esxiVersion" : "7.0.0-13006603",
    "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

  • 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: 1622

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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

  • 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: 1622

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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

  • 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: 1622

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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

  • 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: 1622

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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

  • 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: 1622

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "7.0.0-13006603",
    "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
  } ]
}

2. Get a Host

2.1. Prerequisites

The following data is required

  • ID of the host

2.2. Steps

  • 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: 1479

{
  "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
  "esxiVersion" : "7.0.0-13006603",
  "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
}

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

  • 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

  • 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",
    "processing" : true,
    "failure" : false,
    "completed" : 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",
    "processing" : false,
    "failure" : false,
    "completed" : true
  },
  "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

  • 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

  • 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: 535

{
  "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"
  } ]
}
  • 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: 247

{
  "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"
}
  • 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/af0fec08-0cbd-48d6-9f05-684e231868d9
Content-Type: application/json
Content-Length: 183

{
  "queryInfo" : {
    "status" : "IN_PROGRESS",
    "queryId" : "af0fec08-0cbd-48d6-9f05-684e231868d9",
    "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 2023-04-27 11:11:38 PDT

Operations
GET
Assignable Tags To Host
get Assignable Tags to Host
PUT
Assign Tags To Existing Host
Assign Tags to Host
GET
Get Criteria
Get all criteria
GET
Get Criterion
Get a criterion
GET
Get Host
Get a Host
GET
Get Host Query Response 1
Get query response
GET
Get Hosts
Get the Hosts
GET
Get Host Tag Manager Url
Get Host Tag Manager Url
GET
Get Tags Assigned To Host
Get Tags assigned to Host
GET
Get Tags Assigned To Hosts
Get Tags assigned to Hosts
POST
Post Query
Post a query
DELETE
Remove Tags From Host
Remove Tags From Host