telemetry methods

class ecl.telemetry.v2._proxy.Proxy(session)[source]

Bases: ecl.proxy.BaseProxy

Caution

This API is a work in progress and is subject to change.

alarm_changes(alarm, **query)[source]

Return a generator of alarm changes

Parameters:
  • alarm – Alarm resource or id for alarm.
  • **query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:

A generator of alarm change objects

Return type:

AlarmChange

alarms(**query)[source]

Return a generator of alarms

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of alarm objects
Return type:Alarm
capabilities(**query)[source]

Return a generator of capabilities

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of capability objects
Return type:Capability
create_alarm(**attrs)[source]

Create a new alarm from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Alarm, comprised of the properties on the Alarm class.
Returns:The results of alarm creation
Return type:Alarm
create_sample(**attrs)[source]

Create a new sample from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Sample, comprised of the properties on the Sample class.
Returns:The results of sample creation
Return type:Sample
delete_alarm(alarm, ignore_missing=True)[source]

Delete an alarm

Parameters:
  • alarm – The value can be either the ID of an alarm or a Alarm instance.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the alarm does not exist. When set to True, no exception will be set when attempting to delete a nonexistent alarm.
Returns:

None

find_alarm(name_or_id, ignore_missing=True)[source]

Find a single alarm

Parameters:
  • name_or_id – The name or ID of a alarm.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Alarm or None

find_alarm_change(name_or_id, ignore_missing=True)[source]

Find a single alarm change

Parameters:
  • name_or_id – The name or ID of a alarm change.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One AlarmChange or None

find_capability(name_or_id, ignore_missing=True)[source]

Find a single capability

Parameters:
  • name_or_id – The name or ID of a capability.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Capability or None

find_meter(name_or_id, ignore_missing=True)[source]

Find a single meter

Parameters:
  • name_or_id – The name or ID of a meter.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Meter or None

find_resource(name_or_id, ignore_missing=True)[source]

Find a single resource

Parameters:
  • name_or_id – The name or ID of a resource.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Resource or None

find_sample(name_or_id, ignore_missing=True)[source]

Find a single sample

Parameters:
  • name_or_id – The name or ID of a sample.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Sample or None

find_statistics(name_or_id, ignore_missing=True)[source]

Find a single statistics

Parameters:
  • name_or_id – The name or ID of a statistics.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Statistics or None

get_alarm(alarm)[source]

Get a single alarm

Parameters:alarm – The value can be the ID of an alarm or a Alarm instance.
Returns:One Alarm
Raises:ResourceNotFound when no resource can be found.
get_resource(resource)[source]

Get a single resource

Parameters:resource – The value can be the ID of a resource or a Resource instance.
Returns:One Resource
Raises:ResourceNotFound when no resource can be found.
meters(**query)[source]

Return a generator of meters

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of meter objects
Return type:Meter
resources(**query)[source]

Return a generator of resources

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of resource objects
Return type:Resource
samples(meter, **query)[source]

Return a generator of samples

Parameters:
  • value – Meter resource or name for a meter.
  • **query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:

A generator of sample objects

Return type:

Sample

statistics(meter, **query)[source]

Return a generator of statistics

Parameters:
  • meter – Meter resource or name for a meter.
  • **query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:

A generator of statistics objects

Return type:

Statistics

update_alarm(alarm, **attrs)[source]

Update a alarm

Parameters:alarm – Either the id of a alarm or a Alarm instance.
Attrs kwargs:The attributes to update on the alarm represented by value.
Returns:The updated alarm
Return type:Alarm

alarm

