ImagesΒΆ

class glanceclient.v2.images.Controller(http_client, schema_client)

Bases: object

Controller.add_location(image_id, url, metadata)

Add a new location entry to an image’s list of locations.

It is an error to add a URL that is already present in the list of locations.

Parameters:
  • image_id – ID of image to which the location is to be added.
  • url – URL of the location to add.
  • metadata – Metadata associated with the location.
Returns:

The updated image

Controller.create(**kwargs)

Create an image.

Controller.data(image_id, do_checksum=True)

Retrieve data of an image.

Parameters:
  • image_id – ID of the image to download.
  • do_checksum – Enable/disable checksum validation.
Returns:

An iterable body or None

Controller.deactivate(image_id)

Deactivate an image.

Controller.delete(image_id)

Delete an image.

Controller.delete_locations(image_id, url_set)

Remove one or more location entries of an image.

Parameters:
  • image_id – ID of image from which locations are to be removed.
  • url_set – set of URLs of location entries to remove.
Returns:

None

Controller.get(image_id)
Controller.list(**kwargs)

Retrieve a listing of Image objects.

Parameters:page_size – Number of images to request in each paginated request.
Returns:generator over list of Images.
Controller.model None
Controller.reactivate(image_id)

Reactivate an image.

Controller.unvalidated_model None
Controller.update(image_id, remove_props=None, **kwargs)

Update attributes of an image.

Parameters:
  • image_id – ID of the image to modify.
  • remove_props – List of property names to remove
  • kwargs – Image attribute names and their new values.
Controller.update_location(image_id, url, metadata)

Update an existing location entry in an image’s list of locations.

The URL specified must be already present in the image’s list of locations.

Parameters:
  • image_id – ID of image whose location is to be updated.
  • url – URL of the location to update.
  • metadata – Metadata associated with the location.
Returns:

The updated image

Controller.upload(image_id, image_data, image_size=None)

Upload the data for an image.

Parameters:
  • image_id – ID of the image to upload data for.
  • image_data – File-like object supplying the data to upload.
  • image_size – Unused - present for backwards compatibility

Previous topic

Client

Next topic

Image_tags

This Page