GET
/
cloud
/
v1
/
securitygroups
/
{project_id}
/
{region_id}
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
page = client.cloud.security_groups.list(
    project_id=0,
    region_id=0,
)
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "created_at": "2019-06-18T11:56:16+0000",
      "description": "Some description",
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "my_security_group",
      "project_id": 1337,
      "region": "Luxembourg 1",
      "region_id": 7,
      "revision_number": 1,
      "security_group_rules": [
        {
          "created_at": "2019-06-18T11:56:16+0000",
          "description": "Some description",
          "direction": "egress",
          "ethertype": "IPv4",
          "id": "00000000-0000-4000-8000-000000000000",
          "port_range_max": 80,
          "port_range_min": 80,
          "protocol": "tcp",
          "remote_group_id": [
            "00000000-0000-4000-8000-000000000000"
          ],
          "remote_ip_prefix": "10.0.0.0/8",
          "revision_number": 0,
          "security_group_id": "00000000-0000-4000-8000-000000000000",
          "updated_at": "2019-06-18T11:57:00+0000"
        }
      ],
      "tags_v2": [
        {
          "key": "my-tag",
          "read_only": false,
          "value": "my-tag-value"
        }
      ],
      "updated_at": "2019-06-18T11:57:00+0000"
    }
  ]
}

Authorizations

APIKey
string
header
required

API key for authentication.

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

Query Parameters

limit
integer

Limit the number of returned limit request entities.

offset
integer

Offset value is used to exclude the first set of records from the result.

tag_key
string[]

Filter by tag keys.

tag_key_value
string

Filter by tag key-value pairs. Must be a valid JSON string. curl -G --data-urlencode "tag_key_value={"key": "value"}" --url "http://localhost:1111/v1/securitygroups/1/1"

Response

200 - application/json

List of security groups

The response is of type object.