Querying Information About a Graph
Function
This API is used to query information about a graph.
Constraints
This API is not supported in the following five sites: CN East-Qingdao, LA-Mexico City1, TR-Istanbul, AP-Jakarta, and ME-Riyadh.
URI
GET /v2/{project_id}/widgets/{widget_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Tenant ID. Minimum: 1 Maximum: 64 |
|
widget_id |
Yes |
String |
Graph ID. Regex Pattern: ^wg([a-z]|[A-Z]|[0-9]){22}$ |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
Yes |
String |
MIME type of the request body. Default value application/json is recommended. Default: application/json;charset=UTF-8 Minimum: 1 Maximum: 64 |
|
X-Auth-Token |
Yes |
String |
User token. It is a response to the API used to obtain a user token. This API is the only one that does not require authentication. The value of X-Subject-Token in the response header is the token value. Minimum: 1 Maximum: 16000 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
widget_id |
String |
Graph ID. Regex Pattern: ^wg([a-z]|[A-Z]|[0-9]){22}$ |
|
metrics |
Array of WidgetMetric objects |
Metric list. Array Length: 1 - 200 |
|
title |
String |
Graph name. Minimum: 1 Maximum: 128 Regex Pattern: ^([\u4E00-\u9FFF]|[a-z]|[A-Z]|[0-9]|_|-|:|;|\(|\)|\.|~|(|))+$ |
|
threshold |
Double |
Threshold of metrics on the graph. Minimum: 0 Maximum: 1.7976931348623157E308 |
|
threshold_enabled |
Boolean |
Whether to display thresholds of metrics. The value can be true (to display) and false (not to display). |
|
view |
String |
Monitoring view chart type. The options are bar, line, bar_chart, table, circular_bar, and area_chart. Enumeration values: |
|
metric_display_mode |
String |
Metric display mode. The value can be single or multiple. Enumeration values: |
|
properties |
properties object |
Additional information. |
|
location |
location object |
Graph coordinates. |
|
unit |
String |
Unit. |
|
create_time |
Long |
Dashboard creation time. Minimum: 1111111111111 Maximum: 9999999999999 |
|
Parameter |
Type |
Description |
|---|---|---|
|
namespace |
String |
Cloud service dimension. Minimum: 3 Maximum: 32 Regex Pattern: ^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_)*\.([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_)*$ |
|
dimensions |
DimensionInfo object |
Dimension list. |
|
metric_name |
String |
Metric name. Minimum: 1 Maximum: 96 Regex Pattern: ^([A-Za-z]){1}([0-9A-Za-z]|_|-)*$ |
|
alias |
Array of strings |
Alias list of metrics on the graph. Minimum: 1 Maximum: 128 Array Length: 0 - 200 |
|
extra_info |
ExtraInfo object |
Metric information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Dimension name. Use commas (,) to separate multiple dimensions. For details about the dimensions supported by each cloud service, see Services Interconnected with Cloud Eye. Minimum: 1 Maximum: 131 Regex Pattern: ^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_|-){0,31}(,([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_|-){0,31}){0,3}$ |
|
filter_type |
String |
Resource type. The value can be all_instances (all resources) or specific_instances (specified resources). Enumeration values: |
|
values |
Array of strings |
Dimension value list. Minimum: 1 Maximum: 1024 Array Length: 0 - 200 |
|
Parameter |
Type |
Description |
|---|---|---|
|
origin_metric_name |
String |
Metric name. Minimum: 1 Maximum: 4096 Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$ |
|
metric_prefix |
String |
Metric name prefix. Minimum: 1 Maximum: 4096 Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$ |
|
metric_type |
String |
Metric type. Minimum: 1 Maximum: 32 Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$ |
|
custom_proc_name |
String |
Custom process name. Minimum: 1 Maximum: 250 |
|
Parameter |
Type |
Description |
|---|---|---|
|
filter |
String |
Aggregation type. Currently, the value can only be TopN. A line chart does not support this parameter. Enumeration values: |
|
topN |
Integer |
Top N values. In the line chart, this parameter indicates the number of time series data records that are randomly displayed. Minimum: 1 Maximum: 2147483647 Default: 100 |
|
order |
String |
Sorting field. The value can be asc (ascending order) or desc (descending order). A line chart does not support this parameter. Enumeration values: |
|
Parameter |
Type |
Description |
|---|---|---|
|
top |
Integer |
Grids between the graph and the top of the dashboard. Minimum: 0 Maximum: 2147483647 |
|
left |
Integer |
Grids between the graph and the left side of the dashboard. Minimum: 0 Maximum: 9 |
|
width |
Integer |
Graph width. Minimum: 3 Maximum: 12 |
|
height |
Integer |
Graph height. Minimum: 3 Maximum: 2147483647 |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
|
error_msg |
String |
Request error message. Minimum: 0 Maximum: 256 |
|
request_id |
String |
Request ID. Minimum: 0 Maximum: 256 |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
|
error_msg |
String |
Request error message. Minimum: 0 Maximum: 256 |
|
request_id |
String |
Request ID. Minimum: 0 Maximum: 256 |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
|
error_msg |
String |
Request error message. Minimum: 0 Maximum: 256 |
|
request_id |
String |
Request ID. Minimum: 0 Maximum: 256 |
Example Requests
None
Example Responses
Status code: 200
OK
{
"widget_id" : "wg1234567890123456789012",
"metrics" : [ {
"namespace" : "SYS.ECS",
"dimensions" : {
"name" : "instance_id",
"filter_type" : "specific_instances",
"values" : [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ]
},
"metric_name" : "cpu_util",
"alias" : [ "cpuutilalias" ],
"extra_info" : {
"origin_metric_name" : "cpu_util",
"metric_prefix" : "cpu",
"metric_type" : "type",
"custom_proc_name" : "app.sh"
}
} ],
"view" : "view",
"metric_display_mode" : "single",
"threshold" : 0.7,
"threshold_enabled" : true,
"title" : "widget_title",
"properties" : {
"filter" : "topN",
"topN" : 100,
"order" : "desc"
},
"location" : {
"left" : 0,
"top" : 0,
"width" : 4,
"height" : 3
},
"unit" : "%",
"create_time" : 1111111111111
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
The server failed to process the request. |
|
401 |
Token authentication is required. |
|
500 |
Failed to complete the request because of an internal server error. |
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.