Get Settings
workers.scripts.script_and_version_settings.get(strscript_name, ScriptAndVersionSettingGetParams**kwargs) -> ScriptAndVersionSettingGetResponse
GET/accounts/{account_id}/workers/scripts/{script_name}/settings
Get metadata and config, such as bindings or usage model.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Parameters
Get Settings
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
script_and_version_setting = client.workers.scripts.script_and_version_settings.get(
script_name="this-is_my_script-01",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(script_and_version_setting.annotations){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"annotations": {
"workers/message": "Fixed bug.",
"workers/tag": "v1.0.1",
"workers/triggered_by": "upload"
},
"bindings": [
{
"name": "MY_ENV_VAR",
"text": "my_data",
"type": "plain_text"
}
],
"compatibility_date": "2021-01-01",
"compatibility_flags": [
"nodejs_compat"
],
"limits": {
"cpu_ms": 50
},
"logpush": false,
"observability": {
"enabled": true,
"head_sampling_rate": 0.1,
"logs": {
"enabled": true,
"invocation_logs": true,
"destinations": [
"cloudflare"
],
"head_sampling_rate": 0.1,
"persist": true
},
"traces": {
"destinations": [
"cloudflare"
],
"enabled": true,
"head_sampling_rate": 0.1,
"persist": true
}
},
"placement": {
"mode": "smart"
},
"tags": [
"my-team",
"my-public-api"
],
"tail_consumers": [
{
"service": "my-log-consumer",
"environment": "production",
"namespace": "my-namespace"
}
],
"usage_model": "standard"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"annotations": {
"workers/message": "Fixed bug.",
"workers/tag": "v1.0.1",
"workers/triggered_by": "upload"
},
"bindings": [
{
"name": "MY_ENV_VAR",
"text": "my_data",
"type": "plain_text"
}
],
"compatibility_date": "2021-01-01",
"compatibility_flags": [
"nodejs_compat"
],
"limits": {
"cpu_ms": 50
},
"logpush": false,
"observability": {
"enabled": true,
"head_sampling_rate": 0.1,
"logs": {
"enabled": true,
"invocation_logs": true,
"destinations": [
"cloudflare"
],
"head_sampling_rate": 0.1,
"persist": true
},
"traces": {
"destinations": [
"cloudflare"
],
"enabled": true,
"head_sampling_rate": 0.1,
"persist": true
}
},
"placement": {
"mode": "smart"
},
"tags": [
"my-team",
"my-public-api"
],
"tail_consumers": [
{
"service": "my-log-consumer",
"environment": "production",
"namespace": "my-namespace"
}
],
"usage_model": "standard"
},
"success": true
}