List images¶
Overview¶
Lists IDs, names, and links for available images.
Classification¶
- List
API Operation Object¶
- images
Synchronous / Asynchronous¶
- -
Request¶
HTTP Request Method¶
- GET
HTTP Request Path¶
{api_endpoint}/v2/{tenant_id}/images
HTTP Request Header¶
Format¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json
HTTP Request Body¶
Format¶
- none
Request Parameter¶
name | style | format | description | required/optional |
---|---|---|---|---|
tenant_id | URI | UUID | The tenant ID in a multi-tenancy cloud. | required |
changes-since | Query | time/date |
|
optional |
server | Query | anyURI | Name of the server in URL format. | optional |
name | Query | String | Name of the image as a string. | optional |
status | Query | ImageStatus | Value of the status of the image so that you can filter on "ACTIVE" for example. | optional |
type | Query | String | Value of the type of image, such as snapshot or backup. | optional |
limit | Query | int | Requests a specified page size of returned items from the query. Returns a number of items up to the specified limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. | optional |
marker | Query | String | Specifies the ID of the last-seen item. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. | optional |
Response¶
HTTP Response Header¶
Format¶
HTTP/1.1 <response_code> <message> (ex. 200 OK)
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
- skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
HTTP Response Body¶
Format¶
{
"images": [
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>9",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
},
{
"id": "<id>",
"links": [
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>"
},
{
"href": "<href>",
"rel": "<rel>",
"type": "<type>"
}
],
"name": "<name>"
}
]
}
Response Parameter¶
item | format | description |
---|---|---|
X-Compute-Request-ID (Optional) | String | Returns a unique identifier to provide tracking for the request. The request ID that is associated with the request appears in the log lines for that request. By default, the middleware configuration ensures that the request ID appears in the log files. |
images | ImagesWithOnlyIDsNamesLinks | Image information. |
next (Optional) | anyURI | Moves to the next metadata item. |
previous (Optional) | anyURI | Moves to the previous metadata item. |
id | UUID | image id |
name | String | name of the image |
Sample API Request and Response¶
Sample API Request¶
Request URI¶
https://example.com/v2/{tenant_id}/images
Request Header¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json
Request Body¶
- none
Sample API Response¶
Response Header¶
HTTP/1.1 200 OK
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
- skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
Response Body¶
{
"images": [
{
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage7"
},
{
"id": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage123456"
},
{
"id": "a2459075-d96c-40d5-893e-577ff92e721c",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage123456"
},
{
"id": "a440c04b-79fa-479c-bed1-0b816eaec379",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage6"
},
{
"id": "c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage123456"
},
{
"id": "cedef40a-ed67-4d10-800e-17455edce175",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage123456"
},
{
"id": "76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"name": "fakeimage123456"
}
]
}
Execution Example¶
HTTP Request¶
GET /v2/b17a6492bfa54441910e15f07c983384/images HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 5f944a7a64d3408597b618915dad29ea
Content-type: application/json
Accept: application/json
HTTP Response¶
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2222
X-Compute-Request-Id: req-c86698f9-3494-403f-b110-4b411dec90a7
Date: Tue, 06 Oct 2015 09:21:58 GMT
{"images": [{"id": "7ba75599-e03e-4eed-8d04-eb302e0a71cf", "links": [{"href": "http://192.168.56.250:8774/v2/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "rel": "self"}, {"href": "http://192.168.56.250:8774/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "rel": "bookmark"}, {"href": "http://192.168.56.250:9292/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "name": "ubuntu_server_14_04-cloudimg-amd64.img"}, {"id": "4c3b1e71-4090-4ee0-bab8-7133b3c1959f", "links": [{"href": "http://192.168.56.250:8774/v2/b17a6492bfa54441910e15f07c983384/images/4c3b1e71-4090-4ee0-bab8-7133b3c1959f", "rel": "self"}, {"href": "http://192.168.56.250:8774/b17a6492bfa54441910e15f07c983384/images/4c3b1e71-4090-4ee0-bab8-7133b3c1959f", "rel": "bookmark"}, {"href": "http://192.168.56.250:9292/b17a6492bfa54441910e15f07c983384/images/4c3b1e71-4090-4ee0-bab8-7133b3c1959f", "type": "application/vnd.openstack.image", "rel": "alternate"}], "name": "cirros-0.3.2-x86_64-uec"}, {"id": "c41a68b6-77fc-4732-b60d-16325dc569e5", "links": [{"href": "http://192.168.56.250:8774/v2/b17a6492bfa54441910e15f07c983384/images/c41a68b6-77fc-4732-b60d-16325dc569e5", "rel": "self"}, {"href": "http://192.168.56.250:8774/b17a6492bfa54441910e15f07c983384/images/c41a68b6-77fc-4732-b60d-16325dc569e5", "rel": "bookmark"}, {"href": "http://192.168.56.250:9292/b17a6492bfa54441910e15f07c983384/images/c41a68b6-77fc-4732-b60d-16325dc569e5", "type": "application/vnd.openstack.image", "rel": "alternate"}], "name": "cirros-0.3.2-x86_64-uec-ramdisk"}, {"id": "1ef9e889-68dd-4844-b752-2add5eecb79c", "links": [{"href": "http://192.168.56.250:8774/v2/b17a6492bfa54441910e15f07c983384/images/1ef9e889-68dd-4844-b752-2add5eecb79c", "rel": "self"}, {"href": "http://192.168.56.250:8774/b17a6492bfa54441910e15f07c983384/images/1ef9e889-68dd-4844-b752-2add5eecb79c", "rel": "bookmark"}, {"href": "http://192.168.56.250:9292/b17a6492bfa54441910e15f07c983384/images/1ef9e889-68dd-4844-b752-2add5eecb79c", "type": "application/vnd.openstack.image", "rel": "alternate"}], "name": "cirros-0.3.2-x86_64-uec-kernel"}]}
Error Execution Example¶
HTTP Request¶
GET /v2/b17a6492bfa54441910e15f07983384/images HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 5f944a7a64d3408597b618915dad29ea
Content-type: application/json
Accept: application/json
HTTP Response¶
HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-da5ab3bc-f1a4-4e98-b307-fc1f0b7742a3
Date: Tue, 06 Oct 2015 09:23:12 GMT
{"badRequest": {"message": "Malformed request URL: URL's project_id 'b17a6492bfa54441910e15f07983384' doesn't match Context's project_id 'b17a6492bfa54441910e15f07c983384'", "code": 400}}