The ceilometer.storage.base ModuleΒΆ

Base classes for storage engines

class ceilometer.storage.base.Connection(url)[source]

Bases: object

Base class for storage system connections.

static Connection.clear()[source]

Clear database.

static Connection.clear_expired_metering_data(ttl)[source]

Clear expired data from the backend storage system.

Clearing occurs according to the time-to-live.

Parameters:ttl – Number of seconds to keep records for.
classmethod Connection.get_capabilities()[source]

Return an dictionary with the capabilities of each driver.

static Connection.get_event_types()[source]

Return all event types as an iterable of strings.

static Connection.get_events(event_filter)[source]

Return an iterable of model.Event objects.

static Connection.get_meter_statistics(sample_filter, period=None, groupby=None, aggregate=None)[source]

Return an iterable of model.Statistics instances.

The filter must have a meter value set.

static Connection.get_meters(user=None, project=None, resource=None, source=None, metaquery=None, pagination=None)[source]

Return an iterable of model.Meter instances.

Iterable items containing meter information. :param user: Optional ID for user that owns the resource. :param project: Optional ID for project that owns the resource. :param resource: Optional resource filter. :param source: Optional source filter. :param metaquery: Optional dict with metadata to match on. :param pagination: Optional pagination query.

static Connection.get_resources(user=None, project=None, source=None, start_timestamp=None, start_timestamp_op=None, end_timestamp=None, end_timestamp_op=None, metaquery=None, resource=None, pagination=None)[source]

Return an iterable of models.Resource instances.

Iterable items containing resource information. :param user: Optional ID for user that owns the resource. :param project: Optional ID for project that owns the resource. :param source: Optional source filter. :param start_timestamp: Optional modified timestamp start range. :param start_timestamp_op: Optional timestamp start range operation. :param end_timestamp: Optional modified timestamp end range. :param end_timestamp_op: Optional timestamp end range operation. :param metaquery: Optional dict with metadata to match on. :param resource: Optional resource filter. :param pagination: Optional pagination query.

static Connection.get_samples(sample_filter, limit=None)[source]

Return an iterable of model.Sample instances.

Parameters:
  • sample_filter – Filter.
  • limit – Maximum number of results to return.
classmethod Connection.get_storage_capabilities()[source]

Return a dictionary representing the performance capabilities.

This is needed to evaluate the performance of each driver.

static Connection.get_trait_types(event_type)[source]

Return a dictionary containing the name and data type of the trait.

Only trait types for the provided event_type are returned. :param event_type: the type of the Event

static Connection.get_traits(event_type, trait_type=None)[source]

Return all trait instances associated with an event_type.

If trait_type is specified, only return instances of that trait type. :param event_type: the type of the Event to filter by :param trait_type: the name of the Trait to filter by

static Connection.query_samples(filter_expr=None, orderby=None, limit=None)[source]

Return an iterable of model.Sample objects.

Parameters:
  • filter_expr – Filter expression for query.
  • orderby – List of field name and direction pairs for order by.
  • limit – Maximum number of results to return.
static Connection.record_events(events)[source]

Write the events to the backend storage system.

Parameters:events – a list of model.Event objects.
static Connection.record_metering_data(data)[source]

Write the data to the backend storage system.

Parameters:data – a dictionary such as returned by ceilometer.meter.meter_message_from_counter

All timestamps must be naive utc datetime object.

static Connection.upgrade()[source]

Migrate the database to version or the most recent version.

class ceilometer.storage.base.Model(**kwds)[source]

Bases: object

Base class for storage API models.

Model.as_dict()[source]
classmethod Model.get_field_names()[source]
exception ceilometer.storage.base.MultipleResultsFound[source]

Bases: exceptions.Exception

exception ceilometer.storage.base.NoResultFound[source]

Bases: exceptions.Exception

class ceilometer.storage.base.Pagination(limit=None, primary_sort_dir='desc', sort_keys=None, sort_dirs=None, marker_value=None)[source]

Bases: object

Class for pagination query.

Previous topic

The ceilometer.storage Module

Next topic

The ceilometer.storage.impl_log Module

This Page