List images 2

GET /v2/images

Normal response codes: 200

Request body ignored.

Response body will be a list of images available to the client. For example:


{
	"images": [
		{
			"id": "da3b75d9-3f4a-40e7-8a2c-bfab23927dea",
			"name": "cirros-0.3.0-x86_64-uec-ramdisk",
			"status": "active",
			"visibility": "private",
			"size": 2254249,
			"checksum": "2cec138d7dae2aa59038ef8c9aec2390",
			"tags": ["ping", "pong"],
			"created_at": "2012-08-10T19:23:50Z",
			"updated_at": "2012-08-10T19:23:50Z",
			"self": "/v2/images/da3b75d9-3f4a-40e7-8a2c-bfab23927dea",
			"file": "/v2/images/da3b75d9-3f4a-40e7-8a2c-bfab23927dea/file",
			"schema": "/v2/schemas/image"
		},
		{
			"id": "0d5bcbc7-b066-4217-83f4-7111a60a399a",
			"name": "cirros-0.3.0-x86_64-uec",
			"status": "active",
			"visibility": "private",
			"size": 25165824,
			"checksum": "2f81976cae15c16ef0010c51e3a6c163",
			"tags": [],
			"created_at": "2012-08-10T19:23:50Z",
			"updated_at": "2012-08-10T19:23:50Z",
			"self": "/v2/images/0d5bcbc7-b066-4217-83f4-7111a60a399a",
			"file": "/v2/images/0d5bcbc7-b066-4217-83f4-7111a60a399a/file",
			"schema": "/v2/schemas/image"
		},
		{
			"id": "e6421c88-b1ed-4407-8824-b57298249091",
			"name": "cirros-0.3.0-x86_64-uec-kernel",
			"status": "active",
			"visibility": "private",
			"size": 4731440,
			"checksum": "cfb203e7267a28e435dbcb05af5910a9",
			"tags": [],
			"created_at": "2012-08-10T19:23:49Z",
			"updated_at": "2012-08-10T19:23:49Z",
			"self": "/v2/images/e6421c88-b1ed-4407-8824-b57298249091",
			"file": "/v2/images/e6421c88-b1ed-4407-8824-b57298249091/file",
			"schema": "/v2/schemas/image"
		}
	],
	"first": "/v2/images?limit=3",
	"next": "/v2/images?limit=3&marker=e6421c88-b1ed-4407-8824-b57298249091",
	"schema": "/v2/schemas/images"
}
   


{
	"images": [
		{
		"status": "active",
		"name": "fj_sa_20180427_003",
		"tags": [],
		"container_format": "bare",
		"created_at": "2018-04-27T08:06:53Z",
		"sync_status_reason": "ERROR:A timeout occurred during synchronize image the
server(http://10.7.0.201:9292 <http://10.7.0.201:9292/>) in the image operation.
image_id=3eb2d8df-487b-4e82-a5ad.....",
		"disk_format": "qcow2",
		"updated_at": "2018-04-27T08:20:26Z",
		"visibility": "private",
		"self": "/v2/images/3eb2d8df-487b-4e82-a5ad.....",
		"min_disk": 0,
		"protected": false,
		"min_ram": 0,
		"file": "/v2/images/3eb2d8df-487b-4e82-a5ad...../file",
		"checksum": "e2df1a86f3cb356aaeecc6badc5a2d",
		"owner": "776a290892b747c4af8cec2a.....",
		"size": 194008676,
		"id": "3eb2d8df-487b-4e82-a5ad.....",
		"schema": "/v2/schemas/image"
		}
	],
	"schema": "/v2/schemas/images",
	"first": "/v2/images?name=fjh_asa_20180427_003"
}
   

Pagination

This call is designed to return a subset of the larger collection of images while providing a link that can be used to retrieve the next. You should always check for the presence of a 'next' link and use it as the URI in a subsequent HTTP GET request. You should follow this pattern until there a 'next' link is no longer provided. The next link will preserve any query parameters you send in your initial request. The 'first' link can be used to jump back to the first page of the collection.

If you prefer to paginate through images manually, the API provides two query parameters: 'limit' and 'marker'. The limit parameter is used to request a specific page size.

Expect a response to a limited request to return between zero and limit items. The marker parameter is used to indicate the id of the last-seen image. The typical pattern of limit and marker is to make an initial limited request then to use the id of the last image from the response as the marker parameter in a subsequent limited request.

Filtering

The list operation accepts several types of query parameters intended to filter the results of the returned collection.

A client can provide direct comparison filters using most image attributes (i.e. name=Ubuntu, visibility=public, etc). A client cannot filter on tags or anything defined as a 'link' in the json-schema (i.e. self, file, schema).

The 'size_min' and 'size_max' query parameters can be used to do greater-than and less-than filtering of images based on their 'size' attribute ('size' is measured in bytes and refers to the size of an image when stored on disk). For example, sending a size_min filter of 1048576 and size_max of 4194304 would filter the container to include only images that are between one and four megabytes in size.

Sorting

The results of this operation can be ordered using the 'sort_key' and 'sort_dir' parameters.

The API uses the natural sorting of whatever image attribute is provided as the 'sort_key'.

All image attributes can be used as the sort_key (except tags and link attributes).

The sort_dir parameter indicates in which direction to sort. Acceptable values are 'asc' (ascending) and 'desc' (descending). Defaults values for sort_key and sort_dir are 'created_at' and 'desc'.

Property Protections

Version 2.2 of the Images API acknowledges the ability of a cloud provider to employ property protections. Thus, there may be image properties that will not appear in the list images response for non-admin users.