VMware Cloud Foundation API Reference Guide

VMware Cloud Foundation API Reference Guide

2. Usecases

2.1. Hosts

2.1.1. Commission the Hosts

Prerequisites
  1. The following data is required

    • Username of each host

    • Password of each host

    • FQDN of each host

    • Network pool name to which each host has to be associated with (Optional)

    • Network pool ID to which each host has to be associated with

  1. The host, if intended to be used for a vSAN domain, should be vSAN compliant and certified as per the VMware Hardware Compatibility Guide.

  2. BIOS, HBA, SSD, HDD, etc. of the host must match the VMware Hardware Compatibility Guide.

  3. The host must have the drivers and firmware versions specified in the VMware Hardware Compatibility Guide.

  4. The host must have the supported version of ESXi (i.e 6.7.0-13006603) pre-installed on it.

  5. SSH and syslog must be enabled on the host.

  6. The host must be configured with DNS server for forward and reverse lookup and FQDN.

  7. The host name must be same as the FQDN.

  8. The host must have a standard switch with two NIC ports with a minimum 10 Gbps speed.

  9. The management IP must be configured to the first NIC port.

  10. Ensure that the host has a standard switch and the default uplinks with 10Gb speed are configured starting with traditional numbering (e.g., vmnic0) and increasing sequentially.

  11. Ensure that the host hardware health status is healthy without any errors.

  12. All disk partitions on HDD / SSD are deleted.

  13. The hosts, if intended to be used for vSAN domain must be associated with vSAN enabled network pool.

  14. The hosts, if intended to be used for NFS domain must be associated with NFS enabled network pool.

Steps
  1. Validate the input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts/validations/commissions' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "58d74167-ee80-4eb8-90d9-cdfb3c1cd9f3",
  "networkPoolName" : "engineering-networkpool"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "1ff2838a-1983-4747-a94d-d30b2d13a973",
  "networkPoolName" : "finance-networkpool"
} ]'

HTTP Request

POST /v1/hosts/validations/commissions HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 486
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "58d74167-ee80-4eb8-90d9-cdfb3c1cd9f3",
  "networkPoolName" : "engineering-networkpool"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "1ff2838a-1983-4747-a94d-d30b2d13a973",
  "networkPoolName" : "finance-networkpool"
} ]

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/hosts/validations/344819cc-54b8-4228-a903-f644fdeaa8a6
Content-Type: application/json;charset=UTF-8
Content-Length: 542

{
  "id" : "344819cc-54b8-4228-a903-f644fdeaa8a6",
  "description" : "Validate input specification to commission one or more hosts to VMware Cloud Foundation",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating input specification",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating host esfo01m01esx01.sfo01.rainpole.local",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating host esfo01m01esx02.sfo01.rainpole.local",
    "resultStatus" : "UNKNOWN"
  } ]
}
  1. Poll until "executionStatus" is not "IN_PROGRESS" using the "id" from the previous response.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts/validations/344819cc-54b8-4228-a903-f644fdeaa8a6' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/hosts/validations/344819cc-54b8-4228-a903-f644fdeaa8a6 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 452

{
  "id" : "344819cc-54b8-4228-a903-f644fdeaa8a6",
  "description" : "Validate input specification to commission one or more hosts to VMware Cloud Foundation",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating host esfo01m01esx01.sfo01.rainpole.local",
    "resultStatus" : "SUCCEEDED"
  }, {
    "description" : "Validating host esfo01m01esx02.sfo01.rainpole.local",
    "resultStatus" : "UNKNOWN"
  } ]
}
  1. In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts/validations/344819cc-54b8-4228-a903-f644fdeaa8a6' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/hosts/validations/344819cc-54b8-4228-a903-f644fdeaa8a6 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 484

{
  "id" : "344819cc-54b8-4228-a903-f644fdeaa8a6",
  "description" : "Validate input specification to commission one or more hosts to VMware Cloud Foundation",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "Validating host esfo01m01esx01.sfo01.rainpole.local",
    "resultStatus" : "SUCCEEDED"
  }, {
    "description" : "Validating host esfo01m01esx02.sfo01.rainpole.local",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  1. In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

Note
Make changes to the input specification and re-validate using a new API invocation.
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "58d74167-ee80-4eb8-90d9-cdfb3c1cd9f3",
  "networkPoolName" : "engineering-networkpool"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "1ff2838a-1983-4747-a94d-d30b2d13a973",
  "networkPoolName" : "finance-networkpool"
} ]'

HTTP Request

POST /v1/hosts HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 486
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "58d74167-ee80-4eb8-90d9-cdfb3c1cd9f3",
  "networkPoolName" : "engineering-networkpool"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "storageType" : "VSAN",
  "networkPoolId" : "1ff2838a-1983-4747-a94d-d30b2d13a973",
  "networkPoolName" : "finance-networkpool"
} ]

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/7ddd9144-ddb8-437c-8bb7-ea3c23fbf2b3
Content-Type: application/json;charset=UTF-8
Content-Length: 79

{
  "id" : "7ddd9144-ddb8-437c-8bb7-ea3c23fbf2b3",
  "status" : "IN_PROGRESS"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.1.2. Get the Hosts

Prerequisites

None

Get All Hosts

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/hosts HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3793

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "6.7.0-13006603",
    "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "esxiVersion" : "6.5.0-13006603",
    "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.101",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "status" : "UNASSIGNED_USEABLE"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "esxiVersion" : "6.5.0-13006603",
    "fqdn" : "esfo01m01esx03.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.102",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "status" : "UNASSIGNED_UNUSEABLE"
  } ]
}

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

Steps
  1. Invoke the API by specifying the "status" as "ASSIGNED".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts?status=ASSIGNED' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/hosts?status=ASSIGNED HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1373

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "esxiVersion" : "6.7.0-13006603",
    "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.100",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "domain" : {
      "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
    },
    "cluster" : {
      "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
    },
    "status" : "ASSIGNED"
  } ]
}

Get UNASSIGNED_USEABLE Hosts

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

Steps
  1. Invoke the API by specifying the "status" as "UNASSIGNED_USEABLE".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts?status=UNASSIGNED_USEABLE' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/hosts?status=UNASSIGNED_USEABLE HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1230

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "esxiVersion" : "6.5.0-13006603",
    "fqdn" : "esfo01m01esx02.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.101",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "status" : "UNASSIGNED_USEABLE"
  } ]
}

Get UNASSIGNED_UNUSEABLE Hosts

This API can be used to fetch all the hosts that are currently not assigned to any domain and can be used for other domain tasks after completion of cleanup operation

Note
Cleanup operations must be performed to get these host back into "UNASSIGNED" and "USEABLE" state.
Steps
  1. Invoke the API by specifying the "status" as "UNASSIGNED_UNUSEABLE".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts?status=UNASSIGNED_UNUSEABLE' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/hosts?status=UNASSIGNED_UNUSEABLE HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1232

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782638",
    "esxiVersion" : "6.5.0-13006603",
    "fqdn" : "esfo01m01esx03.sfo01.rainpole.local",
    "hardwareVendor" : "VMware, Inc.",
    "hardwareModel" : "VMware Virtual Platform",
    "ipAddresses" : [ {
      "ipAddress" : "10.0.0.102",
      "type" : "MANAGEMENT"
    } ],
    "cpu" : {
      "frequencyMHz" : 4994.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
    },
    "storage" : {
      "totalCapacityMB" : 781250.0,
      "disks" : [ {
        "capacityMB" : 390625.0,
        "diskType" : "HDD"
      }, {
        "capacityMB" : 390625.0,
        "diskType" : "FLASH"
      } ]
    },
    "physicalNics" : [ {
      "deviceName" : "vmnic0",
      "macAddress" : "02:00:1b:31:93:d2"
    }, {
      "deviceName" : "vmnic1",
      "macAddress" : "02:00:1b:31:93:d3"
    } ],
    "status" : "UNASSIGNED_UNUSEABLE"
  } ]
}

2.1.3. Get a Host

Prerequisites
  1. The following data is required

    • ID of the host

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts/c0703437-6746-470b-9e1c-f9d3bbc9b1c1' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/hosts/c0703437-6746-470b-9e1c-f9d3bbc9b1c1 HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1250

{
  "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
  "esxiVersion" : "6.7.0-13006603",
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local",
  "hardwareVendor" : "VMware, Inc.",
  "hardwareModel" : "VMware Virtual Platform",
  "ipAddresses" : [ {
    "ipAddress" : "10.0.0.100",
    "type" : "MANAGEMENT"
  } ],
  "cpu" : {
    "frequencyMHz" : 4994.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
  },
  "storage" : {
    "totalCapacityMB" : 781250.0,
    "disks" : [ {
      "capacityMB" : 390625.0,
      "diskType" : "HDD"
    }, {
      "capacityMB" : 390625.0,
      "diskType" : "FLASH"
    } ]
  },
  "physicalNics" : [ {
    "deviceName" : "vmnic0",
    "macAddress" : "02:00:1b:31:93:d2"
  }, {
    "deviceName" : "vmnic1",
    "macAddress" : "02:00:1b:31:93:d3"
  } ],
  "domain" : {
    "id" : "377236f7-4965-4179-895e-eeb4eb9a6ad1"
  },
  "cluster" : {
    "id" : "4205afdd-94f5-403e-a051-1a9bba09ef40"
  },
  "status" : "ASSIGNED"
}

