Skip to main content
GET
/
cloud
/
v1
/
securitygroups
/
{project_id}
/
{region_id}
Python
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=1,
    region_id=1,
)
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "name": "<string>",
      "project_id": 123,
      "region": "<string>",
      "region_id": 123,
      "revision_number": 123,
      "tags_v2": [
        {
          "key": "<string>",
          "read_only": true,
          "value": "<string>"
        }
      ],
      "updated_at": "2023-11-07T05:31:56Z",
      "description": "Some description",
      "security_group_rules": [
        {
          "created_at": "2023-11-07T05:31:56Z",
          "direction": "egress",
          "id": "<string>",
          "revision_number": 123,
          "security_group_id": "<string>",
          "updated_at": "2023-11-07T05:31:56Z",
          "description": "Some description",
          "ethertype": "IPv4",
          "port_range_max": 80,
          "port_range_min": 80,
          "protocol": "tcp",
          "remote_group_id": "<string>",
          "remote_ip_prefix": "10.0.0.0/8"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID Project ID

region_id
integer
required

Region ID Region ID

Query Parameters

limit
integer
default:10

Limit of items on a single page Limit of items on a single page

Required range: x <= 1000
offset
integer
default:0

Offset in results list Offset in results list

Required range: x >= 0
tag_key
string[]

Optional. Filter by tag keys. Optional. Filter by tag keys.

Tag key. The maximum size for a key is 255 characters.

Required string length: 1 - 255
tag_key_value
string

Optional. Filter by tag key-value pairs. Must be a valid JSON string. Optional. Filter by tag key-value pairs. Must be a valid JSON string.

Response

200 - application/json

OK

count
integer
required

Number of objects

Required range: x >= 0
results
SecurityGroupSerializer · object[]
required

Objects