Certificates APIs

Certificates APIs

APIs for managing Certificates

Table of Contents

1. Install Certificates By Online Mode

The following steps have to be followed to install certificates signed by VCF supporting certificate authorities (Microsoft CA and OpenSSL CA).

1.1. Prerequisites API

  • The SDDC Manager should be up and running.

  • The resources of the target domain (e.g. MGMT) should be in ACTIVE state.

1.2. Steps API

  • Check the configured certificate authorities

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/certificate-authorities HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ {
    "id" : "OpenSSL",
    "commonName" : "OpenSSL CA",
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF"
  }, {
    "id" : "Microsoft",
    "username" : "Administrator",
    "serverUrl" : "https://sfo-ad.rainpole.io/certsrv",
    "templateName" : "WebServer"
  } ]
}

Tip : Refer to: Get certificate authorities information API

  • Configure a certificate authority (either "Microsoft" or "OpenSSL") if it is not configured

Configure "Microsoft" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "microsoftCertificateAuthoritySpec" : {
    "username" : "Administrator",
    "secret" : "********",
    "serverUrl" : "https://sfo-ad.rainpole.io/certsrv",
    "templateName" : "WebServer"
  }
}'

HTTP Request

PUT /v1/certificate-authorities HTTP/1.1
Content-Type: application/json
Content-Length: 199
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "microsoftCertificateAuthoritySpec" : {
    "username" : "Administrator",
    "secret" : "********",
    "serverUrl" : "https://sfo-ad.rainpole.io/certsrv",
    "templateName" : "WebServer"
  }
}

HTTP Response

HTTP/1.1 200 OK

Configure "OpenSSL" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "openSSLCertificateAuthoritySpec" : {
    "commonName" : "OpenSSL CA",
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF"
  }
}'

HTTP Request

PUT /v1/certificate-authorities HTTP/1.1
Content-Type: application/json
Content-Length: 226
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "openSSLCertificateAuthoritySpec" : {
    "commonName" : "OpenSSL CA",
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF"
  }
}

HTTP Response

HTTP/1.1 200 OK

Tip : Refer to: Create a certificate authority API

  • Reconfigure the certificate authority if required

Reconfigure "Microsoft" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "microsoftCertificateAuthoritySpec" : {
    "templateName" : "WebServer"
  }
}'

HTTP Request

PATCH /v1/certificate-authorities HTTP/1.1
Content-Type: application/json
Content-Length: 82
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "microsoftCertificateAuthoritySpec" : {
    "templateName" : "WebServer"
  }
}

HTTP Response

HTTP/1.1 200 OK

Reconfigure "OpenSSL" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "openSSLCertificateAuthoritySpec" : {
    "commonName" : "OpenSSL CA"
  }
}'

HTTP Request

PATCH /v1/certificate-authorities HTTP/1.1
Content-Type: application/json
Content-Length: 79
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "openSSLCertificateAuthoritySpec" : {
    "commonName" : "OpenSSL CA"
  }
}

HTTP Response

HTTP/1.1 200 OK

Tip : Refer to: Configure existing certificate authority API

  • Verify that the certificate authority is successfully configured by invoking the API with type of CA as the ID (optional)

Verify configuration for "Microsoft" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities/Microsoft' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/certificate-authorities/Microsoft HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "Microsoft",
  "username" : "Administrator",
  "serverUrl" : "https://sfo-ad.rainpole.io/certsrv",
  "templateName" : "WebServer"
}

Verify configuration for "OpenSSL" certificate authority
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/certificate-authorities/OpenSSL' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/certificate-authorities/OpenSSL HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "OpenSSL",
  "commonName" : "OpenSSL CA",
  "country" : "IN",
  "state" : "Karnataka",
  "locality" : "Bengaluru",
  "organization" : "VMware Inc.",
  "organizationUnit" : "VCF"
}

Tip : Refer to: Get certificate authority information API

  • After the successful certificate authority configuration, generate CSR by invoking the API

Tip : If "resources" field is not given then operations are performed on all the resources in the domain.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "csrGenerationSpec" : {
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF",
    "email" : "[email protected]",
    "keySize" : "3072",
    "keyAlgorithm" : "RSA"
  },
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs HTTP/1.1
Content-Type: application/json
Content-Length: 352
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "csrGenerationSpec" : {
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF",
    "email" : "[email protected]",
    "keySize" : "3072",
    "keyAlgorithm" : "RSA"
  },
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/b6ff4099-040f-4177-8906-f5455d79d9bf
Content-Type: application/json
Content-Length: 131

