domains
Creates, updates, deletes, gets or lists a domains resource.
Overview
| Name | domains |
| Type | Resource |
| Id | cloudflare.pages.domains |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get domain response.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | The domain name. (example: this-is-my-domain-01.com) |
domain_id | string | |
certificate_authority | string | (google, lets_encrypt) (example: lets_encrypt) |
created_on | string | |
status | string | (initializing, pending, active, deactivated, blocked, error) |
validation_data | object | |
verification_data | object | |
zone_tag | string |
Get domains response.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | The domain name. (example: this-is-my-domain-01.com) |
domain_id | string | |
certificate_authority | string | (google, lets_encrypt) (example: lets_encrypt) |
created_on | string | |
status | string | (initializing, pending, active, deactivated, blocked, error) |
validation_data | object | |
verification_data | object | |
zone_tag | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | domain_name, project_name, account_id | Fetch a single domain. | |
list | select | project_name, account_id | Fetch a list of all domains associated with a Pages project. | |
create | insert | project_name, account_id, name | Add a new domain for the Pages project. | |
edit | update | domain_name, project_name, account_id | Retry the validation status of a single domain. | |
delete | delete | domain_name, project_name, account_id | Delete a Pages project's domain. |
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 |
|---|---|---|
account_id | string | The Cloudflare account ID. |
domain_name | string | |
project_name | string | The Pages project name. |
SELECT examples
- get
- list
Fetch a single domain.
SELECT
id,
name,
domain_id,
certificate_authority,
created_on,
status,
validation_data,
verification_data,
zone_tag
FROM cloudflare.pages.domains
WHERE domain_name = '{{ domain_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Fetch a list of all domains associated with a Pages project.
SELECT
id,
name,
domain_id,
certificate_authority,
created_on,
status,
validation_data,
verification_data,
zone_tag
FROM cloudflare.pages.domains
WHERE project_name = '{{ project_name }}' -- required
AND account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Add a new domain for the Pages project.
INSERT INTO cloudflare.pages.domains (
name,
project_name,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ project_name }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: domains
props:
- name: project_name
value: "{{ project_name }}"
description: Required parameter for the domains resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the domains resource.
- name: name
value: "{{ name }}"
description: |
The domain name.
UPDATE examples
- edit
Retry the validation status of a single domain.
UPDATE cloudflare.pages.domains
SET
-- No updatable properties
WHERE
domain_name = '{{ domain_name }}' --required
AND project_name = '{{ project_name }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Delete a Pages project's domain.
DELETE FROM cloudflare.pages.domains
WHERE domain_name = '{{ domain_name }}' --required
AND project_name = '{{ project_name }}' --required
AND account_id = '{{ account_id }}' --required
;