2.1.4. Decommission the Hosts

Prerequisites
  1. The following data is required

    • FQDN of each host

  2. The host must not be assigned to a domain i.e "status" must be "UNASSIGNED_USEABLE".

Tip
Refer to: Get the Hosts to fetch the hosts with the required "status"
Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/hosts' -i -u 'admin:VMwareInfra@1' -X DELETE \
    -H 'Content-Type: application/json' \
    -d '[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local"
} ]'

HTTP Request

DELETE /v1/hosts HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 110
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

[ {
  "fqdn" : "esfo01m01esx01.sfo01.rainpole.local"
}, {
  "fqdn" : "esfo01m01esx02.sfo01.rainpole.local"
} ]

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/cf634c8c-5058-4f17-9540-22936f2c1bf3
Content-Type: application/json;charset=UTF-8
Content-Length: 79

{
  "id" : "cf634c8c-5058-4f17-9540-22936f2c1bf3",
  "status" : "IN_PROGRESS"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.2. Domains

A workload domain is a policy based resource container with specific availability and performance attributes that combines compute (vSphere), storage (vSAN/NFS) and networking (NSX) into a single consumable entity.

2.2.1. Create a Domain

The Create a Domain workflow automatically:

  • Deploys an additional vCenter Server Appliance for the new domain within the management domain.

  • By leveraging a separate vCenter Server instance per domain, software updates can be applied without impacting other domains. It also allows for each domain to have additional isolation as needed.

  • Connects the specified ESXi servers to this vCenter Server instance and groups them into a cluster. Each host is configured with the port groups applicable for the domain.

  • Configures networking on each ESXi host.

  • Configures vSAN or NFS storage on the ESXi Hosts.

  • For each NSX for vSphere Domain, the workflow deploys an NSX Manager in the management domain and three NSX controllers on the ESXi datastore. The workflow also configures an anti-affinity rule between the controller VMs to prevent them from being on the same host for High Availability.

  • For the first NSX-T VI Domain in your environment, the workflow deploys an NSX Manager and three NSX controllers in the management domain. The workflow also configures an anti-affinity rule between the controller VMs to prevent them from being on the same host for High Availability. All subsequent NSX-T Domains share this NSX-T Manager and Controllers.

  • For an NSX-T Domain, NSX Edges are needed to enable overlay VI networks and public networks for north-south traffic. NSX Edges are not deployed automatically for an NSX-T VI Domain. You can deploy them manually after the VI domain is created. Subsequent NSX-T VI Domains share the NSX-T Edges deployed for the first domain.

  • Licenses and integrates the deployed components with the appropriate pieces in the Cloud Foundation software stack.

The result is a workload-ready SDDC environment.

Prerequisites
  1. The following data is required

    • Name of the domain

    • vCenter details

      • Name of the vCenter

      • Network details

        • IP Address of the vCenter

        • FQDN of the vCenter

        • Gateway

        • Subnet mask

      • License key for the vCenter

      • Password for the root user (8-20 characters)

      • Name of the datacenter where vCenter needs to be deployed

    • List of clusters

      • For each cluster

        • Name of the cluster

        • List of hosts

          • For each host

            • ID of the host (UUID)

            • License key for the host

            • List of VDS names to associate with host

            • ID of the vmNic host to be associated with VDS, once added to cluster

        • Datastore details

          Note
          Only one of "vsanDatastoreSpec" (For VSAN) or NFS "nfsDatastoreSpecs" (For NFS) must be specified.
          • For VSAN

            • Number of host failures to tolerate (can be 0, 1, or 2)

            • License key for the vSAN datastore

              {"vsanDatastoreSpec":{"failuresToTolerate":1,"licenseKey":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","datastoreName":"vSanDatastore"}}
          • For NFS

            • List of NFS server names

            • Shared directory path

            • User tag used to annotate NFS share

            • Boolean to identify if the mount directory should be read-only

            {"nfsDatastoreSpecs":[{"nasVolume":{"serverName":["10.0.0.250"],"path":"/nfs_mount/my_read_write_folder","readOnly":false},"datastoreName":"NFSShare"}]}
        • Network Details

          • List of VDS details

            • For each VDS

              • Port group names and the corresponding transport type

              • DVS host Infrastructure traffic resource type

              • Maximum allowed usage for a traffic class

              • Amount of bandwidth to be reserved for the host infrastructure traffic class

          • NSX cluster Details

            Note
            Only one of "nsxVClusterSpec" (For NSX-V) or "nsxTClusterSpec" (For NSX-T) must be specified.
            • For NSX-V

              • VLAN ID of the VXLAN

              • License key for NSX

              • VDS to be used for VXLAN traffic/port group. This should belong to one of the VDS being created for the cluster

            {"nsxVClusterSpec":{"vlanId":3,"vdsNameForVxlanConfig":"SDDC-Dswitch-Private1"}}
            • For NSX-T

              • VLAN ID of Geneve

        {"nsxTClusterSpec":{"geneveVlanId":2}}
    • NSX details

      Note
      Only one of "nsxVSpec" (For NSX-V) or "nsxTSpec" (For NSX-T) must be specified.
      • For NSX-V

        • NSX Manager virtual machine details

          • Name of the NSX Manager virtual machine

          • Network details

            • IP address of the virtual machine

            • Fully-qualified domain name

            • Gateway

            • Subnet mask

        • NSX-V Controller Details

          • Controller IP addresses (three IPs) without duplicates

          • Controller password

          • Controller gateway

          • Controller subnet mask

        • License key for NSX

        • NSX Manager admin password (basic authorization and SSH)

        • NSX Manager enable password

        {"nsxManagerSpec":{"name":"nsx-manager-2","networkDetailsSpec":{"ipAddress":"10.0.0.44","dnsName":"nsx-manager-2.sfo01.rainpole.local","gateway":"10.0.0.250","subnetMask":"255.255.255.0"}},"nsxVControllerSpec":{"nsxControllerIps":["10.0.0.45","10.0.0.46","10.0.0.47"],"nsxControllerPassword":"Test123456$%","nsxControllerGateway":"10.0.0.250","nsxControllerSubnetMask":"255.255.255.0"},"licenseKey":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","nsxManagerAdminPassword":"Random0$","nsxManagerEnablePassword":"Random0$"}
      • For NSX-T

        • NSX Manager virtual machine details

          • Name of the NSX Manager virtual machine

          • Network details

            • IP Address of the virtual machine

            • Fully-qualified domain name

            • Gateway

            • Subnet mask

        • Virtual IP address which would act as proxy/alias for NSX-T managers

        • Fully-qualified domain name for VIP so that common SSL certificates can be installed across all managers

        • License key for NSX

        • NSX manager admin Password (basic authorization and SSH)

    {"nsxManagerSpecs":[{"name":"nsx-manager-2","networkDetailsSpec":{"ipAddress":"10.0.0.44","dnsName":"nsx-manager-2.sfo01.rainpole.local","gateway":"10.0.0.250","subnetMask":"255.255.255.0"}},{"name":"nsx-manager-3","networkDetailsSpec":{"ipAddress":"10.0.0.44","dnsName":"nsx-manager-2.sfo01.rainpole.local","gateway":"10.0.0.250","subnetMask":"255.255.255.0"}},{"name":"nsx-manager-4","networkDetailsSpec":{"ipAddress":"10.0.0.44","dnsName":"nsx-manager-2.sfo01.rainpole.local","gateway":"10.0.0.250","subnetMask":"255.255.255.0"}}],"vip":"10.0.0.166","vipFqdn":"vip-nsxmanager.sfo01.rainpole.local","licenseKey":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","nsxManagerAdminPassword":"Random0$"}
Warning
NSX details (i.e "nsxVSpec" or "nsxTSpec") must match NSX cluster details (i.e "nsxVClusterSpec" or "nsxTClusterSpec") in the input specification.
  1. Network pool should be configured.

Tip
Refer to Create a Network Pool
  1. Hosts should be commissioned.

Tip
Refer to Commission the Hosts
  1. A DHCP server must be configured on the VXLAN VLAN of the management domain. When NSX creates VXLAN VTEPs for the domain, they are assigned IP addresses from the DHCP server.

  2. Ensure that host configuration has a minimum of two active vmNics. There must be a free uplink on each host to be used for the domain.

Steps
  1. Validate the input specification.

Note
The below example is for creating a domain using vSAN storage (i.e "vsanDatastoreSpec") and NSX-V (i.e "nsxVSpec" and "nsxVClusterSpec")

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains/validations/creations' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "domainName" : "Domain1",
  "vcenterSpec" : {
    "name" : "vCenter1",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "vcenter-2.sfo01.rainpole.local",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "Random0$",
    "datacenterName" : "new-vi-1"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "802e91ed-3dc3-4b7a-bf83-a2854551e57e",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "6ea1a369-503d-4eaa-b7fa-2224bb8857c7",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "f8d217f2-0355-4e22-ac61-25ebe089e427",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "SDDC-Dswitch-Private1",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 3,
            "vdsNameForVxlanConfig" : "SDDC-Dswitch-Private1"
          }
        }
      }
    } ]
  },
  "nsxVSpec" : {
    "nsxManagerSpec" : {
      "name" : "nsx-manager-2",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "nsx-manager-2.sfo01.rainpole.local",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    },
    "nsxVControllerSpec" : {
      "nsxControllerIps" : [ "10.0.0.45", "10.0.0.46", "10.0.0.47" ],
      "nsxControllerPassword" : "Test123456$%",
      "nsxControllerGateway" : "10.0.0.250",
      "nsxControllerSubnetMask" : "255.255.255.0"
    },
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "Random0$",
    "nsxManagerEnablePassword" : "Random0$"
  }
}'