{
  "id" : "b6ff4099-040f-4177-8906-f5455d79d9bf",
  "status" : "IN_PROGRESS",
  "isCancellable" : false,
  "isRetryable" : false
}

Tip : Refer to: Generate CSR(s) API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

Tip : Refer to: Get a Task.

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

  • If the "status" is "FAILED", execute the generate CSR request again.

  • After successful CSR generation, generate the certificates signed by supported certificates authorities (either OpenSSL or Microsoft) by invoking the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "caType" : "Microsoft",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "caType" : "Microsoft",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/null

Tip : Refer to: Generate certificate(s) for the selected resource(s) in a domain API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

Tip : Refer to: Get a Task.

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

  • If the "status" is "FAILED", execute the generate certificate request again.

  • If the generation of certificates is successful, fetch the contents of the generated certificates to check for which resources certificates are generated by invoking the API (optional)

Note : The following will display only the list of certificates generated from the SDDC manager.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ {
    "isInstalled" : false,
    "version" : "V3",
    "serialNumber" : "46:85:19:77:36:12:67:26",
    "issuedTo" : "sfo-vc01.rainpole.io",
    "issuedBy" : "CN=OpenSSL CA, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN",
    "notBefore" : "2024-06-21T02:31:34.866Z",
    "notAfter" : "2025-07-24T02:31:34.866Z",
    "signatureAlgorithm" : "SHA256withRSA",
    "subject" : "CN=sfo-vc01.rainpole.io, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN",
    "subjectAlternativeName" : [ "sfo-vc01.rainpole.io" ],
    "publicKey" : "D6:FD:DF:33:F1:...",
    "publicKeyAlgorithm" : "RSA",
    "keySize" : "3072",
    "thumbprintAlgorithm" : "SHA-256",
    "thumbprint" : "59:24:D5:18:04:A0:26:B0:A4:05:EA:82:60:95:82:A2:4B:F6:31:FB:81:93:01:F3:29:7D:34:9C:D3:05:39:90",
    "numberOfDaysToExpire" : 398,
    "expirationStatus" : "ACTIVE",
    "pemEncoded" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
  } ]
}

Tip : Refer to: Get latest generated certificate(s) in a domain API

  • After successful certificate generation, install the signed certificates on remote resources by invoking the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "operationType" : "INSTALL",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}'

HTTP Request

PATCH /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates HTTP/1.1
Content-Type: application/json
Content-Length: 120
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "operationType" : "INSTALL",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/acb411f6-09d0-4cbc-8cb9-274489c203af
Content-Type: application/json
Content-Length: 131

{
  "id" : "acb411f6-09d0-4cbc-8cb9-274489c203af",
  "status" : "IN_PROGRESS",
  "isCancellable" : false,
  "isRetryable" : false
}

Tip : Refer to: Replace certificate(s) for the selected resource(s) in a domain API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

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

  • Fetch the installed certificates by invoking the API (optional)

Note : The following will display the list of installed certificates.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ ]
}

Tip : Refer to: View certificate of all the resources in a domain API

Warning : Certificate installation will replace the already installed certificates.

Note : The CSRs cannot be fetched after successful certificate installation.

Note : Only singleton object of a particular certificate authority will exist at any point of time in the VCF environment.

Note : Only the latest generated CSRs will exist in the VCF environment after a series of generate CSR operation.

Note : Only the latest generated certificates will exist in the VCF environment after a series of generate certificate operation.

[_createcertificateauthority] API [_getcertificateauthorities] API [_getcertificateauthoritybyid] API [_configurecertificateauthority] API [_generatescsrs] API [_getcsrs] API [_generatecertificates] API [_getcertificates] API [_replacecertificates] API [_getcertificatesbydomain] API [_gettasks] API [_gettask] API

2. Install Certificates By Offline Mode

The following steps have to be followed to install certificates signed by external third party certificate authorities.

2.1. Prerequisites API

  • The SDDC Manager should be up and running.

  • The resources of the target domain (e.g. MGMT) should be in ACTIVE state.

2.2. Steps API

  • Generate CSR by invoking the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "csrGenerationSpec" : {
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF",
    "email" : "[email protected]",
    "keySize" : "3072",
    "keyAlgorithm" : "RSA"
  },
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs HTTP/1.1
Content-Type: application/json
Content-Length: 352
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "csrGenerationSpec" : {
    "country" : "IN",
    "state" : "Karnataka",
    "locality" : "Bengaluru",
    "organization" : "VMware Inc.",
    "organizationUnit" : "VCF",
    "email" : "[email protected]",
    "keySize" : "3072",
    "keyAlgorithm" : "RSA"
  },
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/b6ff4099-040f-4177-8906-f5455d79d9bf
Content-Type: application/json
Content-Length: 131

