Updated on 2025-12-05 GMT+08:00

Querying the Capacity Data of an Application

Function

Cloud Operations Center (COC) allows you to view the capacity details of resources associated with applications, sub-applications, components, or groups, and displays core resource data by resource type.

URI

POST /v1/capacity

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

group_id

No

String

Definition

ID of the current group.

Constraints

ID of the application, component, or group. Only one of them can be set.

Range

The value is a string. It contains 24 characters.

Default value

N/A

component_id

No

String

Definition

ID of the current component.

Constraints

ID of the application, component, or group. Only one of them can be set.

Range

The value is a string. It contains 24 characters.

Default value

N/A

application_id

No

String

Definition

ID of the current application.

Constraints

ID of the application, component, or group. Only one of them can be set.

Range

The value is a string. It contains 24 characters.

Default value

N/A

domain_id

No

String

Definition

The account ID used to log in to a tenant is the same as the tenant ID.

Constraints

N/A

Range

N/A

Default value

N/A

provider_obj

Yes

Array of provider_obj objects

Definition

Resource object.

Constraints

N/A

Range

The value is a string. The value can be ecs, cce, or rds.

Default value

N/A

Table 2 provider_obj

Parameter

Mandatory

Type

Description

provider

No

String

Definition

Cloud service name.

Constraints

N/A

Range

The value is a string and contains 1 to 64 characters. The value can be ecs, cce, or rds.

Default value

N/A

type

No

String

Definition

Resource type.

Constraints

N/A

Range

There are many resource types. Select a resource type based on the actual service. The common resource types are as follows:

  • cloudservers: Elastic Cloud Servers (ECSs)

  • servers: Bare Metal Servers (BMSs)

  • clusters: Cloud Container Engine (CCE)

  • instances: cloud database instances

Default value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

data

Array of data objects

Definition

Capacity data list.

Range

List of cloud service capacity data of the selected application. The value contains 0 to 500 characters.

Table 4 data

Parameter

Type

Description

sum_size

String

Definition

Total size of a hard disk.

Range

Total memory of the cloud service.

sum_cpu

String

Definition

Total number of allocated CPUs.

Range

N/A

sum_mem

String

Definition

Total number of allocated memory.

Range

N/A

provider

String

Definition

Cloud service type.

Range

The value is a string. The value can be ecs, cce, or rds.

type

String

Definition

Resource type.

Range

There are many resource types. Select a resource type based on the actual service. The common resource types are as follows:

  • cloudservers: Elastic Cloud Servers (ECSs)

  • servers: Bare Metal Servers (BMSs)

  • clusters: Cloud Container Engine (CCE)

  • instances: cloud database instances

Example Requests

Query the capacity data of an application.

POST https://{Endpoint}/v1/capacity

{
  "application_id" : "660557b2dc48844adc49eaa5",
  "provider_obj" : [ {
    "provider" : "ecs",
    "type" : "cloudservers"
  }, {
    "provider" : "bms",
    "type" : "servers"
  }, {
    "provider" : "evs",
    "type" : "volumes"
  }, {
    "provider" : "rds",
    "type" : "instances"
  }, {
    "provider" : "dcs",
    "type" : "redis"
  }, {
    "provider" : "dds",
    "type" : "instances"
  }, {
    "provider" : "cci",
    "type" : "pods"
  } ]
}

Example Responses

Status code: 200

The application capacity information is queried.

{
  "data" : [ {
    "sum_mem" : "39936",
    "sum_cpu" : "17",
    "provider" : "ecs",
    "type" : "cloudservers"
  }, {
    "sum_mem" : "0",
    "sum_cpu" : "0",
    "provider" : "bms",
    "type" : "servers"
  }, {
    "sum_size" : "1670",
    "provider" : "evs",
    "type" : "volumes"
  }, {
    "sum_mem" : "32",
    "sum_cpu" : "16",
    "sum_size" : "370",
    "provider" : "rds",
    "type" : "instances"
  } ]
}

Status Codes

Status Code

Description

200

The application capacity information is queried.

Error Codes

See Error Codes.