HTTP Request

POST /v1/domains/validations/creations HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 2633
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "domainName" : "Domain1",
  "vcenterSpec" : {
    "name" : "vCenter1",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "vcenter-2.sfo01.rainpole.local",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "Random0$",
    "datacenterName" : "new-vi-1"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "802e91ed-3dc3-4b7a-bf83-a2854551e57e",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "6ea1a369-503d-4eaa-b7fa-2224bb8857c7",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "f8d217f2-0355-4e22-ac61-25ebe089e427",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "SDDC-Dswitch-Private1",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 3,
            "vdsNameForVxlanConfig" : "SDDC-Dswitch-Private1"
          }
        }
      }
    } ]
  },
  "nsxVSpec" : {
    "nsxManagerSpec" : {
      "name" : "nsx-manager-2",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "nsx-manager-2.sfo01.rainpole.local",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    },
    "nsxVControllerSpec" : {
      "nsxControllerIps" : [ "10.0.0.45", "10.0.0.46", "10.0.0.47" ],
      "nsxControllerPassword" : "Test123456$%",
      "nsxControllerGateway" : "10.0.0.250",
      "nsxControllerSubnetMask" : "255.255.255.0"
    },
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "Random0$",
    "nsxManagerEnablePassword" : "Random0$"
  }
}

HTTP Response

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

{
  "id" : "164af373-f0d0-4491-b176-e49b9ad410cc",
  "description" : "Validating Domain Creation Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "DomainCreationSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  1. In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  2. In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

    Note
    Make changes to the input specification and re-validate using a new API invocation.
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "domainName" : "Domain1",
  "vcenterSpec" : {
    "name" : "vCenter1",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "vcenter-2.sfo01.rainpole.local",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "Random0$",
    "datacenterName" : "new-vi-1"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "2d2174f8-711d-408e-8d20-42b2c03249ee",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "845bf611-c45d-4474-bf75-fbdef3bbbc69",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "8dbebb5b-fff8-4ad5-8e80-319209b23a3d",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "SDDC-Dswitch-Private1",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 3,
            "vdsNameForVxlanConfig" : "SDDC-Dswitch-Private1"
          }
        }
      }
    } ]
  },
  "nsxVSpec" : {
    "nsxManagerSpec" : {
      "name" : "nsx-manager-2",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "nsx-manager-2.sfo01.rainpole.local",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    },
    "nsxVControllerSpec" : {
      "nsxControllerIps" : [ "10.0.0.45", "10.0.0.46", "10.0.0.47" ],
      "nsxControllerPassword" : "Test123456$%",
      "nsxControllerGateway" : "10.0.0.250",
      "nsxControllerSubnetMask" : "255.255.255.0"
    },
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "Random0$",
    "nsxManagerEnablePassword" : "Random0$"
  }
}'

HTTP Request

POST /v1/domains HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 2633
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "domainName" : "Domain1",
  "vcenterSpec" : {
    "name" : "vCenter1",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "vcenter-2.sfo01.rainpole.local",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "Random0$",
    "datacenterName" : "new-vi-1"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "2d2174f8-711d-408e-8d20-42b2c03249ee",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "845bf611-c45d-4474-bf75-fbdef3bbbc69",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      }, {
        "id" : "8dbebb5b-fff8-4ad5-8e80-319209b23a3d",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmNicId1",
            "vdsName" : "SDDC-Dswitch-Private1"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "SDDC-Dswitch-Private1",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 3,
            "vdsNameForVxlanConfig" : "SDDC-Dswitch-Private1"
          }
        }
      }
    } ]
  },
  "nsxVSpec" : {
    "nsxManagerSpec" : {
      "name" : "nsx-manager-2",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "nsx-manager-2.sfo01.rainpole.local",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    },
    "nsxVControllerSpec" : {
      "nsxControllerIps" : [ "10.0.0.45", "10.0.0.46", "10.0.0.47" ],
      "nsxControllerPassword" : "Test123456$%",
      "nsxControllerGateway" : "10.0.0.250",
      "nsxControllerSubnetMask" : "255.255.255.0"
    },
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "Random0$",
    "nsxManagerEnablePassword" : "Random0$"
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/b952f938-011b-414f-8d45-8fb3175fd2d6
Content-Length: 142

{
  "id" : "b952f938-011b-414f-8d45-8fb3175fd2d6",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:56.528Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" with the ID from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.2.2. Get the Domains

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains' -i -u 'admin:VMwareInfra@1'

HTTP Request

GET /v1/domains HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 564

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5",
    "name" : "VI-1",
    "vcenters" : [ {
      "fqdn" : "vi-1-vcenter.vrack.vsphere.local"
    } ],
    "clusters" : [ {
      "id" : "8045e44e-974e-4f43-9862-7f0326782655"
    } ]
  }, {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "name" : "VDI-1",
    "vcenters" : [ {
      "fqdn" : "vdi-1-vcenter.vrack.vsphere.local"
    } ],
    "clusters" : [ {
      "id" : "8045e44e-974e-4f43-9862-7f0326782677"
    }, {
      "id" : "8045e44e-974e-4f43-9861-7f0326782633"
    } ]
  } ]
}

2.2.3. Get a Domain

Prerequisites
  1. The following data is required

    • ID of the domain

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains/c0703437-6746-470b-9e1c-f9d3bbc9b1c5' -i -u 'admin:VMwareInfra@1'

HTTP Request

GET /v1/domains/c0703437-6746-470b-9e1c-f9d3bbc9b1c5 HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 220

{
  "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5",
  "name" : "VI-1",
  "vcenters" : [ {
    "fqdn" : "vi-1-vcenter.vrack.vsphere.local"
  } ],
  "clusters" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655"
  } ]
}

2.2.4. Delete a Domain

When you delete a domain, the clusters within the domain are deleted and the hosts are returned to the free pool.

Warning
Deleting a domain is an irreversible operation. All clusters and VMs within the domain are deleted and the underlying datastores are destroyed.
Warning
Deleting a domain puts the host "status" to UNASSIGNED_UNUSEABLE. Cleanup the hosts to change the "status" to UNASSIGNED_USEABLE.
Note
The network pools used by the domain are not deleted as part of task and must be deleted separately.
Prerequisites
  1. The following data is required

    • ID of the domain that has to be deleted.

Tip
Back up the data on the domain.
Tip
Migrate the VMs that you want to retain, to another domain.
Steps
  1. Initialize the deletion.

Warning
It is not possible to delete a domain without having marked it for deletion. This 2-step deletion ensures that a domain is not deleted accidentally.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{
  "markForDeletion" : true
}'

HTTP Request

PATCH /v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 30
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "markForDeletion" : true
}

HTTP Response

HTTP/1.1 200 OK
  1. Trigger the deletion.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f' -i -u 'admin:VMwareInfra@1' -X DELETE

HTTP Request

DELETE /v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/3d26d677-ad61-42df-9906-5d2286115da2
Content-Length: 142

