This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.1 docs or all OpenStack docs too.

The nova.api.openstack.common Module

class nova.api.openstack.common.OpenstackController

Bases: nova.wsgi.Controller

get_default_xmlns(req)
nova.api.openstack.common.get_id_from_href(href)

Return the id portion of a url as an int.

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

nova.api.openstack.common.get_image_id_from_image_hash(image_service, context, image_hash)

Given an Image ID Hash, return an objectstore Image ID.

image_service - reference to objectstore compatible image service. context - security context for image service requests. image_hash - hash of the image ID.

nova.api.openstack.common.limited(items, request, max_limit=1000)

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

@param items: A sliceable entity @param request: wsgi.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.

@kwarg max_limit: The maximum number of items to return from ‘items’

nova.api.openstack.common.limited_by_marker(items, request, max_limit=1000)

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