congress.api.library_policy_model.
LibraryPolicyModel
(name, bus=None)¶Bases: congress.api.base.APIModel
Model for handling API requests about Library 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 unique name of the item
context: Key-values providing frame of reference of request
Tuple of (ID, newly_created_item)
KeyError – ID already exists.
DataModelException – Addition cannot be performed.
delete_item
(id_, params, context=None)¶Remove item from model.
id_: The unique 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.
get_item
(id_, params, context=None)¶Retrieve item with 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 no item with id exists.
get_items
(params, context=None)¶Get items in model.
params: A dict-like object containing parameters from the request query string and body. The name parameter filters results by name policy name.
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.
replace_item
(id_, item, params, context=None)¶Replace item with id_ with new data.
id_: The ID of the item to be replaced
item: The new item
params: A dict-like object containing parameters from the request query string and body.
context: Key-values providing frame of reference of request
The new item after replacement.
KeyError – Item with specified id_ not present.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.