import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
image_list = client.cloud.instances.images.list(
project_id=0,
region_id=0,
)
print(image_list.count){
"count": 1,
"results": [
{
"created_at": "2023-11-07T05:31:56Z",
"disk_format": "<string>",
"id": "<string>",
"min_disk": 123,
"min_ram": 123,
"name": "<string>",
"os_distro": "<string>",
"os_type": "linux",
"os_version": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"size": 123,
"status": "<string>",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "<string>",
"architecture": "x86_64",
"creator_task_id": "b10dd116-07f5-4225-abb7-f42da5cb78fb",
"description": "string",
"display_order": 2010,
"gpu_driver": "nvidia",
"gpu_driver_type": "open",
"gpu_driver_version": "570.148.08",
"hw_firmware_type": "bios",
"hw_machine_type": "q35",
"is_baremetal": false,
"ssh_key": "allow",
"task_id": null
}
]
}Retrieve a list of available images in the project and region. The list can be filtered by visibility, tags, and other parameters. Returned entities are owned by the project or are public/shared with the client.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
image_list = client.cloud.instances.images.list(
project_id=0,
region_id=0,
)
print(image_list.count){
"count": 1,
"results": [
{
"created_at": "2023-11-07T05:31:56Z",
"disk_format": "<string>",
"id": "<string>",
"min_disk": 123,
"min_ram": 123,
"name": "<string>",
"os_distro": "<string>",
"os_type": "linux",
"os_version": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"size": 123,
"status": "<string>",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "<string>",
"architecture": "x86_64",
"creator_task_id": "b10dd116-07f5-4225-abb7-f42da5cb78fb",
"description": "string",
"display_order": 2010,
"gpu_driver": "nvidia",
"gpu_driver_type": "open",
"gpu_driver_version": "570.148.08",
"hw_firmware_type": "bios",
"hw_machine_type": "q35",
"is_baremetal": false,
"ssh_key": "allow",
"task_id": null
}
]
}API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Show price
Any value to show private images
Filter by tag keys.
Filter by tag key-value pairs. Must be a valid JSON string.
Image visibility. Globally visible images are public
private, public, shared List of images
Number of objects
x >= 0Objects
Show child attributes
Datetime when the image was created
Disk format
Image ID
Minimal boot volume required
Minimal VM RAM required
Image display name
OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.
The operating system installed on the image.
linux, windows OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian
Project ID
Region name
Region ID
Image size in bytes
Image status, i.e. active
List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
Datetime when the image was updated
Image visibility. Globally visible images are public
An image architecture type: aarch64, x86_64
aarch64, x86_64 Task that created this entity
"b10dd116-07f5-4225-abb7-f42da5cb78fb"
Image description
"string"
2010
Name of the GPU driver vendor
"nvidia"
Type of the GPU driver
"open"
Version of the installed GPU driver
"570.148.08"
Specifies the type of firmware with which to boot the guest.
bios, uefi "bios"
A virtual chipset type.
pc, q35 "q35"
Set to true if the image will be used by bare metal servers. Defaults to false.
false
Whether the image supports SSH key or not
allow, deny, required "allow"
The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.
null
Was this page helpful?