- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- Requirement
- Expr
- MetricBinding
- ThresholdBinding
- ThresholdValue
- ViolationSamplesBinding
- MetricQueryResult
Check a particular requirement.
HTTP request
POST https://discoveryengine.googleapis.com/v1alpha/{location=projects/*/locations/*}/requirements:checkRequirement
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
location |
Required. Full resource name of the location. Format |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"requirementType": string,
"resources": [
{
object ( |
Fields | |
---|---|
requirement |
The type specifying the requirement to check. The supported types are:
|
resources[] |
The resources to be checked for this requirement. The type needed for the monitored resources:
|
Response body
Response for the requirements.checkRequirement method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "requirement": { object ( |
Fields | |
---|---|
requirement |
Requirement definition. |
requirement |
The condition for evaluating the requirement result. |
metric |
Metric results. |
oldest |
Timestamp of the oldest calculated metric (i.e. the most stale metric). Indicates that the A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
result |
The result of the requirement. It should be one of the |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
Requirement
A data requirement.
JSON representation |
---|
{ "type": string, "displayName": string, "description": string, "condition": { object ( |
Fields | |
---|---|
type |
The requirement type, used as an identifier. Must be unique. The type should prefix with service name to avoid possible collision. It's encouraged to use natural hierarchical grouping for similar requirements. Examples:
|
display |
The name of the requirement. |
description |
The description of the requirement. |
condition |
The condition for evaluating the requirement result. Variables in the expression should be provided by |
metric |
A list of the metric bindings to be used in |
threshold |
A list of threshold bindings to be used in |
violation |
A list of the metric bindings to be used in |
severity[] |
The severity of errors if the requirement is not met. It must be ordered from the most strict to the least strict. Examples:
All thresholds in the requirement must have all the severity here. |
Expr
Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec.
Example (Comparison):
title: "Summary size limit"
description: "Determines if a summary is less than 100 chars"
expression: "document.summary.size() < 100"
Example (Equality):
title: "Requestor is owner"
description: "Determines if requestor is the document owner"
expression: "document.owner == request.auth.claims.email"
Example (Logic):
title: "Public documents"
description: "Determine whether the document should be publicly visible"
expression: "document.type != 'private' && document.type != 'internal'"
Example (Data Manipulation):
title: "Notification string"
description: "Create a notification string with a timestamp."
expression: "'New message received at ' + string(document.create_time)"
The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
JSON representation |
---|
{ "expression": string, "title": string, "description": string, "location": string } |
Fields | |
---|---|
expression |
Textual representation of an expression in Common Expression Language syntax. |
title |
Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. |
description |
Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. |
location |
Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. |
MetricBinding
Specifies a metrics query and bind its result to a variable which will be used in the condition
.
JSON representation |
---|
{ "variableId": string, "resourceType": string, "metricFilter": string, "description": string, "category": string } |
Fields | |
---|---|
variable |
The variable id to be referenced in |
resource |
The resource being monitored for the metric. |
metric |
The filter string used for metrics query. Example: "metric.type = "discoveryengine.googleapis.com/events/day_count" AND " "metric.conditions.time_range = "NINETY_DAYS"" |
description |
Human readable description of the corresponding metric filter. |
category |
The category of the metric's target resource. Example: "events" |
ThresholdBinding
Specifies a multi-level threshold to apply to apply to a metricBindings
in the condition
CEL expression.
JSON representation |
---|
{
"variableId": string,
"description": string,
"thresholdValues": [
{
object ( |
Fields | |
---|---|
variable |
The variable id to be referenced in |
description |
Human readable description of the corresponding threshold and sub-requirement. |
threshold |
The values of the threshold. The values should be ordered from the most strict to the least strict. |
ThresholdValue
Specifies a threshold value for a given severity.
JSON representation |
---|
{ "severity": string, "value": number } |
Fields | |
---|---|
severity |
The severity of errors if the threshold is not met. It should be one of the |
value |
The value of the threshold. |
ViolationSamplesBinding
Specifies a samples query and bind its result to a variable which will be used in the condition
.
JSON representation |
---|
{ "variableId": string, "sampleFilter": string, "description": string } |
Fields | |
---|---|
variable |
The variable id to be referenced in |
sample |
The filter string used for samples query. Example: "sample.type = "retail.googleapis.com/userEvent" AND " "sample.labels.event_type = "PURCHASE" " |
description |
Description of this sample binding. Used by the UI to render user friendly descriptions for each requirement condition. Should be less than 128 characters long. |
MetricQueryResult
Metric result. The metric are in the requirementCondition.
JSON representation |
---|
{
"name": string,
"value": {
object ( |
Fields | |
---|---|
name |
This metric query name is mapping to variables in the requirementCondition. |
value |
Value of the metric query. |
timestamp |
Time corresponding to when this metric value was calculated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
unit |
The unit in which this metric is reported. Follows The Unified Code for Units of Measure |
metric |
Type identifier of the metric corresponding to this query result. |