namespaces
Creates, updates, deletes, gets or lists a namespaces resource.
Overview
| Name | namespaces |
| Type | Resource |
| Id | cloudflare.workers_for_platforms.namespaces |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a Workers for Platforms namespace.
| Name | Datatype | Description |
|---|---|---|
namespace_id | string | API Resource UUID tag. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
namespace_name | string | Name of the Workers for Platforms dispatch namespace. (example: my-dispatch-namespace) |
created_by | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
created_on | string (date-time) | When the script was created. (example: 2017-01-01T00:00:00Z) |
modified_by | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
modified_on | string (date-time) | When the script was last modified. (example: 2017-01-01T00:00:00Z) |
script_count | integer | The current number of scripts in this Dispatch Namespace. |
trusted_workers | boolean | Whether the Workers in the namespace are executed in a "trusted" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the request.cf object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and request.cf is undefined. By default, Workers in a namespace are "untrusted". |
Fetch a list of Workers for Platforms namespaces.
| Name | Datatype | Description |
|---|---|---|
namespace_id | string | API Resource UUID tag. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
namespace_name | string | Name of the Workers for Platforms dispatch namespace. (example: my-dispatch-namespace) |
created_by | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
created_on | string (date-time) | When the script was created. (example: 2017-01-01T00:00:00Z) |
modified_by | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
modified_on | string (date-time) | When the script was last modified. (example: 2017-01-01T00:00:00Z) |
script_count | integer | The current number of scripts in this Dispatch Namespace. |
trusted_workers | boolean | Whether the Workers in the namespace are executed in a "trusted" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the request.cf object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and request.cf is undefined. By default, Workers in a namespace are "untrusted". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, dispatch_namespace | Get a Workers for Platforms namespace. | |
list | select | account_id | Fetch a list of Workers for Platforms namespaces. | |
create | insert | account_id | Create a new Workers for Platforms namespace. | |
namespace_worker_patch_namespace | update | account_id, dispatch_namespace | Patch a Workers for Platforms namespace. Omitted fields are left unchanged. | |
namespace_worker_put_namespace | replace | account_id, dispatch_namespace | Update a Workers for Platforms namespace. | |
delete | delete | account_id, dispatch_namespace | Delete a Workers for Platforms namespace. |
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. |
dispatch_namespace | string | The Workers-for-Platforms dispatch namespace. |
SELECT examples
- get
- list
Get a Workers for Platforms namespace.
SELECT
namespace_id,
namespace_name,
created_by,
created_on,
modified_by,
modified_on,
script_count,
trusted_workers
FROM cloudflare.workers_for_platforms.namespaces
WHERE account_id = '{{ account_id }}' -- required
AND dispatch_namespace = '{{ dispatch_namespace }}' -- required
;
Fetch a list of Workers for Platforms namespaces.
SELECT
namespace_id,
namespace_name,
created_by,
created_on,
modified_by,
modified_on,
script_count,
trusted_workers
FROM cloudflare.workers_for_platforms.namespaces
WHERE account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Create a new Workers for Platforms namespace.
INSERT INTO cloudflare.workers_for_platforms.namespaces (
name,
account_id
)
SELECT
'{{ name }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: namespaces
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the namespaces resource.
- name: name
value: "{{ name }}"
description: |
The name of the dispatch namespace.
UPDATE examples
- namespace_worker_patch_namespace
Patch a Workers for Platforms namespace. Omitted fields are left unchanged.
UPDATE cloudflare.workers_for_platforms.namespaces
SET
name = '{{ name }}',
trusted_workers = {{ trusted_workers }}
WHERE
account_id = '{{ account_id }}' --required
AND dispatch_namespace = '{{ dispatch_namespace }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- namespace_worker_put_namespace
Update a Workers for Platforms namespace.
REPLACE cloudflare.workers_for_platforms.namespaces
SET
name = '{{ name }}',
trusted_workers = {{ trusted_workers }}
WHERE
account_id = '{{ account_id }}' --required
AND dispatch_namespace = '{{ dispatch_namespace }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Delete a Workers for Platforms namespace.
DELETE FROM cloudflare.workers_for_platforms.namespaces
WHERE account_id = '{{ account_id }}' --required
AND dispatch_namespace = '{{ dispatch_namespace }}' --required
;