In my last post, I documented the HCX installation workflow for VCD-based clouds. In this post, I will show how to do the same via API.
Once HCX Cloud Manager has been deployed and boots up, you can use the below API to integrate VCD into HCX.
1: Import VCD Certificate
|
1 2 3 4 5 6 7 |
Method:POST URL:https://{hcx-cloud-fqdn}:9443/api/admin/certificates Headers:Accept:application/json RequestPayload:Body:form-data,Key:url,value:'https://vcd01.vstellar.local' |
Response Output
[bg_collapse view=”button-green” color=”#4a4949″ icon=”arrow” expand_text=”Response Output” collapse_text=”Show Less” ]
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
{ "success":true, "completed":true, "time":1609567590525, "data":{ "items":[ { "subject":{ "commonName":"vcd01.vstellar.local", "subjectAlternativeNames":[ "vcd01.vstellar.local", "vcd01", "172.16.80.51", "172.16.10.51" ] }, "issuer":{ "commonName":"vcd01.vstellar.local" }, "fingerprints":{ "sha1":"1b26dfd64a9ea12e4e9a290da7fd59acaf086e0c", "sha256":"56f682ff74c6a64ca36e1697cf668ebb45b2839ec1b4fc112a2e62b8eebdb308" }, "notValidBefore":"2020-11-21T12:37:36Z", "notValidAfter":"2021-11-21T12:37:36Z" } ] } } |
[/bg_collapse]
2: Configure VCD
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Method:POST URL:https://{hcx-cloud-fqdn}:9443/api/admin/global/config/vcd/ Headers:Accept:application/json,Content-Type:application/json Payload: { "data":{ "items":[ { "config":{ "url":"https://vcd01.vstellar.local", "userName":"admin@system", "password":"VMware1!", "systemPrefix":"vcd", "uiEndPoint":"https://vcd01.vstellar.local", "publicUrlBase":"https://vcd01.vstellar.local", "systemExchange":"systemExchange" } } ] } } |
3: Retrieve VCD Settings
|
1 2 3 4 5 |
Method:GET URL:https://{hcx-cloud-fqdn}:9443/api/admin/global/config/vcd Headers:Accept:application/json |
Response Output:Above API calls return VCD UUID in response
[bg_collapse view=”button-green” color=”#4a4949″ icon=”arrow” expand_text=”Show More” collapse_text=”Show Less” ]
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
{ "data":{ "items":[ { "config":{ "userName":"admin@system", "url":"https://vcd01.vstellar.local", "delegateAuthToVCD":false, "publicUrlBase":"https://vcd01.vstellar.local", "uiEndPoint":"https://vcd01.vstellar.local", "systemExchange":"systemExchange", "systemPrefix":"vcd", "version":"10.2.0.17008054", "UUID":"bf0dd784-aea6-4fad-ba8e-363670c7c8ea" }, "section":"vcd" } ] } } |
[/bg_collapse]
4: Verify VCD Inventory Sync Status
|
1 2 3 4 5 6 7 |
Method:GET URL:https://{hcx-cloud-fqdn}:9443/api/admin/global/config/vcd/<vcd-uuid>/status Auth:Basic Headers:Accept:application/json |
Response Output
|
1 2 3 4 |
{ "status":"OK", "lastInventorySyncTime":"1609568233000" } |
Note: If you need to modify the VCD details after configuration, you can use the PUT API call.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
Method:PUT URL:https://{hcx-cloud-fqdn}:9443/api/admin/global/config/vcd/bf0dd784-aea6-4fad-ba8e-363670c7c8ea Headers:Accept:application/json,Content-Type:application/json RequestPayload: { "data":{ "items":[ { "config":{ "userName":"admin@system", "url":"https://vcd01.vstellar.local", "systemPrefix":"vcd", "uiEndPoint":"https://vcd01.vstellar.local", "publicUrlBase":"https://vcd01.vstellar.local", "systemExchange":"systemExchange", "password":"Vk13YXJlMSE=", "delegateAuthToVCD":false, "UUID":"bf0dd784-aea6-4fad-ba8e-363670c7c8ea" } } ] } } |
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. 🙂