{
  "id" : "3d26d677-ad61-42df-9906-5d2286115da2",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:55.501Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.3. Clusters

2.3.1. Create a Cluster

After you add the primary cluster, you can add more clusters to expand the domain.

Prerequisites
  1. The following data is required

    • ID of the domain in which the cluster is to be created

    • Cluster details

      • Name of the cluster

      • Hosts details

        • ID of the host (UUID)

        • License key for the host

        • List of VDS names to associate with host

        • ID of the vmNic host to be associated with VDS, once added to cluster

      • Datastore details

        Note
        Only one of "vsanDatastoreSpec" (For VSAN) or NFS "nfsDatastoreSpecs" (For NFS) must be specified.
        • For VSAN

          • Number of host failures to tolerate (can be 0, 1, or 2)

          • License key for the vSAN datastore

            Unresolved directive in usecases/create_cluster.adoc - include::../vimanager/create-domain-v1-subsections/request-body-vSANDatastoreSpec.adoc[]

        • For NFS

          • List of NFS server names

          • Shared directory path

          • User tag used to annotate NFS share

          • Boolean to identify if the mount directory should be read-only

          {"nfsDatastoreSpecs":[{"nasVolume":{"serverName":["10.0.0.250"],"path":"/nfs_mount/my_read_write_folder","readOnly":false},"datastoreName":"NFSShare"}]}
        • Network Details

          • List of VDS details

            • For each VDS

              • Port group names and the corresponding transport type

              • DVS host Infrastructure traffic resource type

              • Maximum allowed usage for a traffic class

              • Amount of bandwidth to be reserved for the host infrastructure traffic class

          • NSX cluster Details

            Note
            Only one of "nsxVClusterSpec" (For NSX-V) or "nsxTClusterSpec" (For NSX-T) must be specified.
            • For NSX-V

              • VLAN ID of the VXLAN

              • License key for NSX

              • VDS to be used for VXLAN traffic/port group. This should belong to one of the VDS being created for the cluster

        {"nsxVClusterSpec":{"vlanId":3,"vdsNameForVxlanConfig":"SDDC-Dswitch-Private1"}}
        • For NSX-T

          • VLAN ID of Geneve

    {"nsxTClusterSpec":{"geneveVlanId":2}}
  2. Network pool must be configured.

  3. Logical VMware Cloud Foundation container (Workload Domain) must be provisioned.

Note
NSX manager and controller is configured when domain is created.
  1. Prerequisites for vSAN/ NFS must be met.

  2. License key details may be provisioned in vCenter.

  3. Host configuration must have minimum two active vmNics.

  4. There must be at least three hosts available in the VMware Cloud Foundation inventory.

  5. Ensure that the hosts you want to add to the cluster are in UNASSIGNED_USEABLE state.

  6. You must have valid host and vSAN (if using vSAN storage) license key specified with adequate sockets available for the host to be added.

  7. A DHCP server must be configured on the VXLAN VLAN of the management domain. When NSX creates VXLAN VTEPs for the domain, they are assigned IP addresses from the DHCP server.

Steps
  1. Validate the input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/validations/creations' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "domainId" : "30f56200-ee23-49b4-b885-212d8be3f054",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "553c9fb0-94bb-40a0-8f10-67676f179375"
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "vRack-DSwitch",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 0,
            "vdsNameForVxlanConfig" : "vds_name"
          }
        }
      }
    } ]
  }
}'

HTTP Request

POST /v1/clusters/validations/creations HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 1045
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "domainId" : "30f56200-ee23-49b4-b885-212d8be3f054",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "553c9fb0-94bb-40a0-8f10-67676f179375"
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "vRack-DSwitch",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 0,
            "vdsNameForVxlanConfig" : "vds_name"
          }
        }
      }
    } ]
  }
}

HTTP Response

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

{
  "id" : "7787edaf-63d5-4a48-b4e6-f0306924d8a7",
  "description" : "Validating Cluster Creation Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterCreationSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  1. In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  2. In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

    Note
    Make changes to the input specification and re-validate using a new API invocation.
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "domainId" : "245cc547-1306-43ea-b13a-99b1a384594e",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "7c121a48-32f9-4bf2-9991-b7a35c112b38"
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "vRack-DSwitch",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 0,
            "vdsNameForVxlanConfig" : "vds_name"
          }
        }
      }
    } ]
  }
}'

HTTP Request

POST /v1/clusters HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 1045
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "domainId" : "245cc547-1306-43ea-b13a-99b1a384594e",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "Cluster1",
      "hostSpecs" : [ {
        "id" : "7c121a48-32f9-4bf2-9991-b7a35c112b38"
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "vSanDatastore"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "vRack-DSwitch",
          "portGroupSpecs" : [ {
            "name" : "SDDC-DPortGroup-Mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "SDDC-DPortGroup-VSAN",
            "transportType" : "VSAN"
          }, {
            "name" : "SDDC-DPortGroup-vMotion",
            "transportType" : "VMOTION"
          } ]
        } ],
        "nsxClusterSpec" : {
          "nsxVClusterSpec" : {
            "vlanId" : 0,
            "vdsNameForVxlanConfig" : "vds_name"
          }
        }
      }
    } ]
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/4961f3d4-6042-4d2b-b25c-7da84f4b1ea5
Content-Length: 142

{
  "id" : "4961f3d4-6042-4d2b-b25c-7da84f4b1ea5",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:05.428Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.3.2. Get the Clusters

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters' -i -u 'admin:VMwareInfra@1'

HTTP Request

GET /v1/clusters HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 703

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "name" : "VI-1-CLUSTER",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ]
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782677",
    "name" : "VI-2-CLUSTER-1",
    "hosts" : [ {
      "id" : "c0703437-6746-470z-9e1c-f9d3bbc9b1c6"
    }, {
      "id" : "c0703431-6742-470t-9e1d-f9d3bbc9b1c1"
    } ]
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782633",
    "name" : "VI-2-CLUSTER-2",
    "hosts" : [ {
      "id" : "c0703437-6746-470e-9e1c-f9d3bbc9b1c3"
    }, {
      "id" : "c0703431-6742-470r-9e1d-f9d3bbc9b1c4"
    } ]
  } ]
}

2.3.3. Get a Cluster

Prerequisites
  1. The following data is required

    • ID of the cluster

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/8045e44e-974e-4f43-9862-7f0326782655' -i -u 'admin:VMwareInfra@1'

HTTP Request

GET /v1/clusters/8045e44e-974e-4f43-9862-7f0326782655 HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 208

{
  "id" : "8045e44e-974e-4f43-9862-7f0326782655",
  "name" : "VI-1-CLUSTER",
  "hosts" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
  }, {
    "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
  } ]
}

2.3.4. Expand a Cluster

Adding an individual host to a cluster adds the resources of that host to the cluster. You can add multiple hosts at a time to a cluster.

Prerequisites
  1. The following data is required

    • ID of the cluster

    • For each host

      • ID of the host (UUID)

      • List of VDS names to associate with host

      • ID of the vmNic, host is associated to

    • License key of ESXi

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

  3. There must be a host available in the VMware Cloud Foundation inventory.

  4. The hosts to be added must have been commissioned.

  5. Ensure that the host you want to add is in an active state.

  6. You must have a valid ESXi license specified with adequate sockets available for the host to be added.

  7. Ensure that the host to be added to the cluster matches the configuration of the hosts already in the cluster. This ensures a balanced configuration of the cluster.

Steps
  1. Validate the input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations/updates' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "f087184a-fa5d-4645-a416-6746c0f76f8f"
    } ]
  }
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations/updates HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 118
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "f087184a-fa5d-4645-a416-6746c0f76f8f"
    } ]
  }
}

HTTP Response

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

{
  "id" : "54c91422-78f7-4d15-8315-1853dc42b3c2",
  "description" : "Validating Cluster Expansion Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterExpansionSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  1. In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  2. In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

    Note
    Make changes to the input specification and re-validate using a new API invocation.
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "f366a645-6f54-4f83-9366-0cd6f0835e4e"
    } ]
  }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 118
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "f366a645-6f54-4f83-9366-0cd6f0835e4e"
    } ]
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/5085c64a-ebca-4c10-a6d3-3fdd8da24e0a
Content-Length: 142

{
  "id" : "5085c64a-ebca-4c10-a6d3-3fdd8da24e0a",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:04.488Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.3.5. Compact a Cluster

When a host is removed from a cluster in a domain, the vSAN members are reduced. Ensure that you have enough hosts remaining to facilitate the configured vSAN availability. Failure to do so might result in the datastore being marked as read-only or in data loss.

Prerequisites
  1. The following data is required

    • For each host to be removed

      • ID of the host

Steps
  1. Validate the input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations/updates' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "b0554799-a9f9-46db-9c24-52cc698bebc3"
    } ]
  }
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations/updates HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 115
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "b0554799-a9f9-46db-9c24-52cc698bebc3"
    } ]
  }
}

HTTP Response

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

{
  "id" : "70cd0cf5-014e-4857-b6f5-566b139ce459",
  "description" : "Validating Cluster Compaction Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterCompactionSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  1. In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  2. In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

    Note
    Make changes to the input specification and re-validate using a new API invocation.
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "431f64ec-28aa-4860-acaa-5d932babca43"
    } ]
  }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 115
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "431f64ec-28aa-4860-acaa-5d932babca43"
    } ]
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/f3827ac0-7a28-4acb-a3c9-54af77c5a548
Content-Length: 142

