Skip to main content

content

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

Overview

Namecontent
TypeResource
Idcloudflare.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:

NameAccessible byRequired ParamsOptional ParamsDescription
worker_environment_put_script_contentreplaceaccount_id, service_name, environment_name, metadataCF-WORKER-BODY-PART, CF-WORKER-MAIN-MODULE-PARTPut script content from a worker with an environment.
updatereplaceaccount_id, script_name, metadataCF-WORKER-BODY-PART, CF-WORKER-MAIN-MODULE-PARTPut 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
environment_namestringThe Worker service environment name.
script_namestringThe Worker script name.
service_namestringThe Worker service name.
CF-WORKER-BODY-PARTstringThe 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-PARTstringThe multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.

REPLACE examples

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;