settings
Creates, updates, deletes, gets or lists a settings resource.
Overview
| Name | settings |
| Type | Resource |
| Id | cloudflare.workers_for_platforms.settings |
Fields
The following fields are returned by SELECT queries:
- list
Fetch script settings.
| Name | Datatype | Description |
|---|---|---|
bindings | array | List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. |
compatibility_date | string | Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker. (example: 2021-01-01, default: ) |
compatibility_flags | array | Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date. (x-stainless-collection-type: set) |
limits | object | Limits to apply for this Worker. |
logpush | boolean | Whether Logpush is turned on for the Worker. |
migrations | object | Migrations to apply for Durable Objects associated with this Worker. |
observability | object | Observability settings for the Worker. |
placement | object | Configuration for Smart Placement. Specify mode='smart' for Smart Placement, or one of region/hostname/host. |
tags | array | Tags associated with the Worker. (x-stainless-collection-type: set) |
tail_consumers | array | List of Workers that will consume logs from the attached Worker. (x-stainless-collection-type: set) |
usage_model | string | Usage model for the Worker invocations. (standard, bundled, unbound) (default: standard, example: standard) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, dispatch_namespace, script_name | Get script settings from a script uploaded to a Workers for Platforms namespace. | |
edit | update | account_id, dispatch_namespace, script_name | Patch script metadata, such as bindings. |
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. |
script_name | string | The Worker script name. |
SELECT examples
- list
Get script settings from a script uploaded to a Workers for Platforms namespace.
SELECT
bindings,
compatibility_date,
compatibility_flags,
limits,
logpush,
migrations,
observability,
placement,
tags,
tail_consumers,
usage_model
FROM cloudflare.workers_for_platforms.settings
WHERE account_id = '{{ account_id }}' -- required
AND dispatch_namespace = '{{ dispatch_namespace }}' -- required
AND script_name = '{{ script_name }}' -- required
;
UPDATE examples
- edit
Patch script metadata, such as bindings.
UPDATE cloudflare.workers_for_platforms.settings
SET
settings = '{{ settings }}'
WHERE
account_id = '{{ account_id }}' --required
AND dispatch_namespace = '{{ dispatch_namespace }}' --required
AND script_name = '{{ script_name }}' --required
RETURNING
errors,
messages,
result,
success;