System APIs

System APIs

APIs for managing DNS & NTP configuration

Table of Contents

1. Configuration of New DNS Server

1.1. Prerequisites

  • The new DNS server to be configured should be reachable from SDDC components.

  • DNS resolution (forward and reverse lookup) for all management VMs and ESXi hosts in place

  • All SDDC components should be reachable from SDDC manager.

  • All SDDC components state should be "ACTIVE" in VCF inventory.

1.2. Steps

  • Validate the DnsConfiguration input before configuration.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/dns-configuration/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "dnsServers" : [ {
    "ipAddress" : "10.0.0.250",
    "isPrimary" : true
  } ]
}'

HTTP Request

POST /v1/system/dns-configuration/validations HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 85
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "dnsServers" : [ {
    "ipAddress" : "10.0.0.250",
    "isPrimary" : true
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/system/dns-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd
Content-Type: application/json
Content-Length: 407

{
  "id" : "71653367-2ea8-49f2-bf72-0e0e1fa57dcd",
  "description" : "Validate input specification as new NtpConfiguration to VMware Cloud Foundations",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating NTP input specification",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating NTP server 10.0.0.250",
    "resultStatus" : "UNKNOWN"
  } ]
}
  • Poll until "executionStatus" is not "IN_PROGRESS" using the "id" from the previous response.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/dns-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/system/dns-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "71653367-2ea8-49f2-bf72-0e0e1fa57dcd",
  "description" : "Validate input specification as new NtpConfiguration to VMware Cloud Foundations",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating NTP input specification",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating NTP server 10.0.0.250",
    "resultStatus" : "UNKNOWN"
  } ]
}
  • In case of no errors in the validation , the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • 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.

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/dns-configuration' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "dnsServers" : [ {
    "ipAddress" : "10.0.0.250",
    "isPrimary" : true
  } ]
}'

HTTP Request

PUT /v1/system/dns-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 85
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "dnsServers" : [ {
    "ipAddress" : "10.0.0.250",
    "isPrimary" : true
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/f0da79cd-6f5c-4118-95cc-e56af204e4cd
Content-Type: application/json
Content-Length: 131

{
  "id" : "f0da79cd-6f5c-4118-95cc-e56af204e4cd",
  "name" : "Configuring DNS servers on VCF system",
  "status" : "IN_PROGRESS"
}
  • 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.

  • Get the DnsConfiguration state.

cURL Request

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

HTTP Request

GET /v1/system/dns-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "dnsServers" : [ {
    "ipAddress" : "10.0.0.250",
    "isPrimary" : true
  } ]
}

2. Configuration of New NTP Server

2.1. Prerequisites

  • The new NTP server(s) to be configured should be reachable from SDDC components.

  • The new NTP server(s) should be able to do NTP sync from SDDC Manager.

  • All SDDC components should be reachable from SDDC manager.

  • All SDDC components state should be active as per SDDC Manager.

  • The new server should be NTP synced from the SDDC Manager.

2.2. Steps

  • Perform the validation step for the desired NTP configuration before applying the same.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/ntp-configuration/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "ntpServers" : [ {
    "ipAddress" : "10.0.0.250"
  } ]
}'

HTTP Request

POST /v1/system/ntp-configuration/validations HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 61
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "ntpServers" : [ {
    "ipAddress" : "10.0.0.250"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/system/ntp-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd
Content-Type: application/json
Content-Length: 407

{
  "id" : "71653367-2ea8-49f2-bf72-0e0e1fa57dcd",
  "description" : "Validate input specification as new NtpConfiguration to VMware Cloud Foundations",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating NTP input specification",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating NTP server 10.0.0.250",
    "resultStatus" : "UNKNOWN"
  } ]
}
  • Poll until "executionStatus" is not "IN_PROGRESS" using the "id" from the previous response.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/ntp-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/system/ntp-configuration/validations/71653367-2ea8-49f2-bf72-0e0e1fa57dcd HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "71653367-2ea8-49f2-bf72-0e0e1fa57dcd",
  "description" : "Validate input specification as new NtpConfiguration to VMware Cloud Foundations",
  "executionStatus" : "IN_PROGRESS",
  "validationChecks" : [ {
    "description" : "Validating NTP input specification",
    "resultStatus" : "UNKNOWN"
  }, {
    "description" : "Validating NTP server 10.0.0.250",
    "resultStatus" : "UNKNOWN"
  } ]
}
  • In case of no errors in the validation , the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • 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.

  • As the Validation is complete now, perform the NTP configuration using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/system/ntp-configuration' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "ntpServers" : [ {
    "ipAddress" : "10.0.0.250"
  } ]
}'

HTTP Request

PUT /v1/system/ntp-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 61
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "ntpServers" : [ {
    "ipAddress" : "10.0.0.250"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/28d3f5ae-8072-4b83-ac99-b18d465485bc
Content-Type: application/json
Content-Length: 131

{
  "id" : "28d3f5ae-8072-4b83-ac99-b18d465485bc",
  "name" : "Configuring NTP servers on VCF system",
  "status" : "IN_PROGRESS"
}
  • 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.

  • Get the DnsConfiguration state

cURL Request

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

HTTP Request

GET /v1/system/ntp-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "ntpServers" : [ {
    "ipAddress" : "10.0.0.250"
  } ]
}

Last updated 2022-09-28 17:42:27 PDT

Operations
PUT
Configure Dns
Configure the Dns Server
PUT
Configure Ntp
Configure the Ntp Server
GET
Get Dns Configuration
Get the current DnsConfiguration
GET
Get Ntp Configuration
Get the current NtpConfiguration
GET
Get System
Get the system
GET
Get Validation Of Dns Configuration
Get the status of the validation of the input DnsConfiguration
GET
Get Validation Of Ntp Configuration
Get the status of the validation of the input ntpServers to configure new Ntp server
GET
Get Validations Of DNS Configuration
Get the validations of the input dnsServers to configure new DNS server
GET
Get Validations Of Ntp Configuration
Get the validations of the input ntpServers to configure new Ntp server
POST
Validate Dns Configuration
Validate DnsConfiguration input spec and system health before DNS configuration
POST
Validate Ntp Configuration
Validate NtpConfiguration input spec and system health before Ntp configuration