# Operations ## Retrieve information about all operations on a zone `api_gateway.operations.list(OperationListParams**kwargs) -> SyncV4PagePaginationArray[OperationListResponse]` **get** `/zones/{zone_id}/api_gateway/operations` Lists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations. ### Parameters - `zone_id: str` Identifier. - `direction: Optional[Literal["asc", "desc"]]` Direction to order results. - `"asc"` - `"desc"` - `endpoint: Optional[str]` Filter results to only include endpoints containing this pattern. - `feature: Optional[List[Literal["thresholds", "parameter_schemas", "schema_info"]]]` 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. - `"thresholds"` - `"parameter_schemas"` - `"schema_info"` - `host: Optional[SequenceNotStr[str]]` Filter results to only include the specified hosts. - `method: Optional[SequenceNotStr[str]]` Filter results to only include the specified HTTP methods. - `order: Optional[Literal["method", "host", "endpoint", "thresholds.$key"]]` Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`. - `"method"` - `"host"` - `"endpoint"` - `"thresholds.$key"` - `page: Optional[int]` Page number of paginated results. - `per_page: Optional[int]` Maximum number of results per page. ### Returns - `class OperationListResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.api_gateway.operations.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "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": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Retrieve information about an operation `api_gateway.operations.get(stroperation_id, OperationGetParams**kwargs) -> OperationGetResponse` **get** `/zones/{zone_id}/api_gateway/operations/{operation_id}` Gets detailed information about a specific API operation in API Shield, including its schema validation settings and traffic statistics. ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. - `feature: Optional[List[Literal["thresholds", "parameter_schemas", "schema_info"]]]` 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. - `"thresholds"` - `"parameter_schemas"` - `"schema_info"` ### Returns - `class OperationGetResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(operation.operation_id) ``` #### Response ```json { "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": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } }, "success": true } ``` ## Add one operation to a zone `api_gateway.operations.create(OperationCreateParams**kwargs) -> OperationCreateResponse` **post** `/zones/{zone_id}/api_gateway/operations/item` Add one operation 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 - `zone_id: str` Identifier. - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` ### Returns - `class OperationCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.api_gateway.operations.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", ) print(operation.operation_id) ``` #### Response ```json { "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": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } }, "success": true } ``` ## Delete an operation `api_gateway.operations.delete(stroperation_id, OperationDeleteParams**kwargs) -> OperationDeleteResponse` **delete** `/zones/{zone_id}/api_gateway/operations/{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. ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. ### Returns - `class OperationDeleteResponse: …` - `errors: Message` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageItemSource]` - `pointer: Optional[str]` - `messages: Message` - `success: Literal[true]` Whether the API call was successful. - `true` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.api_gateway.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(operation.errors) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Add operations to a zone `api_gateway.operations.bulk_create(OperationBulkCreateParams**kwargs) -> SyncSinglePage[OperationBulkCreateResponse]` **post** `/zones/{zone_id}/api_gateway/operations` 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. ### Parameters - `zone_id: str` Identifier. - `body: Iterable[Body]` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` ### Returns - `class OperationBulkCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.api_gateway.operations.bulk_create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[{ "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "method": "GET", }], ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "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": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } } ], "success": true } ``` ## Delete multiple operations `api_gateway.operations.bulk_delete(OperationBulkDeleteParams**kwargs) -> OperationBulkDeleteResponse` **delete** `/zones/{zone_id}/api_gateway/operations` Bulk removes multiple API operations from API Shield endpoint management in a single request. Efficient for cleaning up unused endpoints. ### Parameters - `zone_id: str` Identifier. ### Returns - `class OperationBulkDeleteResponse: …` - `errors: Message` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageItemSource]` - `pointer: Optional[str]` - `messages: Message` - `success: Literal[true]` Whether the API call was successful. - `true` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.api_gateway.operations.bulk_delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.errors) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Domain Types ### API Shield - `class APIShield: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. ### Operation List Response - `class OperationListResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Operation Get Response - `class OperationGetResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Operation Create Response - `class OperationCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Operation Delete Response - `class OperationDeleteResponse: …` - `errors: Message` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageItemSource]` - `pointer: Optional[str]` - `messages: Message` - `success: Literal[true]` Whether the API call was successful. - `true` ### Operation Bulk Create Response - `class OperationBulkCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `features: Optional[Features]` - `class FeaturesAPIShieldOperationFeatureThresholds: …` - `thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds]` - `auth_id_tokens: Optional[int]` The total number of auth-ids seen across this calculation. - `data_points: Optional[int]` The number of data points used for the threshold suggestion calculation. - `last_updated: Optional[datetime]` - `p50: Optional[int]` The p50 quantile of requests (in period_seconds). - `p90: Optional[int]` The p90 quantile of requests (in period_seconds). - `p99: Optional[int]` The p99 quantile of requests (in period_seconds). - `period_seconds: Optional[int]` The period over which this threshold is suggested. - `requests: Optional[int]` The estimated number of requests covered by these calculations. - `suggested_threshold: Optional[int]` The suggested threshold in requests done by the same auth_id or period_seconds. - `class FeaturesAPIShieldOperationFeatureParameterSchemas: …` - `parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `last_updated: Optional[datetime]` - `parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]` An operation schema object containing a response. - `parameters: Optional[List[object]]` An array containing the learned parameter schemas. - `responses: Optional[object]` An empty response object. This field is required to yield a valid operation schema. - `class FeaturesAPIShieldOperationFeatureAPIRouting: …` - `api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]` API Routing settings on endpoint. - `last_updated: Optional[datetime]` - `route: Optional[str]` Target route. - `class FeaturesAPIShieldOperationFeatureConfidenceIntervals: …` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]` - `last_updated: Optional[datetime]` - `suggested_threshold: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]` - `confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]` - `p90: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p95: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `p99: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]` Upper and lower bound for percentile estimate - `lower: Optional[float]` Lower bound for percentile estimate - `upper: Optional[float]` Upper bound for percentile estimate - `mean: Optional[float]` Suggested threshold. - `class FeaturesAPIShieldOperationFeatureSchemaInfo: …` - `schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]` - `active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]` Schema active on endpoint. - `id: Optional[str]` UUID. - `created_at: Optional[datetime]` - `is_learned: Optional[bool]` True if schema is Cloudflare-provided. - `name: Optional[str]` Schema file name. - `learned_available: Optional[bool]` True if a Cloudflare-provided learned schema is available for this endpoint. - `mitigation_action: Optional[Literal["none", "log", "block"]]` Action taken on requests failing validation. - `"none"` - `"log"` - `"block"` ### Operation Bulk Delete Response - `class OperationBulkDeleteResponse: …` - `errors: Message` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageItemSource]` - `pointer: Optional[str]` - `messages: Message` - `success: Literal[true]` Whether the API call was successful. - `true` # Labels ## Replace label(s) on an operation in endpoint management `api_gateway.operations.labels.update(stroperation_id, LabelUpdateParams**kwargs) -> LabelUpdateResponse` **put** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Replace label(s) on an operation in endpoint management ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. - `managed: Optional[SequenceNotStr[str]]` List of managed label names. Omitting this property or passing an empty array will result in all managed labels being removed from the operation - `user: Optional[SequenceNotStr[str]]` List of user label names. Omitting this property or passing an empty array will result in all user labels being removed from the operation ### Returns - `class LabelUpdateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) label = client.api_gateway.operations.labels.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(label.operation_id) ``` #### Response ```json { "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": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Attach label(s) on an operation in endpoint management `api_gateway.operations.labels.create(stroperation_id, LabelCreateParams**kwargs) -> LabelCreateResponse` **post** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Attach label(s) on an operation in endpoint management ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. - `managed: Optional[SequenceNotStr[str]]` List of managed label names. - `user: Optional[SequenceNotStr[str]]` List of user label names. ### Returns - `class LabelCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) label = client.api_gateway.operations.labels.create( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(label.operation_id) ``` #### Response ```json { "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": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Remove label(s) on an operation in endpoint management `api_gateway.operations.labels.delete(stroperation_id, LabelDeleteParams**kwargs) -> LabelDeleteResponse` **delete** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Remove label(s) on an operation in endpoint management ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. ### Returns - `class LabelDeleteResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) label = client.api_gateway.operations.labels.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(label.operation_id) ``` #### Response ```json { "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": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Bulk replace label(s) on operation(s) in endpoint management `api_gateway.operations.labels.bulk_update(LabelBulkUpdateParams**kwargs) -> SyncSinglePage[LabelBulkUpdateResponse]` **put** `/zones/{zone_id}/api_gateway/operations/labels` Bulk replace label(s) on operation(s) in endpoint management ### Parameters - `zone_id: str` Identifier. - `managed: Managed` Managed labels to replace for all affected operations - `labels: SequenceNotStr[str]` List of managed label names. Providing an empty array will result in all managed labels being removed from all affected operations - `selector: Selector` Operation IDs selector - `include: SelectorInclude` - `operation_ids: SequenceNotStr[str]` - `user: User` User labels to replace for all affected operations - `labels: SequenceNotStr[str]` List of user label names. Providing an empty array will result in all user labels being removed from all affected operations ### Returns - `class LabelBulkUpdateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.api_gateway.operations.labels.bulk_update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", managed={ "labels": ["login"] }, selector={ "include": { "operation_ids": ["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"] } }, user={ "labels": ["login"] }, ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "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": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` ## Bulk attach label(s) on operation(s) in endpoint management `api_gateway.operations.labels.bulk_create(LabelBulkCreateParams**kwargs) -> SyncSinglePage[LabelBulkCreateResponse]` **post** `/zones/{zone_id}/api_gateway/operations/labels` Bulk attach label(s) on operation(s) in endpoint management ### Parameters - `zone_id: str` Identifier. - `selector: Selector` Operation IDs selector - `include: SelectorInclude` - `operation_ids: SequenceNotStr[str]` - `managed: Optional[Managed]` - `labels: Optional[SequenceNotStr[str]]` List of managed label names. - `user: Optional[User]` - `labels: Optional[SequenceNotStr[str]]` List of user label names. ### Returns - `class LabelBulkCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.api_gateway.operations.labels.bulk_create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", selector={ "include": { "operation_ids": ["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"] } }, ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "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": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` ## Bulk remove label(s) on operation(s) in endpoint management `api_gateway.operations.labels.bulk_delete(LabelBulkDeleteParams**kwargs) -> SyncSinglePage[LabelBulkDeleteResponse]` **delete** `/zones/{zone_id}/api_gateway/operations/labels` Bulk remove label(s) on operation(s) in endpoint management ### Parameters - `zone_id: str` Identifier. ### Returns - `class LabelBulkDeleteResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.api_gateway.operations.labels.bulk_delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "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": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` ## Domain Types ### Label Update Response - `class LabelUpdateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Label Create Response - `class LabelCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Label Delete Response - `class LabelDeleteResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Label Bulk Update Response - `class LabelBulkUpdateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Label Bulk Create Response - `class LabelBulkCreateResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` ### Label Bulk Delete Response - `class LabelBulkDeleteResponse: …` - `endpoint: str` 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/. - `host: str` RFC3986-compliant host. - `last_updated: datetime` - `method: Literal["GET", "POST", "HEAD", 6 more]` The HTTP method used to access the endpoint. - `"GET"` - `"POST"` - `"HEAD"` - `"OPTIONS"` - `"PUT"` - `"DELETE"` - `"CONNECT"` - `"PATCH"` - `"TRACE"` - `operation_id: str` UUID. - `labels: Optional[List[Label]]` - `created_at: datetime` - `description: str` The description of the label - `last_updated: datetime` - `metadata: object` Metadata for the label - `name: str` The name of the label - `source: Literal["user", "managed"]` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `"user"` - `"managed"` # Schema Validation ## Retrieve operation-level schema validation settings `api_gateway.operations.schema_validation.get(stroperation_id, SchemaValidationGetParams**kwargs) -> SchemaValidationGetResponse` **get** `/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation` Retrieves operation-level schema validation settings on the zone ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. ### Returns - `class SchemaValidationGetResponse: …` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` - `operation_id: Optional[str]` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) schema_validation = client.api_gateway.operations.schema_validation.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(schema_validation.operation_id) ``` #### Response ```json { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ``` ## Update operation-level schema validation settings `api_gateway.operations.schema_validation.update(stroperation_id, SchemaValidationUpdateParams**kwargs) -> SchemaValidationUpdateResponse` **put** `/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation` Updates operation-level schema validation settings on the zone ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` ### Returns - `class SchemaValidationUpdateResponse: …` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` - `operation_id: Optional[str]` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) schema_validation = client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(schema_validation.operation_id) ``` #### Response ```json { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ``` ## Update multiple operation-level schema validation settings `api_gateway.operations.schema_validation.edit(SchemaValidationEditParams**kwargs) -> SettingsMultipleRequest` **patch** `/zones/{zone_id}/api_gateway/operations/schema_validation` Updates multiple operation-level schema validation settings on the zone ### Parameters - `zone_id: str` Identifier. - `settings_multiple_request: SettingsMultipleRequestParam` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` ### Returns - `Dict[str, SettingsMultipleRequestItem]` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) settings_multiple_request = client.api_gateway.operations.schema_validation.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, }, ) print(settings_multiple_request) ``` #### Response ```json { "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": { "3818d821-5901-4147-a474-f5f5aec1d54e": { "mitigation_action": "log" }, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": { "mitigation_action": "block" } }, "success": true } ``` ## Domain Types ### Settings Multiple Request - `Dict[str, SettingsMultipleRequestItem]` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` ### Schema Validation Get Response - `class SchemaValidationGetResponse: …` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` - `operation_id: Optional[str]` UUID. ### Schema Validation Update Response - `class SchemaValidationUpdateResponse: …` - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `"log"` - `"block"` - `"none"` - `operation_id: Optional[str]` UUID.