- HTTP 要求
- 路徑參數
- 要求主體
- 回應主體
- 授權範圍
- 規定
- MetricBinding
- ThresholdBinding
- ThresholdValue
- ViolationSamplesBinding
- MetricQueryResult
查看特定規定。
HTTP 要求
POST https://discoveryengine.googleapis.com/v1alpha/{location=projects/*/locations/*}/requirements:checkRequirement
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 | |
---|---|
location |
這是必要旗標,地點的完整資源名稱。格式 |
要求主體
要求主體包含下列結構的資料:
JSON 表示法 |
---|
{
"requirementType": string,
"resources": [
{
object ( |
欄位 | |
---|---|
requirementType |
指定要檢查的規定類型。支援的類型如下:
|
resources[] |
要檢查這項需求的資源。受監控資源所需的類型:
|
回應主體
requirements.checkRequirement 方法的回應。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
---|
{ "requirement": { object ( |
欄位 | |
---|---|
requirement |
需求定義。 |
requirementCondition |
評估需求結果的條件。 |
metricResults[] |
指標結果。 |
oldestMetricTimestamp |
最舊的計算指標時間戳記 (即最舊的指標)。表示 使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數點後位數。系統也接受「Z」以外的偏移量。例如: |
result |
需求結果。這應該是需求定義中的其中一個 |
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/discoveryengine.readwrite
詳情請參閱Authentication Overview。
需求
資料要求。
JSON 表示法 |
---|
{ "type": string, "displayName": string, "description": string, "condition": { object ( |
欄位 | |
---|---|
type |
做為 ID 的需求類型。ID 不得重複。 為避免可能發生衝突,型別應以服務名稱為前置字串。建議對類似需求使用自然階層式分組。 範例:
|
displayName |
需求名稱。 |
description |
需求說明。 |
condition |
評估需求結果的條件。 運算式中的變數應由 |
metricBindings[] |
要在 |
thresholdBindings[] |
要在 |
violationSamplesBindings[] |
要在 |
severity[] |
如果未符合規定,錯誤的嚴重程度。且必須從最嚴格到最寬鬆依序排列。範例:
規定中的所有門檻都必須具有此處的所有嚴重程度。 |
MetricBinding
指定指標查詢,並將結果繫結至 condition
中使用的變數。
JSON 表示法 |
---|
{ "variableId": string, "resourceType": string, "metricFilter": string, "description": string, "category": string } |
欄位 | |
---|---|
variableId |
要在 |
resourceType |
要監控指標的資源。 |
metricFilter |
用於指標查詢的篩選器字串。 範例: "metric.type = "discoveryengine.googleapis.com/events/day_count" AND " "metric.conditions.time_range = "NINETY_DAYS"" |
description |
使用者可理解的對應指標篩選器說明。 |
category |
指標目標資源的類別。例如:「Events」 |
ThresholdBinding
指定要套用至 condition
CEL 運算式中 metricBindings
的多層級門檻。
JSON 表示法 |
---|
{
"variableId": string,
"description": string,
"thresholdValues": [
{
object ( |
欄位 | |
---|---|
variableId |
要在 |
description |
使用者可理解的對應門檻和子項規定說明。 |
thresholdValues[] |
門檻值。值應從最嚴格到最寬鬆排序。 |
ThresholdValue
指定特定嚴重程度的閾值。
JSON 表示法 |
---|
{ "severity": string, "value": number } |
欄位 | |
---|---|
severity |
未達門檻時的錯誤嚴重程度。必須是需求中的 |
value |
門檻值。 |
ViolationSamplesBinding
指定樣本查詢,並將結果繫結至 condition
中使用的變數。
JSON 表示法 |
---|
{ "variableId": string, "sampleFilter": string, "description": string } |
欄位 | |
---|---|
variableId |
要在 |
sampleFilter |
用於查詢樣本的篩選器字串。 範例:「sample.type = "retail.googleapis.com/userEvent" AND " "sample.labels.event_type = "PURCHASE" "」 |
description |
這個範例繫結的說明。UI 會使用這項屬性,為每個需求條件顯示易於理解的說明。 長度應少於 128 個字元。 |
MetricQueryResult
指標結果。指標位於 requirementCondition 中。
JSON 表示法 |
---|
{
"name": string,
"value": {
object ( |
欄位 | |
---|---|
name |
這項指標查詢名稱會對應至 requirementCondition 中的變數。 |
value |
指標查詢的值。 |
timestamp |
計算這個指標值時對應的時間。 使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數點後位數。系統也接受「Z」以外的偏移量。例如: |
unit |
|
metricType |
與這項查詢結果對應的指標類型 ID。 |