Chuyển tới nội dung chính

Listing Images

GET /v2/images

List virtual machine images.

Request

Query parameters

NameInTypeDescription
created_at (Optional)querystringSpecify a comparison filter based on the date and time when the resource was created. Format: ISO 8601 (e.g. 2015-08-27T09:49:58-05:00). If time zone is omitted UTC is assumed.
limit (Optional)queryintegerRequests a page size of items. Use with marker for pagination.
marker (Optional)querystringThe ID of the last-seen item for pagination.
member_status (Optional)querystringFilters by member status. Valid values: accepted, pending, rejected, all. Default is accepted.
name (Optional)querystringFilter by image name.
os_hidden (Optional)querybooleanWhen true, include images marked as hidden. New in version 2.7.
owner (Optional)querystringFilter by project (tenant) ID; shows images shared by the specified owner.
protected (Optional)querybooleanFilter by protected property. Valid values: true, false. Any other value returns 400.
size_max (Optional)querystringMaximum image size (bytes).
size_min (Optional)querystringMinimum image size (bytes).
status (Optional)queryintegerFilter by image status (e.g. active).
tag (Optional)querystringFilter by tag value. Can be repeated; queries are conjunctive (images must contain all specified tags).
updated_at (Optional)querystringSpecify a comparison filter based on the date and time when the resource was last modified. Format: ISO 8601.
visibility (Optional)querystringFilter by visibility. Valid values: public, private, community, shared, all. If omitted, the response shows public, private, and shared images with member status accepted.
sort_dir (Optional)querystringSort direction: asc or desc. Default direction is desc.
sort_key (Optional)querystringSort by attribute (e.g. name, id, updated_at). Default is created_at.
sort (Optional)querystringCombined sort key and direction. Multiple pairs allowed, comma-separated. Example: sort=name:asc,status:desc.

Example request

Using curl

curl -ks -H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:9292/v2/images

Using HTTP request

GET https://api.vietnix.cloud:9292/v2/images

Response

Parameters

NameTypeDescription
imagesarrayA list of image objects.
firststringThe URI for the first page of response.
nextstringThe URI for the next page of response. Not present on the last page.
schemastringThe URL for the schema describing a virtual machine image.

Common fields inside each image object:

NameTypeDescription
idstringImage ID.
namestringHuman-readable image name.
statusstringImage status (e.g. active).
visibilitystringVisibility (public, private, shared, ...).
ownerstringProject (tenant) ID that owns the image.
sizeintegerImage size in bytes.
min_ramintegerMinimum RAM required (MB).
min_diskintegerMinimum disk required (GB).
created_atstringCreation time (ISO 8601).
updated_atstringLast update time (ISO 8601) or null.
protectedbooleanWhether the image is protected.
tagsarrayA list of tag strings.
checksumstringImage checksum.
disk_formatstringDisk format (e.g. qcow2, raw).
container_formatstringContainer format (e.g. bare).
os_typestringOS type (e.g. linux, windows).
os_distrostringOS distribution.
os_hash_algostringHash algorithm used (e.g. sha512).
os_hash_valuestringHash value.
filestringURL path to the image file (relative to the API).
direct_urlstringDirect URL to the image file, if available.

Sample Response

{
"images": [
{
"os_distro": "fedora42",
"os_admin_user": "root",
"hci_allow_set_password": "True",
"image_validated": "yes",
"name": "Fedora-42-x64",
"disk_format": "qcow2",
"container_format": "bare",
"visibility": "public",
"size": 2189361152,
"virtual_size": 5368709120,
"status": "active",
"checksum": "b372bf54310cc7015035bb45f3867520",
"protected": false,
"min_ram": 0,
"min_disk": 5,
"owner": "a430f930af8e47d7a1820a477129c343",
"os_hidden": false,
"os_hash_algo": "sha512",
"os_hash_value": "8d4281f665bce5594f7f485df224e21c48362d42019f2dfe17c1a4c9086dbfd43a8725cd06809d3582d30d88e887c6da623f8e16c211c242acf61d5bcfd6e6af",
"id": "5f8ee89a-de28-4d4d-9a96-707b0393ee37",
"created_at": "2025-10-02T08:30:39Z",
"updated_at": "2025-10-02T08:44:31Z",
"direct_url": "file:///mnt/vstorage/vols/datastores/glance/5f8ee89a-de28-4d4d-9a96-707b0393ee37",
"tags": [],
"self": "/v2/images/5f8ee89a-de28-4d4d-9a96-707b0393ee37",
"file": "/v2/images/5f8ee89a-de28-4d4d-9a96-707b0393ee37/file",
"schema": "/v2/schemas/image"
}
]
}

Status codes

Success

Status CodeDescription
200 - OKRequest was successful.

Error

Status CodeDescription
400 - Bad RequestSome content in the request was invalid.
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.