operations
Creates, updates, deletes, gets or lists an operations resource.
Overview
| Name | operations |
| Type | Resource |
| Id | cloudflare.api_gateway.operations |
Fields
The following fields are returned by SELECT queries:
- get
- list
Retrieve information about an operation response
| Name | Datatype | Description |
|---|---|---|
operation_id | string | UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
endpoint | string (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}) |
features | object | |
host | string (hostname) | RFC3986-compliant host. (example: www.example.com) |
last_updated | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
method | string | The HTTP method used to access the endpoint. (GET, POST, HEAD, OPTIONS, PUT, DELETE, CONNECT, PATCH, TRACE) (example: GET) |
schemas | object | OpenAPI JSON schemas for an operation, including both user-uploaded and Cloudflare-learned schemas. |
Retrieve all operations from a schema response
| Name | Datatype | Description |
|---|---|---|
operation_id | string | UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
endpoint | string (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}) |
features | object | |
host | string (hostname) | RFC3986-compliant host. (example: www.example.com) |
last_updated | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
method | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | zone_id, operation_id | feature, with_schemas | Gets detailed information about a specific API operation in API Shield, including its schema validation settings and traffic statistics. |
list | select | schema_id, zone_id | feature, host, method, endpoint, page, per_page, operation_status | Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations. |
api_shield_api_patch_discovered_operation | update | zone_id, operation_id | Update the state on a discovered operation | |
bulk_edit | update | zone_id | Update the state on one or more discovered operations | |
delete | delete | zone_id, operation_id | Removes a single API operation from API Shield endpoint management. The operation will no longer be tracked or protected by API Shield rules. | |
bulk_delete | delete | zone_id | Bulk removes multiple API operations from API Shield endpoint management in a single request. Efficient for cleaning up unused endpoints. |
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 |
|---|---|---|
operation_id | string | Identifier for the operation |
schema_id | string (uuid) | Identifier for the schema-ID |
zone_id | string | The Cloudflare zone ID. |
endpoint | string | |
feature | array | Add 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. |
host | array | |
method | array | |
operation_status | string | Filter results by whether operations exist in API Shield Endpoint Management or not. new will just return operations from the schema that do not exist in API Shield Endpoint Management. existing will just return operations from the schema that already exist in API Shield Endpoint Management. |
page | integer | Page number of paginated results. |
per_page | integer | Maximum number of results per page. |
with_schemas | boolean | When true, includes OpenAPI schemas (both uploaded and learned) for the operation in the response. Due to the conversion overhead, this parameter is only supported on single-operation retrieval. |
SELECT examples
- get
- list
Gets detailed information about a specific API operation in API Shield, including its schema validation settings and traffic statistics.
SELECT
operation_id,
endpoint,
features,
host,
last_updated,
method,
schemas
FROM cloudflare.api_gateway.operations
WHERE zone_id = '{{ zone_id }}' -- required
AND operation_id = '{{ operation_id }}' -- required
AND feature = '{{ feature }}'
AND with_schemas = '{{ with_schemas }}'
;
Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.
SELECT
operation_id,
endpoint,
features,
host,
last_updated,
method
FROM cloudflare.api_gateway.operations
WHERE schema_id = '{{ schema_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
AND feature = '{{ feature }}'
AND host = '{{ host }}'
AND method = '{{ method }}'
AND endpoint = '{{ endpoint }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND operation_status = '{{ operation_status }}'
;
UPDATE examples
- api_shield_api_patch_discovered_operation
- bulk_edit
Update the state on a discovered operation
UPDATE cloudflare.api_gateway.operations
SET
state = '{{ state }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND operation_id = '{{ operation_id }}' --required
RETURNING
errors,
messages,
result,
success;
Update the state on one or more discovered operations
UPDATE cloudflare.api_gateway.operations
SET
-- No updatable properties
WHERE
zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
- bulk_delete
Removes a single API operation from API Shield endpoint management. The operation will no longer be tracked or protected by API Shield rules.
DELETE FROM cloudflare.api_gateway.operations
WHERE zone_id = '{{ zone_id }}' --required
AND operation_id = '{{ operation_id }}' --required
;
Bulk removes multiple API operations from API Shield endpoint management in a single request. Efficient for cleaning up unused endpoints.
DELETE FROM cloudflare.api_gateway.operations
WHERE zone_id = '{{ zone_id }}' --required
;