## Retrieve information about an operation `client.APIGateway.Operations.Get(ctx, operationID, params) (*OperationGetResponse, error)` **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 - `operationID string` UUID. - `params OperationGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Feature param.Field[[]OperationGetParamsFeature]` Query param: 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. - `const OperationGetParamsFeatureThresholds OperationGetParamsFeature = "thresholds"` - `const OperationGetParamsFeatureParameterSchemas OperationGetParamsFeature = "parameter_schemas"` - `const OperationGetParamsFeatureSchemaInfo OperationGetParamsFeature = "schema_info"` ### Returns - `type OperationGetResponse struct{…}` - `Endpoint string` 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 string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationGetResponseMethod` The HTTP method used to access the endpoint. - `const OperationGetResponseMethodGet OperationGetResponseMethod = "GET"` - `const OperationGetResponseMethodPost OperationGetResponseMethod = "POST"` - `const OperationGetResponseMethodHead OperationGetResponseMethod = "HEAD"` - `const OperationGetResponseMethodOptions OperationGetResponseMethod = "OPTIONS"` - `const OperationGetResponseMethodPut OperationGetResponseMethod = "PUT"` - `const OperationGetResponseMethodDelete OperationGetResponseMethod = "DELETE"` - `const OperationGetResponseMethodConnect OperationGetResponseMethod = "CONNECT"` - `const OperationGetResponseMethodPatch OperationGetResponseMethod = "PATCH"` - `const OperationGetResponseMethodTrace OperationGetResponseMethod = "TRACE"` - `OperationID string` UUID. - `Features OperationGetResponseFeatures` - `type OperationGetResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds OperationGetResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting OperationGetResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Operations.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.OperationID) } ``` #### 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 } ```