Obtaining Metric Metadata
Function
This API is used to obtain metric metadata.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/metrics/{metric_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
|
workspace_id |
Yes |
String |
Definition Workspace ID. Constraints N/A Range N/A Default Value N/A |
|
metric_id |
Yes |
String |
Metrics ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. Obtaining a User Token Constraints N/A Range N/A Default Value N/A |
|
content-type |
Yes |
String |
Definition Content type.
Constraints N/A Range
Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Request ID. Format: request_uuid-timestamp-hostname. |
|
Parameter |
Type |
Description |
|---|---|---|
|
metric_name |
String |
Metric name. |
|
metric_type |
String |
Metric type. DERIVED: derived metric. A derived metric along with conditions can be obtained from a single CBSL or API query. COMPOUND: compound metric. A compound metric can be obtained by calculating multiple atomic metrics. |
|
data_type |
String |
Data type. TRACK: tracking metric; STATISTICS: statistical metric; and LOGISTIC: logical metric. |
|
metric_dimension |
Integer |
Metric result dimension. 0: single number; 2: chart or table; and 3+: multi-label chart. If metric_type is set to DERIVED, this parameter is mandatory. If metric_type is set to COMPOUND, this parameter is optional or must be fixed at 0. |
|
cache_ttl |
Long |
Cache lifecycle, in seconds. |
|
report_period |
Long |
Reporting period, which is mandatory for tracking metrics. The unit is second. |
|
is_built_in |
Boolean |
Whether the metric is a system metric. |
|
effective_column |
String |
Effective column. If this parameter is specified, the specified column is used as the metric data result. |
|
max_query_range |
Integer |
Maximum search range supported by the metric, in days. For compound metrics, the value is the minimum value in the derived_metrics list. |
|
derived_metrics |
Array of derived_metrics objects |
List of derived metrics. If the metric is not a compound metric, there is only one element. If the metric is a compound metric, the definition of each derived metric is included. |
|
compound_expression |
String |
If metric_type is set to DERIVED, enter the expression of a compound metric. |
|
metric_format |
Array of LayoutMetricFormat objects |
Metric format. |
|
metric_expand_dim |
MetricDimensionExpandParam object |
Extended parameters of the metric dimension. |
|
version |
String |
SecMaster edition. |
|
metric_id |
String |
Metric ID. |
|
Parameter |
Type |
Description |
|---|---|---|
|
metric_dimension |
Integer |
Result dimension of the derived metric. 0: single number; 2: chart or table; and 3+: multi-label chart. |
|
max_query_range |
Integer |
Maximum query range supported by the metric, in days. |
|
date_start |
String |
Date math expression of the relative start time for the metric query range. |
|
date_end |
String |
Date math expression of the relative end time for the metric query range. |
|
date_format |
String |
Time format. The options are epoch_millis, epoch_second, and yyyy-MM-dd'T'HH:mm:ss.SSSZ. |
|
query_type |
String |
Method for obtaining metric results. The options are cbsl, api, dsl, and sql. |
|
query_function |
String |
Method for obtaining metric results. The options are CBSL, API, DSL, and SQL. The value is of string type.
Example: {\"dataspace_id\":\"3939573a-12a0-436f-b0e5-ab2872a1fde9\",\"pipe_id\":\"9db9d8a6-d9e6-4b32-990e-40f0afe4655d\",\"query\":\"* | select ack_pps, device_type as type\",\"sort\":\"desc\",\"from\":${date_from},\"to\":${date_to}} Before escape: json { "dataspace_id":"3939573a-12a0-436f-b0e5-ab2872a1fde9", "pipe_id":"9db9d8a6-d9e6-4b32-990e-40f0afe4655d", "query":"* | select ack_pps, device_type as type", "sort":"desc", "from": ${date_from}, "to": ${date_to} }
Example: {\"method\":\"POST\,"\"uri\":\"/v1/${project_id}/Enter a URI without a domain name. /xxx\",\"headers\":{\"X-Auth-Token\":\"${project_token}\"},\"response_parser\":{\"labels\": [\"Attack type\,"\"Attack source\,"\"Time\"] ,\"json_path\":[\"$.data[:].type\",\"$.data[:].source\",\"$.data[:].time\"]}} Before escape: json { "method":"POST", "uri":"/v1/${project_id}/Only URI/without domain name/xxx", "headers":{ "X-Auth-Token": "${project_token}" }, "response_parser":{ "labels":[ "Attack type", "Attack source", "Time" ], "json_path":[ "$.data[:].type", "$.data[:].source", "$.data[:].time" ] } }
Example: {\"index\":\"index_xxx_*\",\"dsl\":\"{\\\"query\\\":{\\\"match_all\\\":{}}}\",\"response_parser\":{\"labels\":[\"attack type\","attack source\","time\"],\"json_path\":[\"$.data[:].type\",\"$.data[:].source\","$.data[:].time\"]}} Before escape: ```json
{
"index":"index_xxx_*",
"dsl":"{\"query\":{\"match_all\":{}}}",
"response_parser":{
"labels":[
"Attack type",
"Attack source",
"Time"
],
"json_path":[
"$.data[:].type",
"$.data[:].source",
"$.data[:].time"
]
}
}
```
Example: {\"query\":\"SELECT count(1) as count , msg.DstPort FROM isap_log_nip_ttl* where oct >= TIMESTAMP(\\\"${date_from}\\\") and oct <= TIMESTAMP(\\\"${date_to}\\\") group by msg.DstPort order by count desc limit 5\"} Before escape: ```json
{
"query":"SELECT count(1) as count , msg.DstPort FROM isap_log_nip_ttl* where oct >= TIMESTAMP(\"${date_from}\") and oct <= TIMESTAMP(\"${date_to}\") group by msg.DstPort order by count desc limit 5"
}
``` |
|
Parameter |
Type |
Description |
|---|---|---|
|
data |
String |
Data format. |
|
display |
String |
Display format. |
|
display_param |
Map<String,String> |
Display parameters. |
|
data_param |
Map<String,String> |
Data parameters. |
|
Parameter |
Type |
Description |
|---|---|---|
|
labels |
Array of strings |
Dimension expansion label. |
|
functions |
Array of strings |
Dimension expansion method. Enter the built-in method on the metric data plane. The value of index starts from 1. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Request ID. Format: request_uuid-timestamp-hostname. |
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code. Range N/A |
|
message |
String |
Definition Error description. Range N/A |
Example Requests
None
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response succeeded. |
|
400 |
Error response. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot