• Home
  • Dynatrace Managed
  • Cluster API
  • Cluster API v1
  • SSL certificates v1
  • Store cluster SSL certificate

Store cluster SSL certificate

This API call stores a cluster SSL certificate.

Authentication

To execute this request, you need the Service Provider API (ServiceProviderAPI) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/v1.0/onpremise/sslCertificate/store

Parameter

ParameterTypeDescriptionInRequired
entityTypestring

entity type, possible values = "SERVER, COLLECTOR"

The element can hold these values
  • COLLECTOR
  • SERVER
pathrequired
entityIdinteger

Node ID, which can be extracted from the URL in 'Node details' view.

pathrequired
bodysslCertDto

SSL certificate configuration.

bodyoptional

Request body objects

The sslCertDto object

SSL certificate configuration.

ElementTypeDescriptionRequired
privateKeyEncodedstring

Private key PKCS #8 standard, PEM base64-encoded format

required
publicKeyCertificateEncodedstring

Certificate X.509 standard, PEM base64-encoded format, server certificate

required
certificateChainEncodedstring

Certificate(s) X.509 standard, PEM base64-encoded format, intermediate and root certificates

optional

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "privateKeyEncoded": "-----BEGIN RSA PRIVATE KEY-----\nMIIEow...aHzMvp\n-----END RSA PRIVATE KEY-----", "publicKeyCertificateEncoded": "-----BEGIN CERTIFICATE-----\nMIIDKT...XbTK+M\n-----END CERTIFICATE-----", "certificateChainEncoded": "-----BEGIN CERTIFICATE-----\nMIIDKT...XbTK+M\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDKT...bXTK+M\n-----END CERTIFICATE-----" }

Response

Response codes

CodeTypeDescription
200CertificateStoreStatus

Successful or in progress

400CertificateStoreStatus

Incorrect entity type

500

Internal error

522CertificateStoreStatus

Certificate chain is invalid

523CertificateStoreStatus

Private key does not match public key certificate

525CertificateStoreStatus

Public key certificate is invalid

526CertificateStoreStatus

Private key is invalid

527CertificateStoreStatus

Error while storing SSL certificate

528CertificateStoreStatus

Certificate has been stored but has not been refreshed

529CertificateStoreStatus

Internal error

Response body objects

The CertificateStoreStatus object

ElementTypeDescription
certificateStoreStatusstring-
The element can hold these values
  • BAD_REQUEST
  • CERTIFICATE_CHAIN_IS_INVALID
  • CERTIFICATE_IS_EXPIRED
  • CERTIFICATE_STORED_BUT_NOT_REFRESHED
  • ERROR
  • GENERAL_ERROR_WHILE_STORING_CERTIFICATE
  • IN_PROGRESS
  • NOT_FOUND
  • OK
  • PRIVATE_KEY_DOES_NOT_MATCH_PUBLIC_KEY_CERTIFICATE
  • PRIVATE_KEY_IS_INVALID
  • PUBLIC_KEY_CERTIFICATE_IS_INVALID
detailedErrorstring-

Response body JSON model

json
{ "certificateStoreStatus": "BAD_REQUEST", "detailedError": "string" }

Example

In this example, you store the SSL certificate on 32 node of the myManaged.cluster.com cluster. In return you receive information that the SSL certificate was successfully updated. Make sure that your request is in JSON format. This means that the privateKeyEncoded, publicKeyCertificateEncoded and certificateChainEncoded objects are in a single line.

Curl

bash
curl -X POST "https://myManaged.cluster.com/api/v1.0/onpremise/sslCertificate/store/SERVER/32" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"privateKeyEncoded\":\"-----BEGIN RSA PRIVATE KEY-----\MIIEow...aHzMvp\-----END RSA PRIVATE KEY-----\",\"publicKeyCertificateEncoded\":\"-----BEGIN CERTIFICATE-----\MIIDKT...XbTK+M\-----END CERTIFICATE-----\",\"certificateChainEncoded\":\"-----BEGIN CERTIFICATE-----\MIIDKT...XbTK+M\-----END CERTIFICATE-----\-----BEGIN CERTIFICATE-----\MIIDKT...bXTK+M\-----END CERTIFICATE-----\"}"

Request URL

plaintext
https://myManaged.cluster.com/api/v1.0/onpremise/sslCertificate/store/SERVER/32

Response body

Successfully updated. Response doesn't have a body.

Response code

200