The openstack_dashboard.api.rest.glance ModuleΒΆ

API for the glance service.

class openstack_dashboard.api.rest.glance.Image(**kwargs)[source]

Bases: django.views.generic.base.View

API for retrieving a single image

delete(request, *args, **kw)[source]

Delete a specific image

DELETE http://localhost/api/glance/images/cc758c90-3d98-4ea1-af44-aab405c9c915 # noqa

get(request, *args, **kw)[source]

Get a specific image

http://localhost/api/glance/images/cc758c90-3d98-4ea1-af44-aab405c9c915

patch(request, *args, **kw)[source]

Update a specific image

Update an Image using the parameters supplied in the POST application/json object. The parameters are:

Parameters:
  • name – (required) the name to give the image
  • description – (optional) description of the image
  • disk_format – (required) format of the image
  • kernel – (optional) kernel to use for the image
  • ramdisk – (optional) Ramdisk to use for the image
  • architecture – (optional) the Architecture of the image
  • min_disk – (optional) the minimum disk size for the image to boot with
  • min_ram – (optional) the minimum ram for the image to boot with
  • visibility – (required) takes ‘public’, ‘shared’, and ‘private’
  • protected – (required) true if the image is protected

Any parameters not listed above will be assigned as custom properties for the image.

http://localhost/api/glance/images/cc758c90-3d98-4ea1-af44-aab405c9c915

url_regex = 'glance/images/(?P<image_id>[^/]+|default)/$'
class openstack_dashboard.api.rest.glance.ImageProperties(**kwargs)[source]

Bases: django.views.generic.base.View

API for retrieving only a custom properties of single image.

get(request, *args, **kw)[source]

Get custom properties of specific image.

patch(request, *args, **kw)[source]

Update custom properties of specific image.

This method returns HTTP 204 (no content) on success.

url_regex = 'glance/images/(?P<image_id>[^/]+)/properties/'
class openstack_dashboard.api.rest.glance.Images(**kwargs)[source]

Bases: django.views.generic.base.View

API for Glance images.

get(request, *args, **kw)[source]

Get a list of images.

The listing result is an object with property “items”. Each item is an image.

Example GET: http://localhost/api/glance/images?sort_dir=desc&sort_key=name&name=cirros-0.3.2-x86_64-uec # noqa

The following get parameters may be passed in the GET request:

Parameters:
  • paginate – If true will perform pagination based on settings.
  • marker – Specifies the namespace of the last-seen image. The typical pattern of limit and marker is to make an initial limited request and then to use the last namespace from the response as the marker parameter in a subsequent limited request. With paginate, limit is automatically set.
  • sort_dir – The sort direction (‘asc’ or ‘desc’).
  • sort_key – The field to sort on (for example, ‘created_at’). Default is created_at.

Any additional request parameters will be passed through the API as filters. There are v1/v2 complications which are being addressed as a separate work stream: https://review.openstack.org/#/c/150084/

post(request)[source]
put(request, *args, **kw)[source]

Create an Image.

Create an Image using the parameters supplied in the POST application/json object. The parameters are:

Parameters:
  • name – the name to give the image
  • description – (optional) description of the image
  • source_type – (required) source type. current only ‘url’ is supported
  • image_url – (required) URL to get the image
  • disk_format – (required) format of the image
  • kernel – (optional) kernel to use for the image
  • ramdisk – (optional) Ramdisk to use for the image
  • architecture – (optional) the Architecture of the image
  • min_disk – (optional) the minimum disk size for the image to boot with
  • min_ram – (optional) the minimum ram for the image to boot with
  • visibility – (required) takes ‘public’, ‘private’, and ‘shared’
  • protected – (required) true if the image is protected
  • import_data – (optional) true to copy the image data to the image service or use it from the current location

Any parameters not listed above will be assigned as custom properties for the image.

This returns the new image object on success.

url_regex = 'glance/images/$'
class openstack_dashboard.api.rest.glance.MetadefsNamespaces(**kwargs)[source]

Bases: django.views.generic.base.View

API for Single Glance Metadata Definitions.

http://docs.openstack.org/developer/glance/metadefs-concepts.html

get(request, *args, **kw)[source]

Get a list of metadata definition namespaces.

The listing result is an object with property “items”. Each item is a namespace.

Example GET: http://localhost/api/glance/metadefs/namespaces?resource_types=OS::Nova::Flavor&sort_dir=desc&marker=OS::Compute::Watchdog&paginate=False&sort_key=namespace # noqa

The following get parameters may be passed in the GET request:

Parameters:
  • resource_type – Namespace resource type. If specified returned namespace properties will have prefixes proper for selected resource type.
  • paginate – If true will perform pagination based on settings.
  • marker – Specifies the namespace of the last-seen namespace. The typical pattern of limit and marker is to make an initial limited request and then to use the last namespace from the response as the marker parameter in a subsequent limited request. With paginate, limit is automatically set.
  • sort_dir – The sort direction (‘asc’ or ‘desc’).
  • sort_key – The field to sort on (for example, ‘created_at’). Default is namespace. The way base namespaces are loaded into glance typically at first deployment is done in a single transaction giving them a potentially unpredictable sort result when using create_at.

Any additional request parameters will be passed through the API as filters.

url_regex = 'glance/metadefs/namespaces/$'
class openstack_dashboard.api.rest.glance.MetadefsResourceTypesList(**kwargs)[source]

Bases: django.views.generic.base.View

API for getting Metadata Definitions Resource Types List.

http://docs.openstack.org/developer/glance/metadefs-concepts.html

get(request, *args, **kw)[source]

Get Metadata definitions resource types list.

The listing result is an object with property “items”. Each item is a resource type.

Example GET: http://localhost/api/glance/resourcetypes/

Any request parameters will be passed through the API as filters.

url_regex = 'glance/metadefs/resourcetypes/$'
class openstack_dashboard.api.rest.glance.UploadObjectForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('data', <django.forms.fields.FileField object at 0x7f4855886410>)])
declared_fields = OrderedDict([('data', <django.forms.fields.FileField object at 0x7f4855886410>)])
media
class openstack_dashboard.api.rest.glance.Version(**kwargs)[source]

Bases: django.views.generic.base.View

API for active glance version.

get(request, *args, **kw)[source]

Get active glance version.

url_regex = 'glance/version/$'
openstack_dashboard.api.rest.glance.create_image_metadata(data)[source]
openstack_dashboard.api.rest.glance.handle_unknown_properties(data, properties)[source]
openstack_dashboard.api.rest.glance.handle_visibility(visibility, meta)[source]

Previous topic

The openstack_dashboard.api.rest.json_encoder Module

Next topic

The openstack_dashboard.api.rest.network Module

Project Source

This Page