{
  "id" : "f3827ac0-7a28-4acb-a3c9-54af77c5a548",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:07.175Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.3.6. Delete a Cluster

Warning
Datastores on the ESXi hosts in the cluster that will be deleted are destroyed.
Note
You cannot delete the last cluster in a domain. Instead, the domain can be deleted.
Prerequisites
  1. The following data is required

    • ID of the cluster to be deleted

  2. Ensure that a cluster with the given ID exists.

  3. The cluster has been marked for deletion.

  4. Migrate or backup the VMs and data on the data store associated with the cluster to another location.

Steps
  1. Initialize the deletion.

Warning
It is not possible to delete a cluster without having marked it for deletion. This 2-step deletion ensures that a cluster is not deleted accidentally.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{
  "markForDeletion" : true
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 30
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "markForDeletion" : true
}

HTTP Response

HTTP/1.1 200 OK
  1. Trigger the deletion.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -u 'admin:VMwareInfra@1' -X DELETE

HTTP Request

DELETE /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/0e950175-c305-48e3-8aaa-f4795760aae9
Content-Length: 142

{
  "id" : "0e950175-c305-48e3-8aaa-f4795760aae9",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2019-07-18T17:09:04.832Z"
}
  1. Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip
Refer to: Retry a Task.

2.4. Credentials

2.4.1. Get the Credentials

This API is used to fetch all credentials known to the system.

Prerequisites
  1. The following data is required

    • Resource type, name, IP address or the domain name associated with the resource is required to filter the results. For allowable resource type values

Tip
Refer to: Get the Credentials

Get All Credentials

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 5846

{
  "elements" : [ {
    "id" : "b83adeb2-d462-49a4-b967-6413aa2dc489",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "6ad4af5e-b92e-4df2-a758-3a3e7c690f12",
      "resourceName" : "sfo01m01esx01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.100",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
      "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.101",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "2d5525c6-c835-48ed-ba8e-d28ae829e1c3",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "de01730d-d683-4b37-8a2d-69742da64c11",
      "resourceName" : "sfo01m01esx03.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.102",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "249d2c76-9c6d-4bf4-af04-ab5d56ae2e5f",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "7073de95-4b4d-4574-8e5f-d52a6f322cd7",
      "resourceName" : "sfo01m01esx04.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.103",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "c77b1923-c787-4123-9472-6df276494690",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "2e251514-054f-47d7-8c9e-13558f83a140",
      "resourceName" : "sfo01m01vcenter01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.6",
      "resourceType" : "VCENTER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "d4cd32b8-54ca-4ee5-9711-27eea7af4612",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "23cac6cf-65fe-495c-8945-83cd2667f255",
      "resourceName" : "sfo01m01psc01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.5",
      "resourceType" : "PSC",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "ed657746-847a-4c0b-b034-a2979ae496da",
    "credentialType" : "SSO",
    "username" : "[email protected]",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "f070d21a-dc5d-49a9-ae8b-9a90c93b5586",
      "resourceName" : "sfo01m01psc01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.5",
      "resourceType" : "PSC",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "138c71d7-a8dd-45f6-b270-22f0836901c4",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "0518f3d8-8a2b-4c21-9cf5-3c6971c9889c",
      "resourceName" : "sfo01m01nsx01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.9",
      "resourceType" : "NSX_MANAGER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "b3816839-67b3-4717-b90f-9fc9e7210a08",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "d7859b72-e205-4005-9762-6fe8f14ac98c",
      "resourceName" : "sfo01m01nsxc01",
      "resourceIp" : "10.0.0.42",
      "resourceType" : "NSX_CONTROLLER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "f335b417-c559-4cc5-ae87-aa3ba5205fe6",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "44cc3a38-f517-4050-bfee-96d328636273",
      "resourceName" : "sfo01vrli01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.15",
      "resourceType" : "VRLI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "ff233d79-1fd5-4951-ba5d-317cea9353d5",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "e5f66fc3-4679-4402-ba39-cebfb22a00ca",
      "resourceName" : "sfo01vrli01b.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.16",
      "resourceType" : "VRLI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "976bd06c-6a62-4e15-84b2-aa91c57ed940",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "216e0f19-746d-4d0f-b054-5fec389dcd55",
      "resourceName" : "vrops01svr01a.rainpole.local",
      "resourceIp" : "10.0.1.33",
      "resourceType" : "VROPS",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "1a660817-fa11-403b-9d1d-3ccffb342fd1",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "2b31f022-f8fd-4692-8bca-173256ea3e15",
      "resourceName" : "vrops01svr01.rainpole.local",
      "resourceIp" : "10.0.0.31",
      "resourceType" : "VROPS",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "c15d7667-ab3b-4b88-b7f0-a058c4c59c16",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "2965b4fe-742a-4a3f-9647-1236c00d9294",
      "resourceName" : "vrslcm01svr01a.rainpole.local",
      "resourceIp" : "10.0.0.32",
      "resourceType" : "VRSLCM",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "c83f7d85-c174-46ba-ba2c-a96cded3b262",
    "credentialType" : "API",
    "username" : "admin@localhost",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "acfd0b22-361b-4b47-b577-3d1a614a15ac",
      "resourceName" : "vrslcm01svr01a.rainpole.local",
      "resourceIp" : "10.0.0.32",
      "resourceType" : "VRSLCM",
      "domainName" : "MGMT"
    }
  } ]
}

Get Credentials by "resourceName"

This API can be used to fetch the credentials associated with a resource with a specific name.

Steps
  1. Invoke the API by specifying the "resourceName".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials?resourceName=sfo01m01esx02.sfo01.rainpole.local' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials?resourceName=sfo01m01esx02.sfo01.rainpole.local HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 409

{
  "elements" : [ {
    "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
      "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.101",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  } ]
}

Get Credentials by "resourceIP"

This API can be used to fetch the credentials associated with a resource with a specific IP address.

Steps
  1. Invoke the API by specifying the "resourceIP".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials?resourceIP=10.0.0.101' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials?resourceIP=10.0.0.101 HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 409

{
  "elements" : [ {
    "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
      "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.101",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  } ]
}

Get Credentials by "resourceType"

This API can be used to fetch the credentials associated with all the resources with a specific resource type.

Steps
  1. Invoke the API by specifying the "resourceType".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials?resourceType=ESXI' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials?resourceType=ESXI HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1573

{
  "elements" : [ {
    "id" : "f5e97379-2b83-4d22-aa3d-78f6ecfba1a1",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "860db8f0-5356-4a72-9c28-dd0c1e51ebcc",
      "resourceName" : "sfo01m01esx01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.100",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
      "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.101",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "9e0548b9-1ae3-4d6e-b1fd-701e741a8044",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "549acd5f-b885-47f5-b82f-6495af87d054",
      "resourceName" : "sfo01m01esx03.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.102",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "37b01498-4974-4474-ac67-9efc730bea4d",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "2b041daa-626d-4e76-a3cf-2e2678dc95d9",
      "resourceName" : "sfo01m01esx04.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.103",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  } ]
}

Get Credentials by "domainName"

This API can be used to fetch the credentials associated with all the resources belonging to a specific domain.

Steps
  1. Invoke the API by specifying the "domainName".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials?domainName=MGMT' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials?domainName=MGMT HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 5846

{
  "elements" : [ {
    "id" : "9cbe241d-9919-4e91-a56b-7eb32023b28a",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "33ec74a1-f98d-4530-8986-6778085a3ce4",
      "resourceName" : "sfo01m01esx01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.100",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
      "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.101",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "fdd89b08-0d3d-4931-9507-fae3d0ed1cde",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "c9d897d7-f226-407d-b095-7f95409912dd",
      "resourceName" : "sfo01m01esx03.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.102",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "bb186cae-a4a1-4630-a029-74fada360708",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "d2635b05-fa9b-4167-8fd6-cda7b37a3a96",
      "resourceName" : "sfo01m01esx04.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.103",
      "resourceType" : "ESXI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "4740c32d-6376-4e9d-bce2-590c1cd7cd55",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "deee12d1-7256-4934-8d95-b9cc8b57e698",
      "resourceName" : "sfo01m01vcenter01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.6",
      "resourceType" : "VCENTER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "60aab344-bc7e-415a-a5fa-565f77b824d9",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "0c01ab0e-80da-4779-9891-e13639c6c7a8",
      "resourceName" : "sfo01m01psc01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.5",
      "resourceType" : "PSC",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "0ec4ddc1-70d9-4dab-a2d0-3e6df30511e3",
    "credentialType" : "SSO",
    "username" : "[email protected]",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "2a335874-d4c6-4b9e-b1d2-e5523c07d5fb",
      "resourceName" : "sfo01m01psc01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.5",
      "resourceType" : "PSC",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "3cf47bd5-44c1-4c9f-8138-a37b3f636a54",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "5ec8dc35-62f3-4354-a286-4e38c22e42e5",
      "resourceName" : "sfo01m01nsx01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.9",
      "resourceType" : "NSX_MANAGER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "6627b113-7e9d-4d7e-b29f-631b0efe779b",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "5e0dade3-b117-42cc-994a-3b9f3e400a12",
      "resourceName" : "sfo01m01nsxc01",
      "resourceIp" : "10.0.0.42",
      "resourceType" : "NSX_CONTROLLER",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "0855ecf8-604b-4d8c-bfcf-fe2063b6b750",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "96bf00e9-027b-42c0-b7e2-3586d57b7ec9",
      "resourceName" : "sfo01vrli01.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.15",
      "resourceType" : "VRLI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "4914dbde-fa93-41f9-b794-b00732378285",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "430159bc-8c89-4818-ac24-85614e115be8",
      "resourceName" : "sfo01vrli01b.sfo01.rainpole.local",
      "resourceIp" : "10.0.0.16",
      "resourceType" : "VRLI",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "4ea07cb4-8086-42a5-8b25-f90df09771d7",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "093349c9-a859-4d26-8b73-5d6e88f1cf16",
      "resourceName" : "vrops01svr01a.rainpole.local",
      "resourceIp" : "10.0.1.33",
      "resourceType" : "VROPS",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "77dfa478-2dbc-4cbc-abeb-91f6e0cdb5c9",
    "credentialType" : "API",
    "username" : "admin",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "8bfbf4b5-9273-4ec8-908d-041a56be2be4",
      "resourceName" : "vrops01svr01.rainpole.local",
      "resourceIp" : "10.0.0.31",
      "resourceType" : "VROPS",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "d784d31b-e8cb-46da-b6e9-fb1d9a63ddce",
    "credentialType" : "SSH",
    "username" : "root",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "157e7dda-75c1-4db0-8044-cd51845eba62",
      "resourceName" : "vrslcm01svr01a.rainpole.local",
      "resourceIp" : "10.0.0.32",
      "resourceType" : "VRSLCM",
      "domainName" : "MGMT"
    }
  }, {
    "id" : "088b9496-53cf-4497-8882-69c4c7b218ec",
    "credentialType" : "API",
    "username" : "admin@localhost",
    "password" : "VMwareInfra@1",
    "resource" : {
      "resourceId" : "3602606a-af29-498b-8962-967255b3934a",
      "resourceName" : "vrslcm01svr01a.rainpole.local",
      "resourceIp" : "10.0.0.32",
      "resourceType" : "VRSLCM",
      "domainName" : "MGMT"
    }
  } ]
}

2.4.2. Get a Credential

This API is used to fetch credential for an ID.

Prerequisites
  1. The following data is required

    • ID of the credential

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/5514c6b9-4d15-40da-827b-4a548b9786d6' -i -u 'admin:VMwareInfra@1'

HTTP Request

GET /v1/credentials/5514c6b9-4d15-40da-827b-4a548b9786d6 HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 362

{
  "id" : "5514c6b9-4d15-40da-827b-4a548b9786d6",
  "credentialType" : "SSH",
  "username" : "root",
  "password" : "VMwareInfra@1",
  "resource" : {
    "resourceId" : "95a04703-cc9f-4063-9fd3-7e70c18ef979",
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceIp" : "10.0.0.101",
    "resourceType" : "ESXI",
    "domainName" : "MGMT"
  }
}

2.4.3. Update the Passwords

This API is used to update passwords for list of resources by supplying new passwords.

Prerequisites
  1. The following data is required

    • Name or ID of the resource

    • Type of the resource

    • Credential type of the resource

    • Username of the resource

Tip
Refer to: Get the Credentials to get the credential type, username, name, ID and type of the resource.
  1. New password must be in compliance with the password policies.

Tip
Refer to the respective VMware product specific documentation for the password policies.
Steps
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
  "operationType" : "UPDATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root",
      "password" : "VMwareInfra@1"
    } ]
  } ]
}'

HTTP Request

PATCH /v1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 272
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "operationType" : "UPDATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root",
      "password" : "VMwareInfra@1"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/bcb42425-19ef-485b-ba61-29d7ae4cb1c5
Content-Type: application/json;charset=UTF-8
Content-Length: 100

{
  "id" : "bcb42425-19ef-485b-ba61-29d7ae4cb1c5",
  "name" : "UPDATE",
  "status" : "IN_PROGRESS"
}
  1. Poll the status of the task using the task API with the ID from the response of the previous API.

  1. Poll the task until "status" is not "IN_PROGRESS" with the ID from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Warning
The password once updated cannot be rolled back.
Note
The password is updated in the order of the input.
Note
The passwords of the dependent resources of the requested resources will also get updated.

2.4.4. Rotate the Passwords

This API is used to rotate passwords for list of resources using system generated passwords.

Prerequisites
  1. The following data is required

    • Name or ID of the resource

    • Type of the resource

    • Credential type of the resource

    • Username of the resource

Tip
Refer to: Get the Credentials to get the credential type, username, name, ID and type of the resource.
Steps
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
  "operationType" : "ROTATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root"
    } ]
  } ]
}'

HTTP Request

PATCH /v1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 236
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "operationType" : "ROTATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/ea623126-5101-4264-8994-82060c6e99ae
Content-Type: application/json;charset=UTF-8
Content-Length: 100

{
  "id" : "ea623126-5101-4264-8994-82060c6e99ae",
  "name" : "ROTATE",
  "status" : "IN_PROGRESS"
}
  1. Poll the status of the task using the task API with the ID from the response of the previous API.

  1. Poll the task until "status" is not "IN_PROGRESS" with the ID from the previous response.

Tip
Refer to: Get a Task.
  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Warning
The password once rotated cannot be rolled back.
Note
The password is rotated in the order of the input.
Note
The passwords of the dependent resources of the requested resources will also get rotated.

2.4.5. Retry the Update Passwords Task

This API is used to retry a failed update passwords task.

Prerequisites
  1. The following data is required

    • ID of the last triggered failed update passwords task

    • Name or ID of the resource

    • Type of the resource

    • Credential type of the resource

    • Username of the resource

Tip
Refer to: Get the Credentials to get the credential type, username, name, ID and type of the resource and ID of the failed task.
  1. New password must be in compliance with the password policies.

Tip
Refer to: Documentation of the product for product specific password policies.
Steps
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks/4d10ce46-8955-4c41-9e5c-5de93e4cf394' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
  "operationType" : "UPDATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root",
      "password" : "VMwareInfra@1"
    } ]
  } ]
}'

HTTP Request

PATCH /v1/credentials/tasks/4d10ce46-8955-4c41-9e5c-5de93e4cf394 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 272
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "operationType" : "UPDATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root",
      "password" : "VMwareInfra@1"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/4d10ce46-8955-4c41-9e5c-5de93e4cf394
Content-Type: application/json;charset=UTF-8
Content-Length: 100

{
  "id" : "4d10ce46-8955-4c41-9e5c-5de93e4cf394",
  "name" : "UPDATE",
  "status" : "IN_PROGRESS"
}
  1. Poll the task until "status" is not "IN_PROGRESS" with the ID from the previous response.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed by providing previous credentials rotate specification or by amending the credentials rotate specification for FAILED resources.

  • The failed task can be cancelled.

Warning
The password once updated cannot be rolled back.
Note
The password is updated in the order of the input.
Note
Retry should be performed if updating passwords task has failed.
Note
Retry should be performed on the same list of resources as in the failed operation specification.
Tip
Refer to: Get the Resource Credentials for Credentials Task for the list of resources in the failed task.
Note
The passwords of the dependent resources of the requested resources will also get updated.

2.4.6. Retry the Rotate Passwords Task

This API is used to retry a failed rotate passwords task.

Prerequisites
  1. The following data is required

    • ID of the last triggered failed rotate passwords task

    • Name or ID of the resource

    • Type of the resource

    • Credential type of the resource

    • Username of the resource

Tip
Refer to: Get the Credentials to get the credential type, username, name, ID and type of the resource and ID of the failed task.
Steps
  1. Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks/1e057033-69c9-4ed6-8df6-42b771658325' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
  "operationType" : "ROTATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root"
    } ]
  } ]
}'

HTTP Request

