CES API¶
The Cloud Eye Service Class¶
The CES high-level interface is available through the ces
member of a Connection
object. The
ces
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Alarm Rule Operations¶
- class otcextensions.sdk.ces.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- alarms(**query)
Return a generator of alarms
- Parameters:
query (dict) – Optional query parameters to be sent to limit the resources being returned.
- Returns:
A generator of alarm objects
- Return type:
- get_alarm(alarm)
Return a single alarm
- create_alarm(**attrs)
Create a new Alarm from attributes
- Parameters:
attrs (dict) – Keyword arguments which will be used to create a
otcextensions.sdk.ces.v1.alarm.Alarm
- delete_alarm(alarm, ignore_missing=True)
Delete a Alarm
- Parameters:
alarm – key id or an instance of
otcextensions.sdk.ces.v1.alarm.Alarm
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the alarm does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent alarm.
- Returns:
Alarm been deleted
- Return type:
- find_alarm(name_or_id, ignore_missing=True)
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 alarm does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent alarm.
- Returns:
None
- switch_alarm_state(alarm)
Enables or disables Alarm
- Parameters:
alarm – The value can be the ID of an alarm or a
Alarm
instance.- Returns:
None
Monitoring Data Operations¶
- class otcextensions.sdk.ces.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- metric_data(**query)
Return a generator of Metric Data
- Parameters:
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
- Returns:
A generator of metric data objects
- Return type:
Miscellaneous Operations¶
- class otcextensions.sdk.ces.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- event_data(**query)
- Return a generator of host configurations for a specified
event type in a specified period of time.
- Parameters:
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
- Returns:
A generator of event data objects
- Return type:
- metrics(**query)
Return a generator of metrics
- Parameters:
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
- Returns:
A generator of metric objects
- Return type:
- quotas()
Return a generator of quotas
- Returns:
A generator of quota objects
- Return type: