Skip to main content

usage_model

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

Overview

Nameusage_model
TypeResource
Idcloudflare.workers.usage_model

Fields

The following fields are returned by SELECT queries:

Fetch Usage Model response.

NameDatatypeDescription
usage_modelstringUsage model for the Worker invocations. (standard, bundled, unbound) (default: standard, example: standard)
user_limitsobjectUser-defined resource limits for Workers with standard usage model.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, script_nameFetches the Usage Model for a given Worker.
worker_script_update_usage_modelreplaceaccount_id, script_nameUpdates the Usage Model for a given Worker. Requires a Workers Paid subscription.

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.
script_namestringThe Worker script name.

SELECT examples

Fetches the Usage Model for a given Worker.

SELECT
usage_model,
user_limits
FROM cloudflare.workers.usage_model
WHERE account_id = '{{ account_id }}' -- required
AND script_name = '{{ script_name }}' -- required
;

REPLACE examples

Updates the Usage Model for a given Worker. Requires a Workers Paid subscription.

REPLACE cloudflare.workers.usage_model
SET
usage_model = '{{ usage_model }}',
user_limits = '{{ user_limits }}'
WHERE
account_id = '{{ account_id }}' --required
AND script_name = '{{ script_name }}' --required
RETURNING
errors,
messages,
result,
success;