Updating images
PATCH /v2/images/{image_id}
Change image name, OS distribution, minimal disk size, placement, and shared status of an image with the specified ID.
info
Request
Headers
| Name | In | Type | Description |
|---|---|---|---|
Content-Type | header | string | The media type descriptor for the request body. Use application/openstack-images-v2.1-json-patch. |
Path parameters
| Name | In | Type | Description |
|---|---|---|---|
image_id | path | string | The UUID of the image. |
Example request
Using curl
curl -ks -X PATCH \
-H 'Content-Type: application/openstack-images-v2.1-json-patch' \
-H 'X-Auth-Token: gAAAAA<...>' -d '
[
{
"op": "replace",
"path": "/name",
"value": "alpine-api"
},
{
"op": "add",
"path": "/os_distro",
"value": "genericlinux"
},
{
"op": "replace",
"path": "/min_disk",
"value": 5
}
]'
https://api.vietnix.cloud:9292/v2/images/c92d820c-50dc-4fd1-a0bc-2f1071487b67
Using HTTP request
PATCH https://api.vietnix.cloud:9292/v2/images/{image_id}
Content-Type: application/openstack-images-v2.1-json-patch
X-Auth-Token: <token>
[ JSON Patch body ]
Notes: os_distro values
The os_distro parameter can be one of the following values.
Linux distributions:
genericlinux— Generic Linuxcentos8,centos7,centos6rhel9,rhel8,rhel7ubuntu22.04,ubuntu20.04,ubuntu18.04,ubuntu16.04debian10,debian9rockylinux9,rockylinux8almalinux9,almalinux8
Windows distributions:
genericwindows— Generic Windowswin2k22,win2k19,win2k16,win2k12r2,win2k12,win2k8r2win10,win81,win7
Response
Parameters
| Name | In | Type | Description |
|---|---|---|---|
checksum | body | string | Hash that is used over the image data. May be null. |
container_format | body | enum | Format of the image container (e.g. bare, ami, ovf). May be null. |
created_at | body | string | Date/time when the resource was created (ISO 8601). |
disk_format | body | enum | Disk format (e.g. qcow2, raw, vmdk). May be null. |
file | body | string | The URL for the virtual machine image file (relative path). |
id | body | string | Image UUID. |
min_disk | body | integer | Amount of disk space in GB required to boot the image. May be null. |
min_ram | body | integer | Amount of RAM in MB required to boot the image. May be null. |
name | body | string | The name of the image. May be null. |
os_hash_algo | body | string | Algorithm used to compute secure hash for the image (new in 2.7). May be null. |
os_hash_value | body | string | Hexdigest of the secure hash computed using os_hash_algo (new in 2.7). May be null. |
os_hidden | body | boolean | If true, image is hidden from default image-list responses (new in 2.7). |
owner | body | string | Identifier for the owner (project/tenant ID). May be null. |
protected | body | boolean | If true, image cannot be deleted. |
schema | body | string | URL for the image schema. |
self | body | string | The URL for the virtual machine image. |
size | body | integer | Size of the image data in bytes. May be null. |
status | body | string | Image status (e.g. active). |
tags | body | array | List of tags for this image, possibly empty. |
updated_at | body | string | Date/time when the resource was updated (ISO 8601) or null. |
virtual_size | body | integer | Virtual size of the image. May be null. |
visibility | body | string | Image visibility (e.g. public, private, shared). |
direct_url (Optional) | body | string | Direct URL to the image file in external store. Present only if show_image_direct_url is enabled on the Image service. |
locations (Optional) | body | array | Array of location objects (each contains url and metadata) when show_multiple_locations is enabled on the Image service. |
Status codes
Success
| Status Code | Description |
|---|---|
| 200 - OK | Request was successful. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
| 404 - Not Found | The requested resource could not be found. |
| 409 - Conflict | This operation conflicted with another operation on this resource. |
| 413 - Request Entity Too Large | The request is larger than the server is willing or able to process. |
| 415 - Unsupported Media Type | The request entity has a media type the server does not support. |
Example response
{
"image_validated": "yes",
"os_distro": "genericlinux",
"name": "alpine-api",
"disk_format": "qcow2",
"container_format": "bare",
"visibility": "shared",
"size": 120061952,
"virtual_size": 127926272,
"status": "active",
"checksum": "7625f1f6a355d3a042a1f39b79ab3513",
"protected": false,
"min_ram": 0,
"min_disk": 5,
"owner": "f33507157a634f1cac71e06a70fb558e",
"os_hidden": false,
"os_hash_algo": "sha512",
"os_hash_value": "d0eec0ffc7c1c60dd1c3f42a653086825b3e4ddcf07f49475c31e35da53c5e3c0df7e962c6d570591c3d5e2f8587aef54e1b40a016d944bca3cbaedec8f7f213",
"id": "9775d86a-8bf8-4200-a4b5-d892e931e8f6",
"created_at": "2025-10-22T08:40:44Z",
"updated_at": "2025-10-22T10:18:38Z",
"direct_url": "file:///mnt/vstorage/vols/datastores/glance/9775d86a-8bf8-4200-a4b5-d892e931e8f6",
"tags": [],
"self": "/v2/images/9775d86a-8bf8-4200-a4b5-d892e931e8f6",
"file": "/v2/images/9775d86a-8bf8-4200-a4b5-d892e931e8f6/file",
"schema": "/v2/schemas/image"
}