certificates
Creates, updates, deletes, gets or lists a certificates
resource.
Overview
Name | certificates |
Type | Resource |
Id | digitalocean.compute.certificates |
Fields
The following fields are returned by SELECT
queries:
- certificates_get
- certificates_list
The response will be a JSON object with a certificate
key. This will be set to an object containing the standard certificate attributes.
Name | Datatype | Description |
---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference a certificate. (example: 892071a0-bb95-49bc-8021-3afd67a210bf) |
name | string | A unique human-readable name referring to a certificate. (example: web-cert-01) |
created_at | string (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_names | array | An array of fully qualified domain names (FQDNs) for which the certificate was issued. |
not_after | string (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_fingerprint | string | A unique identifier generated from the SHA-1 fingerprint of the certificate. (example: dfcc9f57d86bf58e321c2c6c31c7a971be244ac7) |
state | string | A string representing the current state of the certificate. It may be pending , verified , or error . (example: verified) |
type | string | A 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) |
The result will be a JSON object with a certificates
key. This will be set to an array of certificate objects, each of which will contain the standard certificate attributes.
Name | Datatype | Description |
---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference a certificate. (example: 892071a0-bb95-49bc-8021-3afd67a210bf) |
name | string | A unique human-readable name referring to a certificate. (example: web-cert-01) |
created_at | string (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_names | array | An array of fully qualified domain names (FQDNs) for which the certificate was issued. |
not_after | string (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_fingerprint | string | A unique identifier generated from the SHA-1 fingerprint of the certificate. (example: dfcc9f57d86bf58e321c2c6c31c7a971be244ac7) |
state | string | A string representing the current state of the certificate. It may be pending , verified , or error . (example: verified) |
type | string | A 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
certificates_get | select | certificate_id | To show information about an existing certificate, send a GET request to /v2/certificates/$CERTIFICATE_ID . | |
certificates_list | select | per_page , page , name | To list all of the certificates available on your account, send a GET request to /v2/certificates . | |
certificates_create | insert | 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 shouldbe provided. The type must be set to custom .When using Let's Encrypt to create a certificate, the dns_names attributemust be provided, and the type must be set to lets_encrypt . | ||
certificates_delete | delete | certificate_id | To 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.
Name | Datatype | Description |
---|---|---|
certificate_id | string (uuid) | A unique identifier for a certificate. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6) |
name | string | Name of expected certificate (example: certificate-name) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT
examples
- certificates_get
- certificates_list
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;
To list all of the certificates available on your account, send a GET request to /v2/certificates
.
SELECT
id,
name,
created_at,
dns_names,
not_after,
sha1_fingerprint,
state,
type
FROM digitalocean.compute.certificates
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND name = '{{ name }}';
INSERT
examples
- certificates_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: certificates
props:
DELETE
examples
- certificates_delete
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;