Skip to main content
GET
/
cloud
/
v1
/
instances
/
{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.instances.list(
    project_id=1,
    region_id=1,
)
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "addresses": {},
      "blackhole_ports": [
        {
          "AlarmEnd": "2023-11-07T05:31:56Z",
          "AlarmStart": "2023-11-07T05:31:56Z",
          "AlarmState": "ACK_REQ",
          "AlertDuration": "<string>",
          "DestinationIP": "<string>",
          "ID": 123
        }
      ],
      "created_at": "2023-11-07T05:31:56Z",
      "creator_task_id": "<string>",
      "ddos_profile": {
        "fields": [
          {
            "base_field": 10,
            "default": null,
            "description": "ARK server ports. Valid port values are in range 1000-65535",
            "field_name": "ARK Ports",
            "field_type": null,
            "field_value": "<unknown>",
            "id": 123,
            "name": "<string>",
            "required": true,
            "validation_schema": "<unknown>",
            "value": null
          }
        ],
        "id": 123,
        "options": {
          "active": true,
          "bgp": true
        },
        "profile_template": {
          "description": "description",
          "fields": [
            {
              "default": null,
              "description": "ARK server ports. Valid port values are in range 1000-65535",
              "field_type": null,
              "id": 123,
              "name": "<string>",
              "required": true,
              "validation_schema": "<unknown>"
            }
          ],
          "id": 123,
          "name": "<string>"
        },
        "profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
        "protocols": [
          {
            "port": "80",
            "protocols": [
              "TCP",
              "HTTP"
            ]
          },
          {
            "port": "53",
            "protocols": [
              "UDP"
            ]
          }
        ],
        "site": "ED",
        "status": {
          "error_description": "",
          "status": "Updated"
        }
      },
      "fixed_ip_assignments": [
        {
          "external": true,
          "ip_address": "<string>",
          "subnet_id": "<string>"
        }
      ],
      "flavor": {
        "architecture": "<string>",
        "flavor_id": "<string>",
        "flavor_name": "<string>",
        "hardware_description": {
          "ram": "<string>",
          "vcpus": "<string>"
        },
        "os_type": "<string>",
        "ram": 123,
        "vcpus": 123
      },
      "id": "<string>",
      "instance_description": "Instance description",
      "instance_isolation": {
        "reason": "Suspicious activities"
      },
      "name": "<string>",
      "project_id": 123,
      "region": "<string>",
      "region_id": 123,
      "security_groups": [
        {
          "name": "<string>"
        }
      ],
      "ssh_key_name": "<string>",
      "status": "ACTIVE",
      "tags": [
        {
          "key": "<string>",
          "read_only": true,
          "value": "<string>"
        }
      ],
      "task_id": null,
      "task_state": "<string>",
      "vm_state": "active",
      "volumes": [
        {
          "delete_on_termination": true,
          "id": "<string>"
        }
      ]
    }
  ]
}

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

available_floating
boolean

Only show instances which are able to handle floating address Only show instances which are able to handle floating address

changes-before
string<date-time>

Filters the instances by a date and time stamp when the instances last changed. Filters the instances by a date and time stamp when the instances last changed.

changes-since
string<date-time>

Filters the instances by a date and time stamp when the instances last changed status. Filters the instances by a date and time stamp when the instances last changed status.

exclude_flavor_prefix
string

Exclude instances with specified flavor prefix Exclude instances with specified flavor prefix

exclude_secgroup
string

Exclude instances with specified security group name Exclude instances with specified security group name

flavor_id
string

Filter out instances by flavor_id. Flavor id must match exactly. Filter out instances by flavor_id. Flavor id must match exactly.

flavor_prefix
string

Filter out instances by flavor_prefix. Filter out instances by flavor_prefix.

include_ai
boolean
default:false
deprecated

Include GPU clusters' servers Include GPU clusters' servers

include_baremetal
boolean
default:false
deprecated

Include bare metal servers. Please, use GET /v1/bminstances/ instead Include bare metal servers. Please, use GET /v1/bminstances/ instead

include_k8s
boolean
default:true

Include managed k8s worker nodes Include managed k8s worker nodes

ip
string

An IPv4 address to filter results by. Note: partial matches are allowed. For example, searching for 192.168.0.1 will return 192.168.0.1, 192.168.0.10, 192.168.0.110, and so on. An IPv4 address to filter results by. Note: partial matches are allowed. For example, searching for 192.168.0.1 will return 192.168.0.1, 192.168.0.10, 192.168.0.110, and so on.

limit
integer
default:1000

Optional. Limit the number of returned items Optional. Limit the number of returned items

Required range: x <= 1000
name
string

Filter instances by name. You can provide a full or partial name, instances with matching names will be returned. For example, entering 'test' will return all instances that contain 'test' in their name. Filter instances by name. You can provide a full or partial name, instances with matching names will be returned. For example, entering 'test' will return all instances that contain 'test' in their name.

offset
integer
default:0

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

Required range: x >= 0
only_isolated
boolean
default:false

Include only isolated instances Include only isolated instances

only_with_fixed_external_ip
boolean

Return bare metals only with external fixed IP addresses. Return bare metals only with external fixed IP addresses.

order_by
enum<string>
default:created.desc

Order by field and direction. Order by field and direction.

Available options:
created.asc,
created.desc,
name.asc,
name.desc,
status.asc,
status.desc
profile_name
string

Filter result by ddos protection profile name. Effective only with with_ddos set to true. Filter result by ddos protection profile name. Effective only with with_ddos set to true.

protection_status
enum<string>

Filter result by DDoS protection_status. if parameter is provided. Effective only with with_ddos set to true. (Active, Queued or Error) Filter result by DDoS protection_status. if parameter is provided. Effective only with with_ddos set to true. (Active, Queued or Error)

Available options:
Active,
Queued,
Error
status
enum<string>

Filters instances by status. Filters instances by status.

Available options:
ACTIVE,
BUILD,
ERROR,
HARD_REBOOT,
MIGRATING,
PAUSED,
REBOOT,
REBUILD,
RESIZE,
REVERT_RESIZE,
SHELVED,
SHELVED_OFFLOADED,
SHUTOFF,
SOFT_DELETED,
SUSPENDED,
VERIFY_RESIZE
tag_key_value
string

Optional. Filter by tag key-value pairs. Optional. Filter by tag key-value pairs.

tag_value
string[]

Optional. Filter by tag values. ?tag_value=value1&tag_value=value2 Optional. Filter by tag values. ?tag_value=value1&tag_value=value2

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

Required string length: 1 - 255
type_ddos_profile
enum<string>

Return bare metals either only with advanced or only basic DDoS protection. Effective only with with_ddos set to true. (advanced or basic) Return bare metals either only with advanced or only basic DDoS protection. Effective only with with_ddos set to true. (advanced or basic)

Available options:
basic,
advanced
uuid
string

Filter the server list result by the UUID of the server. Allowed UUID part Filter the server list result by the UUID of the server. Allowed UUID part

Maximum string length: 36
with_ddos
boolean
default:false

Include DDoS profile information in the response when set to true. Otherwise, the ddos_profile field in the response is null by default. Include DDoS profile information in the response when set to true. Otherwise, the ddos_profile field in the response is null by default.

with_interfaces_name
boolean
default:false

Include interface_name in the addresses Include interface_name in the addresses

Response

200 - application/json

OK

count
integer
required

Number of objects

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

Objects