Skip to main content

certificates

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

Overview

Namecertificates
TypeResource
Idcloudflare.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:

NameAccessible byRequired ParamsOptional ParamsDescription
updatereplacecustom_hostname_id, certificate_pack_id, certificate_id, zone_id, custom_certificate, custom_keyReplace 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.
deletedeletecustom_hostname_id, certificate_pack_id, certificate_id, zone_idDelete 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.

NameDatatypeDescription
certificate_idstringThe certificate ID.
certificate_pack_idstring
custom_hostname_idstring
zone_idstringThe Cloudflare zone ID.

REPLACE examples

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 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
;