• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Security Group
  6. Querying Security Groups

Querying Security Groups

Function

This interface is used to query all security groups accessible to the tenant submitting the request.

URI

GET /v2.0/security-groups

Request Message

None

Response Message

Table 1 Response parameter

Parameter

Type

Description

security_groups

List(security_group)

Specifies the security group list. For details, see Table 1.

Example:

Example request

GET /v2.0/security-groups?limit=1

Example response

{
    "security_groups": [
        {
            "id": "0431c9c5-1660-42e0-8a00-134bec7f03e2",
            "name": "sg-ad3f",
            "description": "",
            "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
            "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
            "security_group_rules": [
                {
                    "id": "d90e55ba-23bd-4d97-b722-8cb6fb485d69",
                    "direction": "ingress",
                    "protocol": null,
                    "ethertype": "IPv4",
                    "description": null,
                    "remote_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2",
                    "remote_ip_prefix": null,
                    "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
                    "port_range_max": null,
                    "port_range_min": null,
                    "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2"
                    
                },
                {
                    "id": "aecff4d4-9ce9-489c-86a3-803aedec65f7",
                    "direction": "egress",
                    "protocol": null,
                    "ethertype": "IPv4",
                    "description": null,
                    "remote_group_id": null,
                    "remote_ip_prefix": null,
                    "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
                    "port_range_max": null,
                    "port_range_min": null,
                    "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2"
                }
            ],
            "created_at": "2018-09-12T08:24:14",
            "updated_at": "2018-09-12T08:24:14"
        }
    ]
}

Status Codes

For details, see section Status Codes.

Error Codes

For details, see section Error Codes.