Help Center/ Virtual Private Cloud/ API Reference/ APIs/ Security Group Tag Management/ Querying Security Group Tags in a Specified Project
Updated on 2024-10-14 GMT+08:00

Querying Security Group Tags in a Specified Project

Function

This API is used to query all security group tags of a tenant in a specified region.

URI

GET /v2.0/{project_id}/security-groups/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of ListTag objects

Tags

Table 3 ListTag

Parameter

Type

Description

key

String

Tag key.

The key cannot be left blank.

Minimum: 1

Maximum: 127

values

Array of strings

Tag values.

If values are null, it indicates any_value. All values of a tag key are in the OR relationship.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 409

Table 8 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Example Requests

Querying Security Group Tags in a Specified Project

GET https://{Endpoint}/v2.0/{project_id}/security-groups/tags

Example Responses

Status code: 200

Normal response.

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  }, {
    "key" : "key2",
    "values" : [ "value1", "value2" ]
  } ]
}

Status Codes

Status Code

Description

200

Normal response.

400

The server failed to process the request.

401

Username and password are required to access the page requested.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.

409

The request could not be processed due to a conflict.

500

Failed to complete the request because of an internal service error.

Error Codes

See Error Codes.