script_and_version_settings
Creates, updates, deletes, gets or lists a script_and_version_settings resource.
Overview
| Name | script_and_version_settings |
| Type | Resource |
| Id | cloudflare.workers.script_and_version_settings |
Fields
The following fields are returned by SELECT queries:
- list
Fetch settings.
| Name | Datatype | Description |
|---|---|---|
annotations | object | Annotations for the Worker version. Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations. |
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, script_name | Get metadata and config, such as bindings or usage model. | |
edit | update | account_id, script_name | Patch metadata or config, such as bindings or usage model. |
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. |
script_name | string | The Worker script name. |
SELECT examples
- list
Get metadata and config, such as bindings or usage model.
SELECT
annotations,
bindings,
compatibility_date,
compatibility_flags,
limits,
logpush,
migrations,
observability,
placement,
tags,
tail_consumers,
usage_model
FROM cloudflare.workers.script_and_version_settings
WHERE account_id = '{{ account_id }}' -- required
AND script_name = '{{ script_name }}' -- required
;
UPDATE examples
- edit
Patch metadata or config, such as bindings or usage model.
UPDATE cloudflare.workers.script_and_version_settings
SET
settings = '{{ settings }}'
WHERE
account_id = '{{ account_id }}' --required
AND script_name = '{{ script_name }}' --required
RETURNING
errors,
messages,
result,
success;