congress.api.policy_model.
PolicyModel
(name, bus=None)¶Bases: congress.api.base.APIModel
Model for handling API requests about Policies.
add_item
(item, params, id_=None, context=None)¶Add item to model.
item: The item to add to the model
params: A dict-like object containing parameters from the request query string and body.
id_: The ID of the item, or None if an ID should be generated
context: Key-values providing frame of reference of request
Tuple of (ID, newly_created_item)
KeyError – ID already exists.
DataModelException – Addition cannot be performed.
BadRequest – library_policy parameter and request body both present
delete_item
(id_, params, context=None)¶Remove item from model.
id_: The ID or name of the item to be removed
params:
context: Key-values providing frame of reference of request
The removed item.
KeyError – Item with specified id_ not present.
execute_action
(params, context=None, request=None)¶Execute the action.
get_item
(id_, params, context=None)¶Retrieve item with id id_ from model.
id_: The ID of the item to retrieve
params: A dict-like object containing parameters from the request query string and body.
context: Key-values providing frame of reference of request
The matching item or None if id_ does not exist.
get_items
(params, context=None)¶Get items in model.
params: A dict-like object containing parameters from the request query string and body.
context: Key-values providing frame of reference of request
A dict containing at least a ‘results’ key whose value is a list of items in the model. Additional keys set in the dict will also be rendered for the user.
simulate_action
(params, context=None, request=None)¶Simulate the effects of executing a sequence of updates.
the result of a query.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.