Skip to main content
PATCH
/
cloud
/
v1
/
images
/
{project_id}
/
{region_id}
/
{image_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
)
image = client.cloud.instances.images.update(
    image_id="image_id",
    project_id=0,
    region_id=0,
)
print(image.id)
{
  "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
}

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

region_id
integer
required

Region ID

image_id
string
required

Image ID

Body

application/json
hw_firmware_type
enum<string>

Specifies the type of firmware with which to boot the guest.

Available options:
bios,
uefi
Example:

"bios"

hw_machine_type
enum<string>

A virtual chipset type.

Available options:
pc,
q35
Example:

"q35"

is_baremetal
boolean

Set to true if the image will be used by bare metal servers.

Example:

false

name
string

Image display name

Example:

"my-image"

os_type
enum<string>

The operating system installed on the image.

Available options:
linux,
windows
Example:

"linux"

ssh_key
enum<string>

Whether the image supports SSH key or not

Available options:
allow,
deny,
required
Example:

"allow"

tags
UpdateTagsSerializer · object

Key-value tags to associate 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. Both tag keys and values have a maximum length of 255 characters. 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.

Example:
{ "my-tag": "my-tag-value" }

Response

Returned image

created_at
string<date-time>
required

Datetime when the image was created

Example:

"2024-05-05T14:51:26.570866Z"

disk_format
string
required

Disk format

Example:

"raw"

id
string
required

Image ID

Example:

"44e136a7-15c1-4b5f-a086-20b7b3237d40"

min_disk
integer
required

Minimal boot volume required

Example:

3

min_ram
integer
required

Minimal VM RAM required

Example:

0

name
string
required

Image display name

Example:

"ubuntu-20.10-x64"

os_distro
string
required

OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.

Example:

"ubuntu"

os_type
enum<string>
required

The operating system installed on the image.

Available options:
linux,
windows
Example:

"linux"

os_version
string
required

OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian

Example:

"20.10"

project_id
integer
required

Project ID

Example:

1337

region
string
required

Region name

Example:

"Luxembourg 1"

region_id
integer
required

Region ID

Example:

7

size
integer
required

Image size in bytes

Example:

2361393152

status
string
required

Image status, i.e. active

Example:

"active"

tags
TagSerializer · object[]
required

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.

Example:
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
updated_at
string<date-time>
required

Datetime when the image was updated

Example:

"2024-05-05T14:51:26.570866Z"

visibility
string
required

Image visibility. Globally visible images are public

Example:

"public"

architecture
enum<string>
default:x86_64

An image architecture type: aarch64, x86_64

Available options:
aarch64,
x86_64
Example:

"x86_64"

creator_task_id
string | null

Task that created this entity

Example:

"b10dd116-07f5-4225-abb7-f42da5cb78fb"

description
string | null

Image description

Example:

"string"

display_order
integer | null
Example:

2010

gpu_driver
string | null

Name of the GPU driver vendor

Example:

"nvidia"

gpu_driver_type
string | null

Type of the GPU driver

Example:

"open"

gpu_driver_version
string | null

Version of the installed GPU driver

Example:

"570.148.08"

hw_firmware_type
enum<string> | null

Specifies the type of firmware with which to boot the guest.

Available options:
bios,
uefi
Example:

"bios"

hw_machine_type
enum<string> | null

A virtual chipset type.

Available options:
pc,
q35
Example:

"q35"

is_baremetal
boolean | null
default:false

Set to true if the image will be used by bare metal servers. Defaults to false.

Example:

false

ssh_key
enum<string> | null

Whether the image supports SSH key or not

Available options:
allow,
deny,
required
Example:

"allow"

task_id
string | null

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.

Example:

null