certificates
Creates, updates, deletes, gets or lists a certificates resource.
Overview
| Name | certificates |
| Type | Resource |
| Id | cloudflare.custom_hostnames.certificates |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
update | replace | custom_hostname_id, certificate_pack_id, certificate_id, zone_id, custom_certificate, custom_key | Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate. | |
delete | delete | custom_hostname_id, certificate_pack_id, certificate_id, zone_id | Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack. |
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 | The certificate ID. |
certificate_pack_id | string | |
custom_hostname_id | string | |
zone_id | string | The Cloudflare zone ID. |
REPLACE examples
- update
Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.
REPLACE cloudflare.custom_hostnames.certificates
SET
custom_certificate = '{{ custom_certificate }}',
custom_key = '{{ custom_key }}'
WHERE
custom_hostname_id = '{{ custom_hostname_id }}' --required
AND certificate_pack_id = '{{ certificate_pack_id }}' --required
AND certificate_id = '{{ certificate_id }}' --required
AND zone_id = '{{ zone_id }}' --required
AND custom_certificate = '{{ custom_certificate }}' --required
AND custom_key = '{{ custom_key }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.
DELETE FROM cloudflare.custom_hostnames.certificates
WHERE custom_hostname_id = '{{ custom_hostname_id }}' --required
AND certificate_pack_id = '{{ certificate_pack_id }}' --required
AND certificate_id = '{{ certificate_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;