Skip to main content

api_gateway_operations

Creates, updates, deletes, gets or lists an api_gateway_operations resource.

Overview

Nameapi_gateway_operations
TypeResource
Idcloudflare.api_gateway.api_gateway_operations

Fields

The following fields are returned by SELECT queries:

Retrieve information about all operations on a zone response

NameDatatypeDescription
operation_idstringUUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
endpointstring (uri-template)The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. (example: /api/v1/users/{var1})
featuresobject
hoststring (hostname)RFC3986-compliant host. (example: www.example.com)
last_updatedstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
methodstringThe HTTP method used to access the endpoint. (GET, POST, HEAD, OPTIONS, PUT, DELETE, CONNECT, PATCH, TRACE) (example: GET)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectzone_idpage, per_page, order, direction, host, method, endpoint, featureLists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations.
api_shield_endpoint_management_add_operations_to_a_zoneinsertzone_idAdd one or more operations to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date.

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
zone_idstringThe Cloudflare zone ID.
directionstring
endpointstring
featurearrayAdd feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.
hostarray
methodarray
orderstring
pageintegerPage number of paginated results.
per_pageintegerMaximum number of results per page.

SELECT examples

Lists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations.

SELECT
operation_id,
endpoint,
features,
host,
last_updated,
method
FROM cloudflare.api_gateway.api_gateway_operations
WHERE zone_id = '{{ zone_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
AND host = '{{ host }}'
AND method = '{{ method }}'
AND endpoint = '{{ endpoint }}'
AND feature = '{{ feature }}'
;

INSERT examples

Add one or more operations to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date.

INSERT INTO cloudflare.api_gateway.api_gateway_operations (
zone_id
)
SELECT
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;