content
Creates, updates, deletes, gets or lists a content resource.
Overview
| Name | content |
| Type | Resource |
| Id | cloudflare.workers.content |
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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
worker_environment_put_script_content | replace | account_id, service_name, environment_name, metadata | CF-WORKER-BODY-PART, CF-WORKER-MAIN-MODULE-PART | Put script content from a worker with an environment. |
update | replace | account_id, script_name, metadata | CF-WORKER-BODY-PART, CF-WORKER-MAIN-MODULE-PART | Put script content without touching config or metadata. |
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. |
environment_name | string | The Worker service environment name. |
script_name | string | The Worker script name. |
service_name | string | The Worker service name. |
CF-WORKER-BODY-PART | string | The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part. |
CF-WORKER-MAIN-MODULE-PART | string | The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part. |
REPLACE examples
- worker_environment_put_script_content
- update
Put script content from a worker with an environment.
REPLACE cloudflare.workers.content
SET
files = '{{ files }}',
metadata = '{{ metadata }}'
WHERE
account_id = '{{ account_id }}' --required
AND service_name = '{{ service_name }}' --required
AND environment_name = '{{ environment_name }}' --required
AND metadata = '{{ metadata }}' --required
AND CF-WORKER-BODY-PART = '{{ CF-WORKER-BODY-PART}}'
AND CF-WORKER-MAIN-MODULE-PART = '{{ CF-WORKER-MAIN-MODULE-PART}}'
RETURNING
errors,
messages,
result,
success;
Put script content without touching config or metadata.
REPLACE cloudflare.workers.content
SET
files = '{{ files }}',
metadata = '{{ metadata }}'
WHERE
account_id = '{{ account_id }}' --required
AND script_name = '{{ script_name }}' --required
AND metadata = '{{ metadata }}' --required
AND CF-WORKER-BODY-PART = '{{ CF-WORKER-BODY-PART}}'
AND CF-WORKER-MAIN-MODULE-PART = '{{ CF-WORKER-MAIN-MODULE-PART}}'
RETURNING
errors,
messages,
result,
success;