Update a Gateway
ai_gateway.update(strid, AIGatewayUpdateParams**kwargs) -> AIGatewayUpdateResponse
PUT/accounts/{account_id}/ai-gateway/gateways/{id}
Updates an existing AI Gateway dataset.
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)
Update a Gateway
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
ai_gateway = client.ai_gateway.update(
id="my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
rate_limiting_interval=0,
rate_limiting_limit=0,
)
print(ai_gateway.id){
"result": {
"id": "my-gateway",
"cache_invalidate_on_update": true,
"cache_ttl": 0,
"collect_logs": true,
"created_at": "2019-12-27T18:11:19.117Z",
"modified_at": "2019-12-27T18:11:19.117Z",
"rate_limiting_interval": 0,
"rate_limiting_limit": 0,
"authentication": true,
"dlp": {
"action": "BLOCK",
"enabled": true,
"profiles": [
"string"
]
},
"is_default": true,
"log_management": 10000,
"log_management_strategy": "STOP_INSERTING",
"logpush": true,
"logpush_public_key": "xxxxxxxxxxxxxxxx",
"otel": [
{
"authorization": "authorization",
"headers": {
"foo": "string"
},
"url": "url",
"content_type": "json"
}
],
"rate_limiting_technique": "fixed",
"retry_backoff": "constant",
"retry_delay": 0,
"retry_max_attempts": 1,
"store_id": "store_id",
"stripe": {
"authorization": "authorization",
"usage_events": [
{
"payload": "payload"
}
]
},
"workers_ai_billing_mode": "postpaid",
"zdr": true
},
"success": true
}Returns Examples
{
"result": {
"id": "my-gateway",
"cache_invalidate_on_update": true,
"cache_ttl": 0,
"collect_logs": true,
"created_at": "2019-12-27T18:11:19.117Z",
"modified_at": "2019-12-27T18:11:19.117Z",
"rate_limiting_interval": 0,
"rate_limiting_limit": 0,
"authentication": true,
"dlp": {
"action": "BLOCK",
"enabled": true,
"profiles": [
"string"
]
},
"is_default": true,
"log_management": 10000,
"log_management_strategy": "STOP_INSERTING",
"logpush": true,
"logpush_public_key": "xxxxxxxxxxxxxxxx",
"otel": [
{
"authorization": "authorization",
"headers": {
"foo": "string"
},
"url": "url",
"content_type": "json"
}
],
"rate_limiting_technique": "fixed",
"retry_backoff": "constant",
"retry_delay": 0,
"retry_max_attempts": 1,
"store_id": "store_id",
"stripe": {
"authorization": "authorization",
"usage_events": [
{
"payload": "payload"
}
]
},
"workers_ai_billing_mode": "postpaid",
"zdr": true
},
"success": true
}