panko.api.controllers.v2.base.
AdvEnum
(name, *args, **kwargs)¶Bases: wsme.types.wsproperty
Handle default and mandatory for wtypes.Enum.
panko.api.controllers.v2.base.
Base
(**kw)¶Bases: wsme.types.DynamicBase
as_dict
(db_model)¶as_dict_from_keys
(keys)¶from_db_and_links
(m, links)¶from_db_model
(m)¶panko.api.controllers.v2.base.
ClientSideError
(error, status_code=400)¶Bases: wsme.exc.ClientSideError
panko.api.controllers.v2.base.
EntityNotFound
(entity, id)¶panko.api.controllers.v2.base.
JsonType
¶Bases: wsme.types.UserType
A simple JSON type.
basetype
¶alias of str
name
= 'json'¶validate
(value)¶panko.api.controllers.v2.base.
ProjectNotAuthorized
(id, aspect='project')¶panko.api.controllers.v2.base.
Query
(**kw)¶Bases: panko.api.controllers.v2.base.Base
Query filter.
as_dict
()¶field
¶The name of the field to test
get_op
()¶op
¶The comparison operator. Defaults to ‘eq’.
sample
()¶set_op
(value)¶type
¶The data type of value to compare against the stored data
value
¶The value to compare against the stored data
panko.api.controllers.v2.capabilities.
Capabilities
(**kw)¶Bases: panko.api.controllers.v2.base.Base
A representation of the API and storage capabilities.
Usually constrained by restrictions imposed by the storage driver.
api
¶A flattened dictionary of API capabilities
event_storage
¶A flattened dictionary of event storage capabilities
sample
()¶panko.api.controllers.v2.events.
Event
(**kw)¶Bases: panko.api.controllers.v2.base.Base
A System event.
event_type
¶The type of the event
generated
¶The time the event occurred
get_traits
()¶message_id
¶The message ID for the notification
raw
¶The raw copy of notification
sample
()¶set_traits
(traits)¶traits
¶Event specific properties
panko.api.controllers.v2.events.
EventQuery
(**kw)¶Bases: panko.api.controllers.v2.base.Query
Query arguments for Event Queries.
field
¶Name of the field to filter on. Can be either a trait name or field of an event. 1) Use start_timestamp/end_timestamp to filter on generated field. 2) Specify the ‘all_tenants=True’ query parameter to get all events for all projects, this is only allowed by admin users.
op
¶sample
()¶type
¶the type of the trait filter, defaults to string
value
¶Complex type attribute definition.
Example:
class MyComplexType(wsme.types.Base):
optionalvalue = int
mandatoryvalue = wsattr(int, mandatory=True)
named_value = wsattr(int, name='named.value')
After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:
class MyComplexType(wsme.types.Base):
optionalvalue = wsattr(int)
mandatoryvalue = wsattr(int, mandatory=True)
panko.api.controllers.v2.events.
EventTypesController
(*args, **kwargs)¶Bases: pecan.rest.RestController
Works on Event Types in the system.
get_all
()¶Get all event types.
get_one
(event_type)¶Unused API, will always return 404.
event_type – A event type
traits
= <panko.api.controllers.v2.events.TraitsController object>¶panko.api.controllers.v2.events.
EventsController
(*args, **kwargs)¶Bases: pecan.rest.RestController
Works on Events.
get_all
(q=None, limit=None, sort=None, marker=None)¶Return all events matching the query filters.
q – Filter arguments for which Events to return
limit – Maximum number of samples to be returned.
sort – A pair of sort key and sort direction combined with “:”
marker – The pagination query marker, message id of the last item viewed
get_one
(message_id)¶Return a single event with the given message id.
message_id – Message ID of the Event to be returned
panko.api.controllers.v2.events.
Trait
(**kw)¶Bases: panko.api.controllers.v2.base.Base
A Trait associated with an event.
name
¶The name of the trait
sample
()¶type
¶the type of the trait (string, integer, float or datetime)
value
¶the value of the trait
panko.api.controllers.v2.events.
TraitDescription
(**kw)¶Bases: panko.api.controllers.v2.base.Base
A description of a trait, with no associated value.
name
¶the name of the trait
sample
()¶type
¶the data type, defaults to string
panko.api.controllers.v2.events.
TraitsController
(*args, **kwargs)¶Bases: pecan.rest.RestController
Works on Event Traits.
get_all
(event_type)¶Return all trait names for an event type.
event_type – Event type to filter traits by
get_one
(event_type, trait_name)¶Return all instances of a trait for an event type.
event_type – Event type to filter traits by
trait_name – Trait to return values for
panko.api.controllers.v2.root.
V2Controller
¶Bases: object
Version 2 API controller root.
capabilities
= <panko.api.controllers.v2.capabilities.CapabilitiesController object>¶event_types
= <panko.api.controllers.v2.events.EventTypesController object>¶events
= <panko.api.controllers.v2.events.EventsController object>¶panko.api.controllers.v2.utils.
get_auth_project
(on_behalf_of=None)¶panko.api.controllers.v2.utils.
requires_admin
(func)¶panko.api.controllers.v2.utils.
requires_context
(func)¶panko.api.controllers.v2.utils.
set_pagination_options
(sort, limit, marker, api_model)¶Sets the options for pagination specifying query options
Arguments: sort – List of sorting criteria. Each sorting option has to format <sort key>:<sort direction>
Valid sort keys: message_id, generated (SUPPORT_SORT_KEYS in panko/event/storage/models.py) Valid sort directions: asc (ascending), desc (descending) (SUPPORT_DIRS in panko/event/storage/models.py) This defaults to asc if unspecified (DEFAULT_DIR in panko/event/storage/models.py)
impl_sqlalchemy.py: (see _get_pagination_query) If sort list is empty, this defaults to [‘generated:asc’, ‘message_id:asc’] (DEFAULT_SORT in panko/event/storage/models.py)
limit – Integer specifying maximum number of values to return
If unspecified, this defaults to pecan.request.cfg.api.default_api_return_limit
marker – If specified, assumed to be an integer and assumed to be the message id of the last object on the previous page of the results
api_model – Specifies the class implementing the api model to use for this pagination. The class is expected to provide the following members:
SUPPORT_DIRS SUPPORT_SORT_KEYS DEFAULT_DIR DEFAULT_SORT PRIMARY_KEY
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.