Creates a metadata record of a virtual machine (VM) image and optionally stores the image data.
Image metadata fields are passed as HTTP headers prefixed with one of
the strings x-image-meta-
or x-image-meta-property-
. See the
API documentation for details.
If there is no request body, an image record will be created in status
queued
. This is called reserving an image. The image data can be
uploaded later using the Update image call.
If image data will be uploaded as part of this request, then the following image metadata must be included among the request headers:
name
disk_format
container_format
Additionally, if image data is uploaded as part of this request, the API will return a 400 under the following circumstances:
x-image-meta-size
header is present and the length in bytes of
the request body does not match the value of this header.x-image-meta-checksum
header is present and MD5 checksum generated
by the backend store while storing the data does not match the value of
this header.Normal response codes: 201
Error response codes: 400, 409
Name | In | Type | Description |
---|---|---|---|
image data | body | binary | The virtual machine image data. Do not include this if you are only reserving an image. |
x-image-meta-name | header | string | The image An image name is not required to be unique, though of course it will be easier to tell your images apart if you give them distinct descriptive names. Names are limited to 255 chars. |
x-image-meta-container_format | header | enum | The image A container format defines the file format of the
file that contains the image and metadata about the actual VM.
For a VM image with a
|
x-image-meta-disk_format | header | enum | The image The disk format of a VM image is the format of the underlying disk image. Virtual appliance vendors have different formats for laying out the information contained in a VM disk image. You can set the disk format for your image to one of these values:
|
Name | In | Type | Description |
---|---|---|---|
location | header | string | A URI location for the image record. |
image | body | object | A JSON representation of the image. Includes all metadata fields. |
HTTP/1.1 100 Continue HTTP/1.1 201 Created Content-Type: application/json Content-Length: 491 Location: http://glance.openstack.example.org/v1/images/de2f2211-3ac7-4260-9142-41db0ecfb425 Etag: 7b1b10607acc1319506185e7227ca30d X-Openstack-Request-Id: req-70adeab4-740c-4db3-a002-fd1559ecf40f Date: Tue, 10 May 2016 21:41:41 GMT
{
"image": {
"checksum": "7b1b10607acc1319506185e7227ca30d",
"container_format": "bare",
"created_at": "2016-05-10T21:41:41.000000",
"deleted": false,
"deleted_at": null,
"disk_format": "raw",
"id": "de2f2211-3ac7-4260-9142-41db0ecfb425",
"is_public": false,
"min_disk": 0,
"min_ram": 0,
"name": "Fake Image",
"owner": "c60b1d57c5034e0d86902aedf8c49be0",
"properties": {},
"protected": false,
"size": 3908,
"status": "active",
"updated_at": "2016-05-10T21:41:41.000000",
"virtual_size": null
}
}
This is an extreme example of reserving an image. It was created by a POST with no headers specified and no data passed. Here’s the response:
HTTP/1.1 201 Created Content-Type: application/json Content-Length: 447 Location: http://glance.openstack.example.org/v1/images/6b3ecfca-d445-4946-a8d1-c4938352b251 X-Openstack-Request-Id: req-db1ff3c7-3d4f-451f-9ef1-c414343f809d Date: Tue, 10 May 2016 21:35:14 GMT
{
"image": {
"checksum": null,
"container_format": null,
"created_at": "2016-05-10T21:35:15.000000",
"deleted": false,
"deleted_at": null,
"disk_format": null,
"id": "6b3ecfca-d445-4946-a8d1-c4938352b251",
"is_public": false,
"min_disk": 0,
"min_ram": 0,
"name": null,
"owner": "c60b1d57c5034e0d86902aedf8c49be0",
"properties": {},
"protected": false,
"size": 0,
"status": "queued",
"updated_at": "2016-05-10T21:35:15.000000",
"virtual_size": null
}
}
Lists all VM images available to the user making the call. This list will include all public images, any images owned by the requestor, and any images shared with the requestor.
Various query filters can be applied to the URL to restrict the content of the response.
Normal response codes: 200
Error response codes: 400, 403
Note
need to add info about sorting and pagination
Name | In | Type | Description |
---|---|---|---|
name (Optional) | query | string | Filters the image list by an image name, in string format. |
container_format (Optional) | query | string | Filters the image list by a container format. A
valid value is aki , ami , ari , bare , docker ,
ova , or ovf . |
disk_format (Optional) | query | string | Filters the image list by a disk format. A valid
value is aki , ami , ari , iso , qcow2 , raw ,
vhd , vdi , or vmdk . |
status (Optional) | query | string | Filters the image list by a status. A valid value is queued ,
saving , active , killed , deleted , or pending_delete . |
size_min (Optional) | query | int | Filters the image list by a minimum image size, in bytes. |
size_max (Optional) | query | int | Filters the image list by a maximum image size, in bytes. |
changes-since (Optional) | query | string | Filters the image list to those images that have changed since a time stamp value. |
Name | In | Type | Description |
---|---|---|---|
images | body | array | A list of image objects in a sparse representation. Each object contains the following fields:
|
{
"images": [
{
"checksum": "eb9139e4942121f22bbc2afc0400b2a4",
"container_format": "ovf",
"disk_format": "vmdk",
"id": "008cc101-c3ee-40dd-8477-cd8d99dcbf3d",
"name": "Harry",
"size": 25165824
},
{
"...": "..."
}
]
}
Lists all available images with details.
Various query filters can be applied to the URL to restrict the content of the response.
Normal response codes: 200
Error response codes: 400, 403
Note
need to add info about sorting and pagination
Name | In | Type | Description |
---|---|---|---|
name (Optional) | query | string | Filters the image list by an image name, in string format. |
container_format (Optional) | query | string | Filters the image list by a container format. A
valid value is aki , ami , ari , bare , docker ,
ova , or ovf . |
disk_format (Optional) | query | string | Filters the image list by a disk format. A valid
value is aki , ami , ari , iso , qcow2 , raw ,
vhd , vdi , or vmdk . |
status (Optional) | query | string | Filters the image list by a status. A valid value is queued ,
saving , active , killed , deleted , or pending_delete . |
size_min (Optional) | query | int | Filters the image list by a minimum image size, in bytes. |
size_max (Optional) | query | int | Filters the image list by a maximum image size, in bytes. |
changes-since (Optional) | query | string | Filters the image list to those images that have changed since a time stamp value. |
Name | In | Type | Description |
---|---|---|---|
images | body | array | A list of image objects. Each object contains the following fields:
|
previous (Optional) | body | string | Show the previous item in the list. |
next (Optional) | body | string | Show the next item in the list. |
{
"images": [
{
"checksum": "eb9139e4942121f22bbc2afc0400b2a4",
"container_format": "bare",
"created_at": "2016-03-15T15:09:07.000000",
"deleted": false,
"deleted_at": null,
"disk_format": "vmdk",
"id": "1086fa65-8c63-4081-9a0a-ddf7e88e485b",
"is_public": false,
"min_disk": 22,
"min_ram": 11,
"name": "Silas Marner",
"owner": "c60b1d57c5034e0d86902aedf8c49be0",
"properties": {
"foo": "bar",
"qe_status": "approved"
},
"protected": false,
"size": 25165824,
"status": "active",
"updated_at": "2016-05-10T21:14:04.000000",
"virtual_size": null
},
{
"...": "..."
}
]
}
Updates the metadata for an image or uploads an image file.
Image metadata is updated by passing HTTP headers prefixed with one of the
strings x-image-meta-
or x-image-meta-property-
. See the API
documentation for details.
If the image is in queued
status, image data may be added by
including it in the request body. Otherwise, attempting to add data
will result in a 409 Conflict response.
If the request contains a body, the API will return a 400 under the following circumstances:
x-image-meta-size
header is present and the length in bytes of
the request body does not match the value of this header.x-image-meta-checksum
header is present and MD5 checksum generated
by the backend store while storing the data does not match the value of
this header.Normal response codes: 200
Error response codes: 400, 404, 409
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
Name | In | Type | Description |
---|---|---|---|
image | body | object | A JSON representation of the image. Includes all metadata fields. |
{
"image": {
"checksum": "eb9139e4942121f22bbc2afc0400b2a4",
"container_format": "bare",
"created_at": "2016-03-15T15:09:07.000000",
"deleted": false,
"deleted_at": null,
"disk_format": "vmdk",
"id": "1086fa65-8c63-4081-9a0a-ddf7e88e485b",
"is_public": false,
"min_disk": 22,
"min_ram": 11,
"name": "Silas Marner",
"owner": "c60b1d57c5034e0d86902aedf8c49be0",
"properties": {
"foo": "bar",
"qe_status": "approved"
},
"protected": false,
"size": 25165824,
"status": "active",
"updated_at": "2016-05-10T21:14:04.000000",
"virtual_size": null
}
}
Returns the image metadata as headers; the image data is returned in the body of the response.
Standard image properties are returned in headers prefixed by
x-image-meta-
(for example, x-image-meta-name
). Custom image
properties are returned in headers prefixed by the string
x-image-meta-property-
(for example, x-image-meta-property-foo
).
Normal response codes: 200
Error response codes: 404, 403
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
Returns the image metadata information as response headers.
The Image system does not return a response body for the HEAD operation.
If the request succeeds, the operation returns the 200
response
code.
Normal response codes: 200
Error response codes: 404, 409
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
X-Image-Meta-Checksum: 8a40c862b5735975d82605c1dd395796 X-Image-Meta-Container_format: aki X-Image-Meta-Created_at: 2016-01-06T03:22:20.000000 X-Image-Meta-Deleted: false X-Image-Meta-Disk_format: aki X-Image-Meta-Id: 03bc0a8b-659c-4de9-b6bd-13c6e86e6455 X-Image-Meta-Is_public: true X-Image-Meta-Min_disk: 0 X-Image-Meta-Min_ram: 0 X-Image-Meta-Name: cirros-0.3.4-x86_64-uec-kernel X-Image-Meta-Owner: 13cc6052265b41529e2fd0fc461fa8ef X-Image-Meta-Protected: false X-Image-Meta-Size: 4979632 X-Image-Meta-Status: deactivated X-Image-Meta-Updated_at: 2016-02-25T03:02:05.000000 X-Openstack-Request-Id: req-d5208320-28ed-4c22-b628-12dc6456d983
Deletes an image.
Normal response codes: 204
Error response codes: 404, 403
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
Image sharing provides a means for one tenant (the “producer”) to make a private image available to other tenants (the “consumers”). This ability can unfortunately be misused to spam tenants’ image lists, so these calls may not be exposed in some deployments. (The Images v2 API has a more sophisticated sharing scheme that contains an anti-spam provision.)
Adds the tenant whose tenant ID is member_id
as a member of the
image denoted by image_id
.
By default, an image member cannot further share the image with other
tenants. This behavior can be overridden by supplying a request body
with the call that specifies can_share
as true
.
Thus:
can_share
attribute set to false
.can_share
attribute will be set
to the appropriate boolean value you have supplied in the request body.can_share
attribute) remains
unmodified.can_share
attribute of the tenant will be set to whatever
value is specified in the request body.Normal response codes: 204
Error response codes: 404
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
member_id | path | string | The tenant ID of the tenant with whom an image is shared, that is, the tenant ID of the image member. |
can_share (Optional) | body | boolean | Indicates whether the image member whose tenant ID is member_id
is authorized to share the image. If the member can share the image,
this value is true . Otherwise, this value is false . |
member_id | body | string | The tenant ID of the tenant with whom an image is shared, that is, the tenant ID of the image member. |
{
"member_id": "eb5d80bd5f1e49f1818988148c70eabf",
"can_share": false
}
Replaces the membership list for an image so that the tenants whose
tenant IDs are listed in the member objects comprising the request body
become all and only the members of the image denoted by image_id
.
If the can_share
attribute is omitted for in any member object:
can_share
setting remains unchanged.can_share
attribute is set to false
.Normal response codes: 204
Error response codes: 404
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
memberships | body | array | List of image member objects. |
{
"memberships": [
{
"member_id": "eb5d80bd5f1e49f1818988148c70eabf",
"can_share": false
},
{
"member_id": "8f450f44647d4080a0e7ca505057b5ca",
"can_share": false
}
]
}
Removes a member from an image.
Normal response codes: 204
Error response codes: 404
Name | In | Type | Description |
---|---|---|---|
image_id | path | string | Image ID stored through the image API. Typically a UUID. |
member_id | path | string | The tenant ID of the tenant with whom an image is shared, that is, the tenant ID of the image member. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.