PATCH /v1/credentials/tasks/1e057033-69c9-4ed6-8df6-42b771658325 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 236
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "operationType" : "ROTATE",
  "elements" : [ {
    "resourceName" : "sfo01m01esx02.sfo01.rainpole.local",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/1e057033-69c9-4ed6-8df6-42b771658325
Content-Type: application/json;charset=UTF-8
Content-Length: 100

{
  "id" : "1e057033-69c9-4ed6-8df6-42b771658325",
  "name" : "ROTATE",
  "status" : "IN_PROGRESS"
}
  1. Poll the task until "status" is not "IN_PROGRESS" with the ID from the previous response.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed by providing previous credentials rotate specification or by amending the credentials rotate specification for FAILED resources.

  • The failed task can be cancelled.

Warning
The password once rotated cannot be rolled back.
Note
The password is rotated in the order of the input.
Note
Retry should be performed if some password rotation task has failed.
Note
Retry should be performed on the same list of resources as in the failed operation specification.
Tip
Refer to: Get the Resource Credentials for Credentials Task for the list of resources in the failed task.
Note
The passwords of the dependent resources of the requested resources will also get rotated.

2.4.7. Cancel the Update/Rotate Passwords Task

  • This API is used to cancel a failed update or rotate passwords task.

Prerequisites
  1. The following data is required

    • ID of the last triggered failed update/rotate passwords task

Tip
Refer to: Get the Credentials Tasks section to get the ID of the failed task.
Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks/5ebb8069-93ff-47d2-808b-cd456cb8fb74' -i -u 'admin:VMwareInfra@1' -X DELETE

HTTP Request

DELETE /v1/credentials/tasks/5ebb8069-93ff-47d2-808b-cd456cb8fb74 HTTP/1.1
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 204 No Content
Content-Type: application/json;charset=UTF-8
Content-Length: 103

{
  "id" : "5ebb8069-93ff-47d2-808b-cd456cb8fb74",
  "name" : "USER CANCELLED",
  "status" : "FAILED"
}
Warning
The password once updated or rotated cannot be rolled back.
Note
The password is updated or rotated in the order of the input.
Note
Cancel should be performed to release the internal global lock held at VCF instance level if some password updation or rotation task has failed after several retries.

2.4.8. Get the Credentials Tasks

This API is used to fetch all credentials tasks in reverse chronological order.

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials/tasks HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 650

{
  "elements" : [ {
    "id" : "186d891f-aac3-4501-ae52-afb89eb7e32f",
    "name" : "Credentials rotate operation",
    "creationTimestamp" : "2018-11-05T05:15:32.864Z",
    "status" : "SUCCESSFUL",
    "subTasks" : [ {
      "name" : "vracafe3.rainpole.local:SSH",
      "creationTimestamp" : "2018-11-05T05:15:32.864Z",
      "status" : "SUCCESSFUL"
    }, {
      "name" : "vracafe2.rainpole.local:SSH",
      "creationTimestamp" : "2018-11-05T05:15:32.864Z",
      "status" : "SUCCESSFUL"
    }, {
      "name" : "vracafe1.rainpole.local:SSH",
      "creationTimestamp" : "2018-11-05T05:15:32.864Z",
      "status" : "SUCCESSFUL"
    } ]
  } ]
}

2.4.9. Get a Credentials Task

This API is used to fetch a credentials task for an ID.

Prerequisites
  1. The following data is required

    • ID of the credentials task

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks/186d891f-aac3-4501-ae52-afb89eb7e32f' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials/tasks/186d891f-aac3-4501-ae52-afb89eb7e32f HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 591

{
  "id" : "186d891f-aac3-4501-ae52-afb89eb7e32f",
  "name" : "Credentials rotate operation",
  "creationTimestamp" : "2018-11-05T05:15:32.864Z",
  "status" : "SUCCESSFUL",
  "subTasks" : [ {
    "name" : "vracafe3.rainpole.local:SSH",
    "creationTimestamp" : "2018-11-05T05:15:32.864Z",
    "status" : "SUCCESSFUL"
  }, {
    "name" : "vracafe2.rainpole.local:SSH",
    "creationTimestamp" : "2018-11-05T05:15:32.864Z",
    "status" : "SUCCESSFUL"
  }, {
    "name" : "vracafe1.rainpole.local:SSH",
    "creationTimestamp" : "2018-11-05T05:15:32.864Z",
    "status" : "SUCCESSFUL"
  } ]
}

2.4.10. Get the Resource Credentials for Credentials Task

This API is used to fetch resource credentials for a credentials task ID.

Prerequisites
  1. The following data is required

    • ID of the credentials task

Tip
Refer to: Get the Credentials Tasks to get the ID of credentials tasks.
Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/credentials/tasks/186d891f-aac3-4501-ae52-afb89eb7e32f/resource-credentials' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/credentials/tasks/186d891f-aac3-4501-ae52-afb89eb7e32f/resource-credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 479

[ {
  "resourceName" : "vracafe3.rainpole.local",
  "resourceType" : "VRA",
  "credentials" : [ {
    "credentialType" : "SSH",
    "username" : "root"
  } ]
}, {
  "resourceName" : "vracafe2.rainpole.local",
  "resourceType" : "VRA",
  "credentials" : [ {
    "credentialType" : "SSH",
    "username" : "root"
  } ]
}, {
  "resourceName" : "vracafe1.rainpole.local",
  "resourceType" : "VRA",
  "credentials" : [ {
    "credentialType" : "SSH",
    "username" : "root"
  } ]
} ]

2.5. License Keys

2.5.1. Add a License Key

  • This API is used to add a license key.

  • Adding a license key which is already added , will give an error.

Tip
Refer to: Get a License Key to check if a license key is already present.
  • Adding an incorrect (key size and format) or an invalid license key (invalid or expired), will give an error.

Prerequisites
  1. The following data is required

    • License key

    • Product type

    • License key description

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
  "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
  "productType" : "NSXV",
  "description" : "vCenter license key"
}'

HTTP Request

POST /v1/license-keys HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 112
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
  "productType" : "NSXV",
  "description" : "vCenter license key"
}

HTTP Response

HTTP/1.1 201 Created
Location: /v1/license-keys/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

2.5.2. Get the License Keys

  • This API is used to get all the license keys.

  • This also gives the license key metrics like usage and validity of a license key.

  • License keys can be filtered based on product type and/or license key status.

Prerequisites

None

Get All License Keys

Steps
  1. Invoke the API.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/license-keys HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 912