{
  "id" : "b6ff4099-040f-4177-8906-f5455d79d9bf",
  "status" : "IN_PROGRESS",
  "isCancellable" : false,
  "isRetryable" : false
}

Tip : Refer to: Generate CSR(s) API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

Tip : Refer to: Get a Task.

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

  • If the "status" is "FAILED", execute the generate CSR request again.

  • If the generation of CSR is successful, either get available CSR(s) in "json" format or download available CSR(s) in ".tar.gz" format.

Get available CSR(s) in "json" format
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ {
    "csrEncodedContent" : "-----BEGIN CERTIFICATE REQUEST-----\nMIIEH...\n-----END CERTIFICATE REQUEST-----",
    "resource" : {
      "fqdn" : "sfo-vc01.rainpole.io",
      "type" : "VCENTER"
    }
  } ]
}

Tip : Refer to: Get available CSR(s) in json format API

Download available CSR(s) in ".tar.gz" format
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs/downloads' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/csrs/downloads HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 24
Content-Disposition: attachment; filename="MGMT.tar.gz"
Accept-Ranges: bytes

<binary .tar.gz content>

Tip : Refer to: Download available CSR(s) in tar.gz format API

  • Use the downloaded CSRs to have it manually signed by external certificate authorities.

  • Validate the signed certificate before installation by invoking the API (optional)

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates/validations' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '[ {
  "resourceFqdn" : "sfo-vc01.rainpole.io",
  "resourceCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----",
  "caCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
}, {
  "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
  "certificateChain" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
} ]'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates/validations HTTP/1.1
Content-Type: application/json
Content-Length: 581
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

[ {
  "resourceFqdn" : "sfo-vc01.rainpole.io",
  "resourceCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----",
  "caCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
}, {
  "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
  "certificateChain" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
} ]

HTTP Response

HTTP/1.1 201 Created
Location: /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates/validations/B1930850-7D1A-4BAA-89D7-52FD5DAD196A
Content-Type: application/json
Content-Length: 524

{
  "validationId" : "B1930850-7D1A-4BAA-89D7-52FD5DAD196A",
  "startTimestamp" : "2024-06-21T02:31:35.368999772Z",
  "completed" : false,
  "validations" : [ {
    "resourceFqdn" : "sfo-vc01.rainpole.io",
    "startTimestamp" : "2024-06-21T02:31:35.368999772Z",
    "endTimestamp" : "2024-06-21T02:31:40.369036288Z",
    "validationStatus" : "SUCCESSFUL"
  }, {
    "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
    "startTimestamp" : "2024-06-21T02:31:35.368999772Z",
    "validationStatus" : "INPROGRESS"
  } ]
}

Tip : Refer to: Validate resource certificates API

  • Poll the status of the certificate validation using the validation task API with the validation ID from the response of the previous API until "completed" is not "true".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates/validations/B1930850-7D1A-4BAA-89D7-52FD5DAD196A' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates/validations/B1930850-7D1A-4BAA-89D7-52FD5DAD196A HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "validationId" : "B1930850-7D1A-4BAA-89D7-52FD5DAD196A",
  "startTimestamp" : "2024-06-21T02:31:35.221475511Z",
  "endTimestamp" : "2024-06-21T02:31:40.221566645Z",
  "completed" : true,
  "validations" : [ {
    "resourceFqdn" : "sfo-vc01.rainpole.io",
    "startTimestamp" : "2024-06-21T02:31:35.221475511Z",
    "endTimestamp" : "2024-06-21T02:31:40.221566645Z",
    "validationStatus" : "SUCCESSFUL"
  }, {
    "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
    "startTimestamp" : "2024-06-21T02:31:35.221475511Z",
    "endTimestamp" : "2024-06-21T02:31:40.221566645Z",
    "validationStatus" : "FAILED",
    "validationMessage" : "Certificate Expired"
  } ]
}

Tip : Refer to: Get the resource certificate validation result API

  • If the certificate validation is successful, the signed certificates can be uploaded and installed in either ".tar.gz" format or in "json" format.

Upload and install signed certificates in ".tar.gz" format

  • Create a ".tar.gz" file with the following directory structure:

    • The name of the top-level directory must exactly match the name of the domain to which certificates are to be installed.

    • The PEM-encoded root CA certificate chain file (rootca.crt) must reside inside this top-level directory.

    • This directory must contain one sub-directory for each component resource and the name of each sub-directory must exactly match the resource fqdn.

    • Each sub-directory must contain a corresponding ".crt" file, whose name must exactly match the resource fqdn followed by ".crt" extension.

  • Upload the packaged signed certificates by invoking the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates/uploads' -i -X PUT \
    -H 'Content-Type: multipart/form-data' \
    -H 'Authorization: Bearer etYWRta....' \
    -F '[email protected];type=application/gzip'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates/uploads HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=MGMT.tar.gz
