The nova.api.openstack.common Module

class MetaItemDeserializer(metadata=None)

Bases: nova.api.openstack.wsgi.MetadataXMLDeserializer

deserialize(text)
class MetaItemTemplate

Bases: nova.api.openstack.xmlutil.TemplateBuilder

construct()
class MetadataDeserializer(metadata=None)

Bases: nova.api.openstack.wsgi.MetadataXMLDeserializer

deserialize(text)
class MetadataTemplate

Bases: nova.api.openstack.xmlutil.TemplateBuilder

construct()
class MetadataTemplateElement(tag, attrib=None, selector=None, subselector=None, **extra)

Bases: nova.api.openstack.xmlutil.TemplateElement

will_render(datum)
class MetadataXMLDeserializer(metadata=None)

Bases: nova.api.openstack.wsgi.XMLDeserializer

create(datastring)
extract_metadata(metadata_node)

Marshal the metadata attribute of a parsed request.

update(datastring)
update_all(datastring)
class ViewBuilder

Bases: object

Model API responses as dictionaries.

check_img_metadata_properties_quota(context, metadata)
check_snapshots_enabled(f)
dict_to_query_str(params)
get_id_from_href(href)

Return the id or uuid portion of a url.

Given: ‘http://www.foo.com/bar/123?q=4‘ Returns: ‘123’

Given: ‘http://www.foo.com/bar/abc123?q=4‘ Returns: ‘abc123’

get_limit_and_marker(request, max_limit=1000)

get limited parameter from request.

get_networks_for_instance(context, instance)

Returns a prepared nw_info list for passing into the view builders

We end up with a data structure like:

{'public': {'ips': [{'addr': '10.0.0.1', 'version': 4},
                    {'addr': '2001::1', 'version': 6}],
            'floating_ips': [{'addr': '172.16.0.1', 'version': 4},
                             {'addr': '172.16.2.1', 'version': 4}]},
 ...}
get_networks_for_instance_from_nw_info(nw_info)
get_pagination_params(request)

Return marker, limit tuple from request.

Parameters:requestwsgi.Request possibly containing ‘marker’ and ‘limit’ GET variables. ‘marker’ is the id of the last element the client has seen, and ‘limit’ is the maximum number of items to return. If ‘limit’ is not specified, 0, or > max_limit, we default to max_limit. Negative values for either marker or limit will cause exc.HTTPBadRequest() exceptions to be raised.
limited(items, request, max_limit=1000)

Return a slice of items according to requested offset and limit.

Parameters:
  • items – A sliceable entity
  • requestwsgi.Request possibly containing ‘offset’ and ‘limit’ GET variables. ‘offset’ is where to start in the list, and ‘limit’ is the maximum number of items to return. If ‘limit’ is not specified, 0, or > max_limit, we default to max_limit. Negative values for either offset or limit will cause exc.HTTPBadRequest() exceptions to be raised.
  • max_limit – The maximum number of items to return from ‘items’
limited_by_marker(items, request, max_limit=1000)

Return a slice of items according to the requested marker and limit.

raise_http_conflict_for_instance_invalid_state(exc, action)

Return a webob.exc.HTTPConflict instance containing a message appropriate to return via the API based on the original InstanceInvalidState exception.

remove_version_from_href(href)

Removes the first api version from the href.

Given: ‘http://www.nova.com/v1.1/123‘ Returns: ‘http://www.nova.com/123

Given: ‘http://www.nova.com/v1.1‘ Returns: ‘http://www.nova.com

status_from_state(vm_state, task_state='default')

Given vm_state and task_state, return a status string.

vm_state_from_status(status)

Map the server status string to a vm state.

Previous topic

The nova.api.openstack.auth Module

Next topic

The nova.api.openstack.compute.consoles Module

This Page