• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. OpenStack Nova APIs
  5. Security Group Management
  6. Querying Details About a Security Group (Discarded)

Querying Details About a Security Group (Discarded)

Function Description

This interface is used to query details about a security group.

This interface can only query the inbound security group rules. To query the outbound security group rules, see section "Querying a Security Group" in "Security Group (Native OpenStack API)" in the Virtual Private Cloud API Reference.

Constraints

This API will be discarded.

You are advised to use the desired network interface. For details, see section "Security Group (Native OpenStack API) > Querying a Security Group" in Virtual Private Network API Reference.

URI

GET /v2/{project_id}/os-security-groups/{security_group_id}

GET /v2.1/{project_id}/os-security-groups/{security_group_id}

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

security_group_id

Yes

Specifies the security group ID, which is specified in the URI.

Request

N/A

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

security_group

Dict

Specifies the security group. For details, see Table 3.

Table 3 security_group objects

Parameter

Type

Description

description

String

Specifies information about a security group. It is a string of 0 to 255 characters.

id

String

Specifies the security group ID in UUID format.

name

String

Specifies the security group name. It is a string of 0 to 255 characters.

rules

List

Specifies security group rules. For details, see Table 4.

tenant_id

String

Specifies the tenant or project ID.

Table 4 security_group_rule objects

Parameter

Type

Description

parent_group_id

String

Specifies the associated security group ID in UUID format.

ip_protocol

String

Specifies the protocol type or the IP protocol number. The value can be icmptcpudp, or the IP protocol number.

from_port

Int

Specifies the start port number. The value ranges from 1 to 65,535 and cannot be greater than to_port.

When ip_protocol is icmp, this parameter indicates the ICMP type field with a length from 0 to 255 characters.

NOTE:

The ICMP message type is determined by the type field and code field in the packet. For details, see section Appendix > ICMP-Port Range Relationship Table in Virtual Private Cloud API Referenceport_range_min indicates the ICMP type, and port_range_max indicates the ICMP code.

to_port

Int

Specifies the stop port number. The value ranges from 1 to 65,535 and cannot be less than from_port.

When ip_protocol is icmp, this parameter indicates the ICMP code field with a length from 0 to 255 characters.

NOTE:

The ICMP message type is determined by the type field and code field in the packet. For details, see section Appendix > ICMP-Port Range Relationship Table in Virtual Private Cloud API Referenceport_range_min indicates the ICMP type, and port_range_max indicates the ICMP code.

ip_range

Dict

Specifies the peer IP segment in CIDR format. For details, see Table 5.

Specify either ip_range or group.

group

Dict

Specifies the name of the peer security group and the ID of the tenant in the peer security group. For details, see Table 6.

Specify either ip_range or group.

id

String

Specifies the security group rule ID.

Table 5 ip_range objects

Parameter

Type

Description

cidr

String(255)

Specifies the peer IP segment in CIDR format.

Table 6 group objects

Parameter

Type

Description

tenant_id

String

Specifies the ID of the tenant of the peer security group.

name

String

Specifies the name of the peer security group.

Examples

  • Example request
    GET /v2/bb1118612ba64af3a6ea63a1bdcaa5ae/os-security-groups/81f1d23b-b1e2-42cd-bdee-359b4a065a42
    GET /v2.1/bb1118612ba64af3a6ea63a1bdcaa5ae/os-security-groups/81f1d23b-b1e2-42cd-bdee-359b4a065a42
  • Example response
    {
        "security_group": {
            "rules": [],
            "tenant_id": "bb1118612ba64af3a6ea63a1bdcaa5ae",
            "id": "81f1d23b-b1e2-42cd-bdee-359b4a065a42",
            "name": "test-sg",
            "description": "desc-sg"
        }
    }

Returned Values

See General Request Returned Values.