Skip to main content

resources

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

Overview

Nameresources
TypeResource
Idcloudflare.resource_sharing.resources

Fields

The following fields are returned by SELECT queries:

Get account share resource response.

NameDatatypeDescription
idstringShare Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
resource_account_idstringAccount identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
resource_idstringShare Resource identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
createdstring (date-time)When the share was created. (example: 2023-09-21T18:56:32.624632Z)
metaobjectResource Metadata.
modifiedstring (date-time)When the share was modified. (example: 2023-09-21T18:56:32.624632Z)
resource_typestringResource Type. (custom-ruleset, gateway-policy, gateway-destination-ip, gateway-block-page-settings, gateway-extended-email-matching)
resource_versionintegerResource Version.
statusstringResource Status. (active, deleting, deleted)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, share_id, resource_idGet share resource by ID.
listselectaccount_id, share_idstatus, resource_type, page, per_pageList share resources by share ID.
createinsertaccount_id, share_id, resource_id, resource_type, resource_account_id, metaAdds a resource to an existing share, making it available to share recipients.
updatereplaceaccount_id, share_id, resource_id, metaUpdate is not immediate, an updated share resource object with a new status will be returned.
deletedeleteaccount_id, share_id, resource_idDeletion 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
resource_idstring
share_idstring
pageintegerPage number.
per_pageintegerNumber of objects to return per page.
resource_typestringFilter share resources by resource_type.
statusstringFilter share resources by status.

SELECT examples

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
;

INSERT examples

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
;

REPLACE examples

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

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
;