Content-Type: application/gzip

<binary .tar.gz content>
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

HTTP Response

HTTP/1.1 200 OK

Tip : Refer to: Upload certificates to the certificate store API

  • After successful upload operation, install the signed certificates on remote resources by invoking the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "operationType" : "INSTALL",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}'

HTTP Request

PATCH /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/certificates HTTP/1.1
Content-Type: application/json
Content-Length: 120
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "operationType" : "INSTALL",
  "resources" : [ {
    "fqdn" : "sfo-vc01.rainpole.io",
    "type" : "VCENTER"
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/acb411f6-09d0-4cbc-8cb9-274489c203af
Content-Type: application/json
Content-Length: 131

{
  "id" : "acb411f6-09d0-4cbc-8cb9-274489c203af",
  "status" : "IN_PROGRESS",
  "isCancellable" : false,
  "isRetryable" : false
}

Tip : Refer to: Replace certificate(s) for the selected resource(s) in a domain API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

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

Upload and install signed certificates in "json" format
cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '[ {
  "resourceFqdn" : "sfo-vc01.rainpole.io",
  "resourceCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----",
  "caCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
}, {
  "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
  "certificateChain" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
} ]'

HTTP Request

PUT /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates HTTP/1.1
Content-Type: application/json
Content-Length: 581
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

[ {
  "resourceFqdn" : "sfo-vc01.rainpole.io",
  "resourceCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----",
  "caCertificate" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
}, {
  "resourceId" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC",
  "certificateChain" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----"
} ]

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/tasks/d4cd8f08-386c-4095-806e-8195d3047117
Content-Type: application/json
Content-Length: 131

{
  "id" : "d4cd8f08-386c-4095-806e-8195d3047117",
  "status" : "IN_PROGRESS",
  "isCancellable" : false,
  "isRetryable" : false
}

Tip : Refer to: Replace resource certificates API

  • Poll the status of the task using the task API with the ID from the response of the previous API until "status" is not "IN_PROGRESS".

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

  • Fetch the installed certificates by invoking the API (optional)

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3E86FBAD-8984-4D4B-992D-F0C49857572A/resource-certificates HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ ]
}

Tip : Refer to: View certificate of all the resources in a domain API

Warning : Certificate installation will replace the already installed certificates.

Note : The CSRs cannot be fetched or downloaded after successful certificate installation.

Note : Only the latest generated CSRs will exist in the VCF environment after a series of generate CSR operation.

Note : Only the latest uploaded certificates will exist in the VCF environment after a series of upload certificate operation.

[_generatescsrs] API [_getcsrs] API [_downloadcsr] API [_uploadcertificates] API [_validateresourcecertificates] API [_getresourcecertificatesvalidationresult] API [_replacecertificates] API [_replaceresourcecertificates] API [_getcertificatesbydomain] API [_gettasks] API [_gettask] API
Last updated 2024-06-21 01:22:12 -0700

Operations
PATCH
Configure Certificate Authority
Update the configuration of a Certificate Authority
PUT
Create Certificate Authority
Configure integration with a Certificate Authority
GET
Download CSR Deprecated
Request the download of CSR(s) for a domain in tar.gz format
PUT
Generate Certificates
Request the creation of signed certificate for resources of a domain
PUT
Generates CS Rs
Request the creation of certificate signing request (CSR) files for resources of a domain
GET
Get Certificate Authorities
Retrieve a list of Certificate Authorities
GET
Get Certificate Authority By Id
Retrieve the details of a Certificate Authority by ID
GET
Get Certificates By Domain
Retrieve the certificate details for all resources in a domain
GET
Get CS Rs
Request available CSR(s) in JSON format for a domain
GET
Get Domain Certificates
Retrieve the latest generated certificates for a domain by its ID
GET
Get Resource Certificates Validation By ID
Retrieve the results of a certificate validation by its ID
DELETE
Remove Certificate Authority
Remove the configuration of a Certificate Authority
PATCH
Replace Certificates
Replace certificate(s) for the selected resource(s) in a domain
PUT
Replace Resource Certificates
Replace the certificate(s) for selected resources of a domain
PUT
Upload Certificates Deprecated
Import certificate(s) to the certificate store for a domain
PUT
Validate Resource Certificates
Perform validation of the ResourceCertificateSpec specification