class ecl.telemetry.v2.alarm.Alarm(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

alarm_actions = None

The actions to do when alarm state changes to alarm

alarm_id = None

The ID of the alarm

allow_create = True
allow_delete = True
allow_list = True
allow_retrieve = True
allow_update = True
base_path = '/alarms'
change_state(session, next_state)[source]

Set the state of an alarm.

The next_state may be one of: ‘ok’ ‘insufficient data’ ‘alarm’

check_state(session)[source]

Retrieve the current state of an alarm from the service.

The properties of the alarm are not modified.

combination_rule = None
description = None

The description of the alarm

id_attribute = 'alarm_id'
insufficient_data_actions = None

The actions to do when alarm state changes to insufficient data

is_enabled = None

True if this alarm is enabled. Type: bool

is_repeat_actions = None

The actions should be re-triggered on each evaluation cycle. Type: bool

name = None

The name for the alarm

ok_actions = None

The actions to do when alarm state change to ok

project_id = None

The ID of the project that owns the alarm

service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
severity = None

The severity of the alarm

state = None

The state off the alarm

state_changed_at = None

The timestamp of the last alarm state change.

threshold_rule = None
time_constraints = None

Describe time constraints for the alarm

type = None

Explicit type specifier to select which rule to follow

updated_at = None

The timestamp of the last alarm definition update.

user_id = None

The ID of the user who created the alarm

alarm_change

class ecl.telemetry.v2.alarm_change.AlarmChange(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

alarm_id = None

The ID of the alarm

allow_list = True
base_path = '/alarms/%(alarm_id)s/history'
detail = None

Data describing the change

event_id = None

The ID of the change event

id_attribute = 'event_id'
classmethod list(session, limit=None, marker=None, path_args=None, paginated=False, **params)[source]
on_behalf_of_id = None

The project ID on behalf of which the change is being made

project_id = None

The project ID of the initiating identity

resource_key = 'alarm_change'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
triggered_at = None

The time/date of the alarm change.

type = None

The type of change

user_id = None

The user ID of the initiating identity

capability

class ecl.telemetry.v2.capability.Capability(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

allow_list = True
base_path = '/capabilities'
is_enabled = None
classmethod list(session, limit=None, marker=None, path_args=None, paginated=False, **params)[source]
resource_key = 'capability'
resources_key = 'capabilities'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}

meter

class ecl.telemetry.v2.meter.Meter(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

allow_list = True
base_path = '/meters'
id_attribute = 'meter_id'
meter_id = None

The ID of the meter

name = None

The unique name for the meter

project_id = None

The ID of the project that owns the resource

resource_id = None

The ID of the resource for which the measurements are taken

resource_key = 'meter'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
source = None

The name of the source where the meter comes from

type = None

The meter type

unit = None

The unit of measure

user_id = None

The ID of the user who last triggered an update to the resource

resource

class ecl.telemetry.v2.resource.Resource(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

allow_list = True
allow_retrieve = True
base_path = '/resources'
first_sample_at = None

UTC date & time not later than the first sample known for this resource.

id_attribute = 'resource_id'
last_sample_at = None

UTC date & time not earlier than the last sample known for this resource.

A list containing a self link and associated meter links

metadata = None

Arbitrary metadata associated with the resource

project_id = None

The ID of the owning project

resource_id = None

The ID for the resource

service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
source = None

The name of the source where the resource comes from

user_id = None

The ID of the user who created the resource or updated it last

sample

class ecl.telemetry.v2.sample.Sample(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

allow_create = True
allow_list = True
base_path = '/meters/%(counter_name)s'
counter_name = None

The meter name this sample is for

create(session)[source]
generated_at = None

When the sample has been generated.

id_attribute = 'sample_id'
classmethod list(session, limit=None, marker=None, path_args=None, paginated=False, **params)[source]
metadata = None

Arbitrary metadata associated with the sample

project_id = None

The ID of the project this sample was taken for

recorded_at = None

When the sample has been recorded.

resource_id = None

The ID of the resource this sample was taken for

service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
source = None

The name of the source that identifies where the sample comes from

type = None

The meter type

unit = None

The unit of measure

user_id = None

The ID of the user this sample was taken for

volume = None

The metered value

statistics

class ecl.telemetry.v2.statistics.Statistics(attrs=None, loaded=False)[source]

Bases: ecl.resource.Resource

Caution

This API is a work in progress and is subject to change.

aggregate = None

The selectable aggregate value(s)

allow_list = True
avg = None

The average of all of the volume values seen in the data

base_path = '/meters/%(meter_name)s/statistics'
count = None

The number of samples seen

duration = None

The difference, in seconds, between the oldest and newest timestamp

duration_end_at = None

UTC date and time of the oldest timestamp, or the query end time.

duration_start_at = None

UTC date and time of the earliest timestamp, or the query start time.

group_by = None

Dictionary of field names for group, if groupby statistics are requested

id_attribute = 'meter_name'
classmethod list(session, limit=None, marker=None, path_args=None, paginated=False, **params)[source]
max = None

The maximum volume seen in the data

meter_name = None
min = None

The minimum volume seen in the data

period = None

The difference, in seconds, between the period start and end

period_end_at = None

UTC date and time of the period end.

period_start_at = None

UTC date and time of the period start.

resource_key = 'statistics'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'metering', 'requires_project_id': False, 'api_version': None}
sum = None

The total of all of the volume values seen in the data

unit = None

The unit type of the data set