Bases: object
Model API responses as dictionaries.
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’
Fetch an instance from the compute API, handling error checking.
get limited parameter from request.
Returns a prepared nw_info list for passing into the view builders
We end up with a data structure like:
{'public': {'ips': [{'address': '10.0.0.1',
'version': 4,
'mac_address': 'aa:aa:aa:aa:aa:aa'},
{'address': '2001::1',
'version': 6,
'mac_address': 'aa:aa:aa:aa:aa:aa'}],
'floating_ips': [{'address': '172.16.0.1',
'version': 4,
'mac_address': 'aa:aa:aa:aa:aa:aa'},
{'address': '172.16.2.1',
'version': 4,
'mac_address': 'aa:aa:aa:aa:aa:aa'}]},
...}
Return marker, limit tuple from request.
Parameters: | request – wsgi.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. |
---|
Retrieves sort keys/directions parameters.
Processes the parameters to create a list of sort keys and sort directions that correspond to the ‘sort_key’ and ‘sort_dir’ parameter values. These sorting parameters can be specified multiple times in order to generate the list of sort keys and directions.
The input parameters are not modified.
Parameters: |
|
---|---|
Returns: | list of sort keys, list of sort dirs |
Checks to see if the all_tenants flag is in search_opts
Parameters: | search_opts (dict) – The search options for a request |
---|---|
Returns: | boolean indicating if all_tenants are being requested or not |
Return a slice of items according to requested offset and limit.
Parameters: |
|
---|
Raises a webob.exc.HTTPConflict instance containing a message appropriate to return via the API based on the original InstanceInvalidState exception.
Removes the api version from the href.
Given: ‘http://www.nova.com/compute/v1.1‘ Returns: ‘http://www.nova.com/compute‘
Given: ‘http://www.nova.com/v1.1‘ Returns: ‘http://www.nova.com‘
Given vm_state and task_state, return a status string.
Map the server’s multiple status strings to list of vm states and list of task states.
Convenience method for joining parts of a URL
Any leading and trailing ‘/’ characters are removed, and the parts joined together with ‘/’ as a separator. If last element of ‘parts’ is an empty string, the returned URL will have a trailing slash.