Skip to main content

certificates

Creates, updates, deletes, gets or lists a certificates resource.

Overview

Namecertificates
TypeResource
Iddigitalocean.compute.certificates

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a certificate key. This will be set to an object containing the standard certificate attributes.

NameDatatypeDescription
idstring (uuid)A unique ID that can be used to identify and reference a certificate. (example: 892071a0-bb95-49bc-8021-3afd67a210bf)
namestringA unique human-readable name referring to a certificate. (example: web-cert-01)
created_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the certificate was created. (example: 2017-02-08T16:02:37Z)
dns_namesarrayAn array of fully qualified domain names (FQDNs) for which the certificate was issued.
not_afterstring (date-time)A time value given in ISO8601 combined date and time format that represents the certificate's expiration date. (example: 2017-02-22T00:23:00Z)
sha1_fingerprintstringA unique identifier generated from the SHA-1 fingerprint of the certificate. (example: dfcc9f57d86bf58e321c2c6c31c7a971be244ac7)
statestringA string representing the current state of the certificate. It may be pending, verified, or error. (example: verified)
typestringA string representing the type of the certificate. The value will be custom for a user-uploaded certificate or lets_encrypt for one automatically generated with Let's Encrypt. (example: lets_encrypt)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
certificates_getselectcertificate_idTo show information about an existing certificate, send a GET request to /v2/certificates/$CERTIFICATE_ID.
certificates_listselectper_page, page, nameTo list all of the certificates available on your account, send a GET request to /v2/certificates.
certificates_createinsertTo upload new SSL certificate which you have previously generated, send a POST
request to /v2/certificates.

When uploading a user-generated certificate, the private_key,
leaf_certificate, and optionally the certificate_chain attributes should
be provided. The type must be set to custom.

When using Let's Encrypt to create a certificate, the dns_names attribute
must be provided, and the type must be set to lets_encrypt.
certificates_deletedeletecertificate_idTo delete a specific certificate, send a DELETE request to
/v2/certificates/$CERTIFICATE_ID.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
certificate_idstring (uuid)A unique identifier for a certificate. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6)
namestringName of expected certificate (example: certificate-name)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

To show information about an existing certificate, send a GET request to /v2/certificates/$CERTIFICATE_ID.

SELECT
id,
name,
created_at,
dns_names,
not_after,
sha1_fingerprint,
state,
type
FROM digitalocean.compute.certificates
WHERE certificate_id = '{{ certificate_id }}' -- required;

INSERT examples

To upload new SSL certificate which you have previously generated, send a POST
request to /v2/certificates.

When uploading a user-generated certificate, the private_key,
leaf_certificate, and optionally the certificate_chain attributes should
be provided. The type must be set to custom.

When using Let's Encrypt to create a certificate, the dns_names attribute
must be provided, and the type must be set to lets_encrypt.

INSERT INTO digitalocean.compute.certificates (

)
SELECT

RETURNING
certificate
;

DELETE examples

To delete a specific certificate, send a DELETE request to
/v2/certificates/$CERTIFICATE_ID.

DELETE FROM digitalocean.compute.certificates
WHERE certificate_id = '{{ certificate_id }}' --required;