Skip to main content

contents

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

Overview

Namecontents
TypeResource
Idcloudflare.workers.contents

Fields

The following fields are returned by SELECT queries:

Get script content.

NameDatatypeDescription
contentsstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, service_name, environment_nameGet script content from a worker with an environment.

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.
service_namestringThe Worker service name.

SELECT examples

Get script content from a worker with an environment.

SELECT
contents
FROM cloudflare.workers.contents
WHERE account_id = '{{ account_id }}' -- required
AND service_name = '{{ service_name }}' -- required
AND environment_name = '{{ environment_name }}' -- required
;