Querying Security Groups

Function

This API is used to query security groups using search criteria and to display the security groups in a list.

URI

GET /v1/{project_id}/security-groups

Example:
GET https://{Endpoint}/v1/{project_id}/security-groups?limit=10&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d&vpc_id=3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85
Table 1 describes the parameters.
Table 1 Parameter description

Name

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

marker

No

String

Specifies a resource ID for pagination query, indicating that the query starts from the next record of the specified resource ID.

This parameter can work together with the parameter limit.

  • If parameters marker and limit are not passed, all resource records will be returned.
  • If the parameter marker is not passed and the value of parameter limit is set to 10, the first 10 resource records will be returned.
  • If the value of the parameter marker is set to the resource ID of the 10th record and the value of parameter limit is set to 10, the 11th to 20th resource records will be returned.
  • If the value of the parameter marker is set to the resource ID of the 10th record and the parameter limit is not passed, resource records starting from the 11th records (including 11th) will be returned.

limit

No

Integer

Specifies the number of records that will be returned on each page. The value is from 0 to intmax.

limit can be used together with marker. For details, see the parameter description of marker.

vpc_id

No

String

Specifies that the VPC ID is used as the filtering condition.

enterprise_project_id

No

String

  • Specifies the enterprise project ID. This field can be used to filter the security groups of an enterprise project.
  • The value is 0 or a string that contains a maximum of 36 characters in UUID format with hyphens (-). Value 0 indicates the default enterprise project. To obtain the security groups bound to all enterprise projects of the user or to display the security group list for enterprise project member accounts, set all_granted_eps.
NOTE:

This parameter is unsupported. Do not use it.

remote_address_group_id

No

String

  • Specifies the remote IP address group ID. You can log in to the management console and view the ID on the IP address group page.
  • The value is exclusive with parameters remote_ip_prefix and remote_group_id.

Request Message

Response Message

Status Code

See Status Codes.

Error Code

See Error Codes.