List Security Groups
Returns security groups and their rules for the authenticated user.
Security groups control inbound and outbound traffic to your instances.
Endpoint
GET /cloud/v1/network/security_groups/listExample
curl https://api.redu.cloud/cloud/v1/network/security_groups/list \
-H "x-api-key: YOUR_API_KEY"Successful Response
This endpoint returns an array of security groups. Each security group includes security_group_rules.
[
{
"id": "1c62ad45-128d-45d9-b164-6cefdf5e8739",
"name": "john-default-access",
"stateful": true,
"tenant_id": "719015812e824d5b874b4190dde8f43c",
"project_id": "719015812e824d5b874b4190dde8f43c",
"description": "Allow SSH, HTTP, and HTTPS access",
"shared": false,
"security_group_rules": [
{
"id": "0e01f13b-a7d0-4690-9d77-ec31ec5e75b8",
"security_group_id": "1c62ad45-128d-45d9-b164-6cefdf5e8739",
"ethertype": "IPv4",
"direction": "ingress",
"protocol": "tcp",
"port_range_min": 22,
"port_range_max": 22,
"remote_ip_prefix": null
},
{
"id": "430d3608-fc80-4f2e-9ea3-5644ce5b3c0a",
"security_group_id": "1c62ad45-128d-45d9-b164-6cefdf5e8739",
"ethertype": "IPv4",
"direction": "ingress",
"protocol": "tcp",
"port_range_min": 80,
"port_range_max": 80,
"remote_ip_prefix": null
},
{
"id": "b5506f73-3721-40b9-aba0-c4e62af48743",
"security_group_id": "1c62ad45-128d-45d9-b164-6cefdf5e8739",
"ethertype": "IPv4",
"direction": "egress",
"protocol": null,
"port_range_min": null,
"port_range_max": null,
"remote_ip_prefix": null
}
]
},
{
"id": "42fb786d-0372-42e3-9e53-8770cb36639f",
"name": "default",
"stateful": true,
"tenant_id": "719015812e824d5b874b4190dde8f43c",
"project_id": "719015812e824d5b874b4190dde8f43c",
"description": "Default security group",
"shared": false,
"security_group_rules": [
{
"id": "c7a4ae46-d2f3-47b0-a244-adfa5f313d8e",
"security_group_id": "42fb786d-0372-42e3-9e53-8770cb36639f",
"ethertype": "IPv4",
"direction": "ingress",
"protocol": null,
"port_range_min": null,
"port_range_max": null,
"remote_ip_prefix": null,
"remote_group_id": "42fb786d-0372-42e3-9e53-8770cb36639f"
}
]
}
]Notes
- If
remote_ip_prefixisnull, the rule is not restricted to a CIDR (commonly interpreted as “anywhere”, depending on other rule fields). - For egress rules,
protocoland port ranges may benullto represent “allow all”.
Response Schema
SecurityGroup
| Field | Type | Description |
|---|---|---|
| id | string | Security group ID |
| name | string | Security group name |
| description | string | Description |
| stateful | boolean | Whether the group is stateful |
| shared | boolean | Whether the group is shared |
| tenant_id | string | Tenant ID (legacy OpenStack field) |
| project_id | string | Project ID |
| security_group_rules | SecurityGroupRule[] | List of rules |
SecurityGroupRule
| Field | Type | Description |
|---|---|---|
| id | string | Rule ID |
| security_group_id | string | Parent security group ID |
| ethertype | string | IPv4 or IPv6 |
| direction | string | ingress or egress |
| protocol | string | null |
| port_range_min | integer | null |
| port_range_max | integer | null |
| remote_ip_prefix | string | null |
| remote_group_id | string | null |
Errors
401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}403 Forbidden
The API key does not have access to the requested project.