• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Security groups and rules
  6. List security groups

List security groups

Function Description

This interface is used to query security groups.

Interface Format

Method

URI

Description

GET

/v2.0/security-groups? name={ name }&description ={ description }&tenant_id ={tenant_id}

Queries all security groups accessible to the tenant submitting the request.

Restrictions

N/A

Request Parameter

None

Response Parameter

Parameter

Type

Mandatory

Description

security_groups

List(security_group)

Yes

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

Request Example

GET  /v2.0/security-groups

Response Example

{
     "security_groups": [
        {
            "tenant_id": "84b25ac10ed642cca484aa55c098e3aa",
            "name": "default",
            "description": "Default security group",
            "security_group_rules": [
                {
                    "remote_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967",
                    "direction": "ingress",
                    "remote_ip_prefix": null,
                    "protocol": null,
                    "ethertype": "IPv6",
                    "tenant_id": "84b25ac10ed642cca484aa55c098e3aa",
                    "port_range_max": null,
                    "port_range_min": null,
                    "id": "07adc044-3f21-4eeb-bd57-5e5eb6024b7f",
                    "description": null,
                    "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967"
                },
                {
                    "remote_group_id": null,
                    "direction": "egress",
                    "remote_ip_prefix": null,
                    "protocol": null,
                    "ethertype": "IPv6",
                    "tenant_id": "84b25ac10ed642cca484aa55c098e3aa",
                    "port_range_max": null,
                    "port_range_min": null,
                    "id": "47e05c14-1aa2-4355-aaf8-b57e18f98c9a",
"description": null,
                    "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967"
                },
                {
                    "remote_group_id": null,
                    "direction": "egress",
                    "remote_ip_prefix": null,
                    "protocol": null,
                    "ethertype": "IPv4",
                    "tenant_id": "84b25ac10ed642cca484aa55c098e3aa",
                    "port_range_max": null,
                    "port_range_min": null,
                    "id": "8a8a238b-fdb1-4321-b667-26205c7f37d1",
"description": null,                    "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967"
                },
                {
                    "remote_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967",
                    "direction": "ingress",
                    "remote_ip_prefix": null,
                    "protocol": null,
                    "ethertype": "IPv4",
                    "tenant_id": "84b25ac10ed642cca484aa55c098e3aa",
                    "port_range_max": null,
                    "port_range_min": null,
                    "id": "b5874440-84a0-4382-8e37-3f012b90b71e",
"description": null,                    "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967"
                }
            ],
            "id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967"
        }
    ]
}

Error Code

See section Return Code Processing.