{
  "elements" : [ {
    "id" : "b11b6599-11c5-4593-aeda-0ee6963fe577",
    "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  }, {
    "id" : "782712e2-7de8-4568-8183-71b6563e3438",
    "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "productType" : "NSXV",
    "description" : "NSX-V license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 15,
      "remaining" : 14,
      "used" : 1,
      "licenseUnit" : "VM"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

Get License Keys By Product Type

Steps
  1. Invoke the API by specifying the _"productType".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys?productType=VCENTER,ESXI' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/license-keys?productType=VCENTER,ESXI HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 471

{
  "elements" : [ {
    "id" : "3736b46e-d762-4f0c-82a3-9e2fdb0d4a02",
    "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

Get License Keys By Status Of The License Key

Steps
  1. Invoke the API by specifying the _"licenseKeyStatus".

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys?licenseKeyStatus=ACTIVE,NEVER_EXPIRES' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/license-keys?licenseKeyStatus=ACTIVE,NEVER_EXPIRES HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 471

{
  "elements" : [ {
    "id" : "b5438d80-692c-45a8-9bc8-d30a95eb5244",
    "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

2.5.3. Get a License Key

  • This API is used to get the license key metrics like usage and validity of a license key.

  • If the license key does not exist, you will get an error.

Prerequisites
  1. The following data is required

    • License key

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX' -i -u 'admin:VMwareInfra@1' \
    -H 'Accept: application/json'

HTTP Request

GET /v1/license-keys/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 416

{
  "id" : "b68fa03d-d6db-4030-ae55-3eec17c3f970",
  "key" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
  "productType" : "VCENTER",
  "description" : "vCenter license key",
  "isUnlimited" : false,
  "licenseKeyUsage" : {
    "total" : 5,
    "remaining" : 4,
    "used" : 1,
    "licenseUnit" : "INSTANCE"
  },
  "licenseKeyValidity" : {
    "licenseKeyStatus" : "ACTIVE",
    "expiryDate" : "2029-05-23T16:12:53.001Z"
  }
}

2.5.4. Delete a License Key

  • This API is used to delete a license key.

Warning
Deleting a license key which is in use, will give an error.
Prerequisites
  1. The following data is required

    • License key

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/license-keys/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX' -i -u 'admin:VMwareInfra@1' -X DELETE \
    -H 'Accept: application/json'

HTTP Request

DELETE /v1/license-keys/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX HTTP/1.1
Accept: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 204 No Content

2.6. Network Pools

2.6.1. Create a Network Pool

  • Used to create a Network pool in the system. The added network pool would be used during domain deployments, host commission/expansion flows.

  • If a network pool which is already added before is added, you will get an error with HTTP status 400.

  • If a malformed network pool is added (payload for network parameters, name which is already exist), you will get an error.

Prerequisites
  1. The following data is required

    • Name

    • List of networks associated with network pool in which each network has

      • Network type - It can be VSAN, VMOTION or NFS Type.

      • VLAN ID - Valid Vlan id range is 0 to 4096.

      • MTU - Valid MTU range is 1500 to 9216.

      • Subnet - Networks of diferent types (e.g. VSAN/VMOTION/NFS) must not have overlapping subnets

      • Subnet mask

      • gateway - The gateway defined for the specified subnet

      • List of IP address ranges - the start and end IP address of each IP Pool should be part of the subnet

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "name" : "engineering-networkpool",
  "networks" : [ {
    "type" : "VSAN",
    "vlanId" : 3002,
    "mtu" : 9001,
    "subnet" : "192.168.8.0",
    "mask" : "255.255.252.0",
    "gateway" : "192.168.8.1",
    "ipPools" : [ {
      "start" : "192.168.8.5",
      "end" : "192.168.8.8"
    } ]
  } ]
}'

HTTP Request

POST /v1/network-pools HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 304
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "name" : "engineering-networkpool",
  "networks" : [ {
    "type" : "VSAN",
    "vlanId" : 3002,
    "mtu" : 9001,
    "subnet" : "192.168.8.0",
    "mask" : "255.255.252.0",
    "gateway" : "192.168.8.1",
    "ipPools" : [ {
      "start" : "192.168.8.5",
      "end" : "192.168.8.8"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 201 Created
Location: /v1/network-pools/45aab837-8ed7-41bb-a0cf-6114729fd711

2.6.2. Get the Network Pools

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/network-pools HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 375

{
  "elements" : [ {
    "id" : "2e0f36ff-dde4-46bb-9d55-a6a3d56c9801",
    "name" : "engineering-networkpool",
    "networks" : [ {
      "id" : "bcf123b9-e672-4d9e-8deb-aa60add278ac"
    } ]
  }, {
    "id" : "2bf02db7-7549-4cee-afb2-4919e33fb12e",
    "name" : "finance-networkpool",
    "networks" : [ {
      "id" : "ce51ce4a-1bbd-4dc5-8abf-90a6c842d010"
    } ]
  } ]
}

2.6.3. Get a Network Pool

Prerequisites
  1. The following data is required

    • ID of the network pool

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools/266f27de-8c40-4fae-84c3-81117a860786' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/network-pools/266f27de-8c40-4fae-84c3-81117a860786 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 165

{
  "id" : "266f27de-8c40-4fae-84c3-81117a860786",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "581fd612-3292-42f7-ab62-c08d1356f1fe"
  } ]
}

2.6.4. Get a Network of a Network Pool

Prerequisites
  1. The following data is required

    • ID of the network

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools/6fe9fa82-3ad8-4227-b982-0b2890610cb7/networks/ba4af73a-82b5-435b-a49c-a8f85aed6400' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 270

{
  "id" : "ba4af73a-82b5-435b-a49c-a8f85aed6400",
  "type" : "VSAN",
  "vlanId" : 3002,
  "mtu" : 9216,
  "subnet" : "192.168.8.0",
  "mask" : "255.255.252.0",
  "gateway" : "192.168.8.1",
  "ipPools" : [ {
    "start" : "192.168.8.5",
    "end" : "192.168.8.8"
  } ]
}

2.6.5. Delete a Network Pool

  • Used to delete a Network pool.

  • Deleting a networkpool which is being used, will give an error.

  • Deleting a networkpool which does not exist, will give a HTTP response code 404.

Prerequisites
  1. The following data is required

    • ID of the network pool

Steps
  1. Invoke the API

Tip
Refer to: Get the Network Pools to retrieve all network pools in the system and use the ID of network pool to be deleted.

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools/64ebb627-2e0b-440a-a4b9-d28513dd8151' -i -u 'admin:VMwareInfra@1' -X DELETE \
    -H 'Content-Type: application/json'

HTTP Request

DELETE /v1/network-pools/64ebb627-2e0b-440a-a4b9-d28513dd8151 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 204 No Content

2.6.6. Add an IP Pool to a Network of a Network Pool

Prerequisites
  1. The following data is required

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools/dd409226-35ba-4fe8-ac07-4999306afc94/networks/ea7616fc-35f4-4637-abad-a736c5fe97d8/ip-pools' -i -u 'admin:VMwareInfra@1' -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}'
Request Body
POST /v1/network-pools/dd409226-35ba-4fe8-ac07-4999306afc94/networks/ea7616fc-35f4-4637-abad-a736c5fe97d8/ip-pools HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 54
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}
Response Body
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 270

{
  "id" : "ac454a66-ce2c-4154-8718-575ab686b982",
  "type" : "VSAN",
  "vlanId" : 3002,
  "mtu" : 9216,
  "subnet" : "192.168.8.0",
  "mask" : "255.255.252.0",
  "gateway" : "192.168.8.1",
  "ipPools" : [ {
    "start" : "192.168.8.5",
    "end" : "192.168.8.8"
  } ]
}

2.6.7. Delete an IP Pool from a Network of a Network Pool

Prerequisites
  1. The following data is required

    • ID of the IP pool

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/network-pools/58f519d7-c615-46ee-9ed7-955b0ae11fd8/networks/293ebf05-1e45-4089-941b-91d773d7b4bc/ip-pools' -i -u 'admin:VMwareInfra@1' -X DELETE \
    -H 'Content-Type: application/json' \
    -d '{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}'
Response Body
DELETE /v1/network-pools/58f519d7-c615-46ee-9ed7-955b0ae11fd8/networks/293ebf05-1e45-4089-941b-91d773d7b4bc/ip-pools HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Content-Length: 54
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}
Response Body
HTTP/1.1 204 No Content

2.7. Tasks

2.7.1. Get the Tasks

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/tasks' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/tasks HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1750

{
  "elements" : [ {
    "id" : "b87ea8d3-693f-4454-b0fe-a36917c6afb0",
    "name" : "Commissioning host(s) esxi-5.vrack.vsphere.local to VMware Cloud Foundation",
    "status" : "FAILED",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z",
    "subTasks" : [ {
      "name" : "HostVibValidationAction",
      "description" : "Validate the hosts for any disallowed VIBS",
      "status" : "SUCCESSFUL",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    }, {
      "name" : "HostMaintenanceModeValidationAction",
      "description" : "Verifies that none of the hosts are in maintenance mode",
      "status" : "FAILED",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    }, {
      "name" : "FetchDnsAndNtpAction",
      "description" : "Fetches DNS \\u0026 NTP IPs",
      "status" : "PENDING",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    } ],
    "errors" : [ {
      "errorCode" : "COMMISION_HOST_FAILED",
      "message" : "Failed to Commissioning host(s) esxi-5.vrack.vsphere.local to VMware Cloud Foundation"
    } ],
    "resources" : [ {
      "resourceId" : "ebe8c16f-1531-492a-b662-1adba7df47a0",
      "type" : "HOST"
    } ]
  }, {
    "id" : "9f39bcd9-962d-477b-9b3f-5b75aa8caea4",
    "name" : "Credentials rotate operation",
    "status" : "SUCCESSFUL",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z",
    "subTasks" : [ {
      "name" : "sddc-manager.vrack.vsphere.local:FTP",
      "description" : "Password rotate for sddc-manager.vrack.vsphere.local and credential type FTP",
      "status" : "SUCCESSFUL",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    } ],
    "resources" : [ {
      "resourceId" : "97dfeac9-bd28-4e5f-9fb2-4685c43103d9",
      "type" : "HOST"
    } ]
  } ]
}

2.7.2. Get a Task

Prerequisites
  1. The following data is required

    • ID of the task

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/tasks/6a6054ba-9e83-4257-8a8e-056eb77b8759' -i -u 'admin:VMwareInfra@1' \
    -H 'Content-Type: application/json'

HTTP Request

GET /v1/tasks/6a6054ba-9e83-4257-8a8e-056eb77b8759 HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 879

{
  "id" : "6a6054ba-9e83-4257-8a8e-056eb77b8759",
  "name" : "Vi workload Domain Creation",
  "status" : "UNKNOWN",
  "creationTimestamp" : "1970-01-19T02:17:49.826Z",
  "subTasks" : [ {
    "name" : "HostVibValidationAction",
    "description" : "Validate the hosts for any disallowed VIBS",
    "status" : "SUCCESSFUL",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z"
  }, {
    "name" : "HostMaintenanceModeValidationAction",
    "description" : "Verifies that none of the hosts are in maintenance mode",
    "status" : "FAILED",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z"
  }, {
    "name" : "FetchDnsAndNtpAction",
    "description" : "Fetches DNS \\u0026 NTP IPs",
    "status" : "PENDING",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z"
  } ],
  "resources" : [ {
    "resourceId" : "9afbd8fe-0d87-4861-b5bf-da009f52ee37",
    "type" : "HOST"
  } ]
}

2.7.3. Retry a Task

Used to retry a failed task/workflow.

Prerequisites
  1. The following data is required

    • ID of the failed task

Steps
  1. Invoke the API

cURL Request

$ curl 'https://sddc-manager.sfo01.rainpole.local/v1/tasks/12daae78-5a6e-41b3-819d-fd70386f5e0a' -i -u 'admin:VMwareInfra@1' -X PATCH \
    -H 'Content-Type: application/json'

HTTP Request

PATCH /v1/tasks/12daae78-5a6e-41b3-819d-fd70386f5e0a HTTP/1.1
Content-Type: application/json
Host: sddc-manager.sfo01.rainpole.local
Authorization: Basic YWRtaW46Vk13YXJlSW5mcmFAMQ==

HTTP Response

HTTP/1.1 200 OK
Note
The credentials' update/rotate password tasks cannot be retried using this API. Refer to Retry a failed credentials task for a given ID section.