resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | cloudflare.resource_sharing.resources |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get account share resource response.
| Name | Datatype | Description |
|---|---|---|
id | string | Share Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
resource_account_id | string | Account identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
resource_id | string | Share Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | When the share was created. (example: 2023-09-21T18:56:32.624632Z) |
meta | object | Resource Metadata. |
modified | string (date-time) | When the share was modified. (example: 2023-09-21T18:56:32.624632Z) |
resource_type | string | Resource Type. (custom-ruleset, gateway-policy, gateway-destination-ip, gateway-block-page-settings, gateway-extended-email-matching) |
resource_version | integer | Resource Version. |
status | string | Resource Status. (active, deleting, deleted) |
List account share resources response.
| Name | Datatype | Description |
|---|---|---|
id | string | Share Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
resource_account_id | string | Account identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
resource_id | string | Share Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | When the share was created. (example: 2023-09-21T18:56:32.624632Z) |
meta | object | Resource Metadata. |
modified | string (date-time) | When the share was modified. (example: 2023-09-21T18:56:32.624632Z) |
resource_type | string | Resource Type. (custom-ruleset, gateway-policy, gateway-destination-ip, gateway-block-page-settings, gateway-extended-email-matching) |
resource_version | integer | Resource Version. |
status | string | Resource Status. (active, deleting, deleted) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, share_id, resource_id | Get share resource by ID. | |
list | select | account_id, share_id | status, resource_type, page, per_page | List share resources by share ID. |
create | insert | account_id, share_id, resource_id, resource_type, resource_account_id, meta | Adds a resource to an existing share, making it available to share recipients. | |
update | replace | account_id, share_id, resource_id, meta | Update is not immediate, an updated share resource object with a new status will be returned. | |
delete | delete | account_id, share_id, resource_id | Deletion is not immediate, an updated share resource object with a new status will be returned. |
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. |
resource_id | string | |
share_id | string | |
page | integer | Page number. |
per_page | integer | Number of objects to return per page. |
resource_type | string | Filter share resources by resource_type. |
status | string | Filter share resources by status. |
SELECT examples
- get
- list
Get share resource by ID.
SELECT
id,
resource_account_id,
resource_id,
created,
meta,
modified,
resource_type,
resource_version,
status
FROM cloudflare.resource_sharing.resources
WHERE account_id = '{{ account_id }}' -- required
AND share_id = '{{ share_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
;
List share resources by share ID.
SELECT
id,
resource_account_id,
resource_id,
created,
meta,
modified,
resource_type,
resource_version,
status
FROM cloudflare.resource_sharing.resources
WHERE account_id = '{{ account_id }}' -- required
AND share_id = '{{ share_id }}' -- required
AND status = '{{ status }}'
AND resource_type = '{{ resource_type }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- create
- Manifest
Adds a resource to an existing share, making it available to share recipients.
INSERT INTO cloudflare.resource_sharing.resources (
meta,
resource_account_id,
resource_id,
resource_type,
account_id,
share_id
)
SELECT
'{{ meta }}' /* required */,
'{{ resource_account_id }}' /* required */,
'{{ resource_id }}' /* required */,
'{{ resource_type }}' /* required */,
'{{ account_id }}',
'{{ share_id }}'
RETURNING
errors,
result,
success
;
# Description fields are for documentation purposes
- name: resources
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the resources resource.
- name: share_id
value: "{{ share_id }}"
description: Required parameter for the resources resource.
- name: meta
value: "{{ meta }}"
description: |
Resource Metadata.
- name: resource_account_id
value: "{{ resource_account_id }}"
description: |
Account identifier.
- name: resource_id
value: "{{ resource_id }}"
description: |
Share Resource identifier.
- name: resource_type
value: "{{ resource_type }}"
description: |
Resource Type.
valid_values: ['custom-ruleset', 'gateway-policy', 'gateway-destination-ip', 'gateway-block-page-settings', 'gateway-extended-email-matching']
REPLACE examples
- update
Update is not immediate, an updated share resource object with a new status will be returned.
REPLACE cloudflare.resource_sharing.resources
SET
meta = '{{ meta }}'
WHERE
account_id = '{{ account_id }}' --required
AND share_id = '{{ share_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND meta = '{{ meta }}' --required
RETURNING
errors,
result,
success;
DELETE examples
- delete
Deletion is not immediate, an updated share resource object with a new status will be returned.
DELETE FROM cloudflare.resource_sharing.resources
WHERE account_id = '{{ account_id }}' --required
AND share_id = '{{ share_id }}' --required
AND resource_id = '{{ resource_id }}' --required
;