Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Eye/ API Reference/ API V2/ Graphs/ Updating Graphs in Batches

Updating Graphs in Batches

Updated on 2024-12-26 GMT+08:00

Function

This API is used to update graphs in batches.

Constraints

This API is not supported in the following five sites: CN East-Qingdao, LA-Mexico City1, TR-Istanbul, AP-Jakarta, and ME-Riyadh.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

POST /v2/{project_id}/widgets/batch-update

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant ID.

Minimum: 1

Maximum: 64

Request Parameters

Table 2 Request header 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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

[items]

Yes

Array of UpdateWidgetInfo objects

List of graphs to be modified.

Table 4 UpdateWidgetInfo

Parameter

Mandatory

Type

Description

widget_id

Yes

String

Graph ID.

Regex Pattern: ^wg([a-z]|[A-Z]|[0-9]){22}$

metrics

No

Array of WidgetMetric objects

Metric list.

Array Length: 1 - 200

title

No

String

Graph name.

Minimum: 1

Maximum: 128

Regex Pattern: ^([\u4E00-\u9FFF]|[a-z]|[A-Z]|[0-9]|_|-|:|;|\(|\)|\.|~|(|))+$

threshold

No

Double

Threshold of metrics on the graph.

Minimum: 0

Maximum: 1.7976931348623157E308

threshold_enabled

No

Boolean

Whether to display thresholds of metrics. The value can be true (to display) and false (not to display).

view

No

String

Monitoring view chart type. The options are bar, line, bar_chart, table, circular_bar, and area_chart.

Enumeration values:

  • bar

  • line

  • bar_chart

  • table

  • circular_bar

  • area_chart

metric_display_mode

No

String

Metric display mode. The value can be single or multiple.

Enumeration values:

  • single

  • multiple

properties

No

properties object

Graph display configuration.

location

No

location object

Graph coordinates.

unit

No

String

Unit.

Table 5 WidgetMetric

Parameter

Mandatory

Type

Description

namespace

Yes

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

Yes

DimensionInfo object

Dimension list.

metric_name

Yes

String

Metric name.

Minimum: 1

Maximum: 96

Regex Pattern: ^([A-Za-z]){1}([0-9A-Za-z]|_|-)*$

alias

No

Array of strings

Alias list of metrics on the graph.

Minimum: 1

Maximum: 128

Array Length: 0 - 200

extra_info

No

ExtraInfo object

Metric information.

Table 6 DimensionInfo

Parameter

Mandatory

Type

Description

name

Yes

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

Yes

String

Resource type. The value can be all_instances (all resources) or specific_instances (specified resources).

Enumeration values:

  • all_instances

  • specific_instances

values

No

Array of strings

Dimension value list.

Minimum: 1

Maximum: 1024

Array Length: 0 - 200

Table 7 ExtraInfo

Parameter

Mandatory

Type

Description

origin_metric_name

Yes

String

Metric name.

Minimum: 1

Maximum: 4096

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

metric_prefix

No

String

Metric name prefix.

Minimum: 1

Maximum: 4096

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

metric_type

No

String

Metric type.

Minimum: 1

Maximum: 32

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

custom_proc_name

No

String

Custom process name.

Minimum: 1

Maximum: 250

Table 8 properties

Parameter

Mandatory

Type

Description

filter

No

String

Aggregation type. Currently, the value can only be TopN. A line chart does not support this parameter.

Enumeration values:

  • topN

topN

No

Integer

Top N values. In a line chart, this parameter indicates the number of time series data records that are randomly displayed.

Minimum: 1

Maximum: 2147483647

Default: 100

order

No

String

Sorting field. The value can be asc (ascending order) or desc (descending order). The line chart does not support this parameter.

Enumeration values:

  • asc

  • desc

Table 9 location

Parameter

Mandatory

Type

Description

top

Yes

Integer

Grids between the graph and the top of the dashboard.

Minimum: 0

Maximum: 2147483647

left

Yes

Integer

Grids between the graph and the left side of the dashboard.

Minimum: 0

Maximum: 9

width

Yes

Integer

Graph width.

Minimum: 3

Maximum: 12

height

Yes

Integer

Graph height.

Minimum: 3

Maximum: 2147483647

Response Parameters

Status code: 200

Table 10 Response body parameters

Parameter

Type

Description

widgets

Array of BatchUpdateWidgetInfo objects

Update result list.

Array Length: 1 - 50

Table 11 BatchUpdateWidgetInfo

Parameter

Type

Description

widget_id

String

Graph ID.

Regex Pattern: ^wg([a-z]|[A-Z]|[0-9]){22}$

ret_status

String

Update result. The value can be successful or error.

Enumeration values:

  • successful

  • error

error_msg

String

Error message when an operation fails.

Minimum: 1

Maximum: 2048

Status code: 400

Table 12 Response body parameters

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

Table 13 Response body parameters

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

Table 14 Response body parameters

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

[ {
  "widget_id" : "wgXXXXXXXXXXXXXXXXXXXXXX",
  "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" : 500,
  "threshold_enabled" : false,
  "title" : "widget_title_new",
  "properties" : {
    "filter" : "topN",
    "topN" : 10,
    "order" : "asc"
  },
  "location" : {
    "left" : 0,
    "top" : 3,
    "width" : 4,
    "height" : 3
  },
  "unit" : "%"
} ]

Example Responses

Status code: 200

OK

{
  "widgets" : [ {
    "widget_id" : "wgXXXXXXXXXXXXXXXXXXXXXX",
    "ret_status" : "successful"
  }, {
    "widget_id" : "wg9876543210123456789012",
    "ret_status" : "error",
    "error_msg" : "record not found"
  } ]
}

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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback