Help Center/ Cloud Connect/ API Reference/ API/ Global Connection Bandwidth Tag Management/ Querying the Number of Global Connection Bandwidth Tags in an Account
Updated on 2025-07-29 GMT+08:00

Querying the Number of Global Connection Bandwidth Tags in an Account

Function

This API is used to query the number of global connection bandwidth tags in an account.

URI

POST /v3/gcb/resource-instances/count

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

request_id

No

String

Request ID.

without_any_tag

No

Boolean

If this parameter is set to true, all resources without tags are queried. In this case, the tags, tags_any, not_tags, and not_tags_any fields are not required.

tags

No

Array of QueryTag objects

The instances to be queried contain tags listed in tags. Each instance to be queried contains a maximum of 20 keys. Each tag key has a maximum of 10 tag values. The tag value corresponding to each tag key can be an empty array but the structure cannot be missing. Each tag key and each value of the same tag key must be unique. The response returns resources containing all tags in this list. Keys in this list are in the AND relationship and values in each key-value structure are in the OR relationship. If no searching condition is specified, full data is returned.

tags_any

No

Array of QueryTag objects

The instances to be queried contain any tag listed in tags_any. Each instance to be queried contains a maximum of 20 keys. Each tag key has a maximum of 10 tag values. The tag value corresponding to each tag key can be an empty array but the structure cannot be missing. Each tag key and each value of the same tag key must be unique. The response returns resources containing any tag in this list. Keys in this list are in the OR relationship and values in each key-value structure are also in the OR relationship. If no searching condition is specified, full data is returned.

not_tags

No

Array of QueryTag objects

The instances to be queried do not contain any tag listed in not_tags. Each instance to be queried contains a maximum of 20 keys. Each tag key has a maximum of 10 tag values. The tag value corresponding to each tag key can be an empty array but the structure cannot be missing. Keys must be unique and values of a key must be unique. The response returns resources containing no tags in this list. Keys in this list are in the AND relationship and values in each key-value structure are in the OR relationship. If no searching condition is specified, full data is returned.

not_tags_any

No

Array of QueryTag objects

The instances to be queried do not contain all tags listed in not_tags_any. Each instance to be queried contains a maximum of 20 keys. Each tag key has a maximum of 10 tag values. The tag value corresponding to each tag key can be an empty array but the structure cannot be missing. Keys must be unique and values of a key must be unique. The response returns resources containing no tag in this list. Keys in this list are in the OR relationship and values in each key-value structure are also in the OR relationship. If no filtering criteria is specified, full data is returned.

matches

No

Array of TmsMatch objects

Whether to match the tags: The tag key must be set to resource_name. If there is a tag value, fuzzy matching is used. If the tag value is an empty string, exact matching is used.

Table 3 QueryTag

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

values

Yes

Array of strings

List of tag values.

Table 4 TmsMatch

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key, Currently, only resource_name is supported. Other key values will be available later.

value

Yes

String

Tag value.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

total_count

Integer

Total records.

request_id

String

Request ID.

Example Requests

Querying the number of global connection bandwidth tags in an account

POST https://{cc_endpoint}/v3/gcb/resource-instances/count

{
  "not_tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  } ],
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  } ],
  "tags_any" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  } ],
  "not_tags_any" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  } ],
  "matches" : [ {
    "key" : "resource_name",
    "value" : "resource1"
  } ]
}

Example Responses

Status code: 200

The number of global connection bandwidth tags in an account has been queried.

{
  "request_id" : "e3371202-7e85-4c16-bb4b-4e3c092734f7",
  "total_count" : 1
}

Status Codes

Status Code

Description

200

The number of global connection bandwidth tags in an account has been queried.

Error Codes

See Error Codes.