pyrax
Python Bindings for the Rackspace Cloud
|
This is the base client for creating and managing Cloud Monitoring. More...
Public Member Functions | |
def | __init__ |
def | get_account |
Returns a dict with the following keys: id, webhook_token, and metadata. | |
def | get_limits |
Returns a dict with the resource and rate limits for the account. | |
def | get_audits |
Every write operation performed against the API (PUT, POST or DELETE) generates an audit record that is stored for 30 days. | |
def | list_entities |
def | get_entity |
def | create_entity |
def | update_entity |
Only the agent_id and metadata are able to be updated via the API. | |
def | delete_entity |
Deletes the specified entity. | |
def | list_check_types |
def | get_check_type |
def | list_checks |
def | create_check |
Creates a check on the entity with the specified attributes. | |
def | get_check |
Returns the current check for the given entity. | |
def | find_all_checks |
Finds all checks for a given entity with attributes matching ``**kwargs``. | |
def | update_check |
Updates an existing check with any of the parameters. | |
def | delete_check |
Deletes the specified check from the entity. | |
def | list_metrics |
Returns a list of all the metrics associated with the specified check. | |
def | get_metric_data_points |
Returns the data points for a given metric for the given period. | |
def | list_notifications |
Returns a list of all defined notifications. | |
def | get_notification |
Returns the CloudMonitorNotification object for the specified ID. | |
def | test_notification |
This allows you to test either an existing notification, or a potential notification before creating it. | |
def | create_notification |
Defines a notification for handling an alarm. | |
def | update_notification |
Updates the specified notification with the supplied details. | |
def | delete_notification |
Deletes the specified notification. | |
def | create_notification_plan |
Creates a notification plan to be executed when a monitoring check triggers an alarm. | |
def | list_notification_plans |
Returns a list of all defined notification plans. | |
def | get_notification_plan |
Returns the CloudMonitorNotificationPlan object for the specified ID. | |
def | delete_notification_plan |
Deletes the specified notification plan. | |
def | create_alarm |
Creates an alarm that binds the check on the given entity with a notification plan. | |
def | update_alarm |
Updates an existing alarm on the given entity. | |
def | list_alarms |
Returns a list of all the alarms created on the specified entity. | |
def | get_alarm |
Returns the alarm with the specified ID for the entity. | |
def | delete_alarm |
Deletes the specified alarm. | |
def | list_notification_types |
def | get_notification_type |
def | list_monitoring_zones |
Returns a list of all available monitoring zones. | |
def | get_monitoring_zone |
Returns the monitoring zone for the given ID. | |
def | list |
The following methods are defined in the generic client class, but don't have meaning in monitoring, as there is not a single resource that defines this module. | |
def | get |
Not applicable in Cloud Monitoring. | |
def | create |
Not applicable in Cloud Monitoring. | |
def | delete |
Not applicable in Cloud Monitoring. | |
def | find |
Not applicable in Cloud Monitoring. | |
def | findall |
Not applicable in Cloud Monitoring. | |
Public Attributes | |
name |
This is the base client for creating and managing Cloud Monitoring.
def __init__ | ( | self, | |
args, | |||
kwargs | |||
) |
def create | ( | self, | |
args, | |||
kwargs | |||
) |
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def create_alarm | ( | self, | |
entity, | |||
check, | |||
notification_plan, | |||
criteria = None , |
|||
disabled = False , |
|||
label = None , |
|||
name = None , |
|||
metadata = None |
|||
) |
Creates an alarm that binds the check on the given entity with a notification plan.
def create_check | ( | self, | |
entity, | |||
label = None , |
|||
name = None , |
|||
check_type = None , |
|||
disabled = False , |
|||
metadata = None , |
|||
details = None , |
|||
monitoring_zones_poll = None , |
|||
timeout = None , |
|||
period = None , |
|||
target_alias = None , |
|||
target_hostname = None , |
|||
target_receiver = None , |
|||
test_only = False , |
|||
include_debug = False |
|||
) |
Creates a check on the entity with the specified attributes.
The 'details' parameter should be a dict with the keys as the option name, and the value as the desired setting.
def create_entity | ( | self, | |
label = None , |
|||
name = None , |
|||
agent = None , |
|||
ip_addresses = None , |
|||
metadata = None |
|||
) |
def create_notification | ( | self, | |
notification_type, | |||
label = None , |
|||
name = None , |
|||
details = None |
|||
) |
Defines a notification for handling an alarm.
def create_notification_plan | ( | self, | |
label = None , |
|||
name = None , |
|||
critical_state = None , |
|||
ok_state = None , |
|||
warning_state = None |
|||
) |
Creates a notification plan to be executed when a monitoring check triggers an alarm.
def delete | ( | self, | |
item | |||
) |
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def delete_alarm | ( | self, | |
entity, | |||
alarm | |||
) |
Deletes the specified alarm.
def delete_check | ( | self, | |
entity, | |||
check | |||
) |
Deletes the specified check from the entity.
def delete_entity | ( | self, | |
entity | |||
) |
Deletes the specified entity.
def delete_notification | ( | self, | |
notification | |||
) |
Deletes the specified notification.
def delete_notification_plan | ( | self, | |
notification_plan | |||
) |
Deletes the specified notification plan.
def find | ( | self, | |
kwargs | |||
) |
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def find_all_checks | ( | self, | |
entity, | |||
kwargs | |||
) |
Finds all checks for a given entity with attributes matching ``**kwargs``.
This isn't very efficient: it loads the entire list then filters on the Python side.
def findall | ( | self, | |
kwargs | |||
) |
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def get | ( | self, | |
item | |||
) |
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def get_account | ( | self | ) |
Returns a dict with the following keys: id, webhook_token, and metadata.
def get_alarm | ( | self, | |
entity, | |||
alarm_id | |||
) |
Returns the alarm with the specified ID for the entity.
def get_audits | ( | self | ) |
Every write operation performed against the API (PUT, POST or DELETE) generates an audit record that is stored for 30 days.
Audits record a variety of information about the request including the method, URL, headers, query string, transaction ID, the request body and the response code. They also store information about the action performed including a JSON list of the previous state of any modified objects. For example, if you perform an update on an entity, this will record the state of the entity before modification.
def get_check | ( | self, | |
entity, | |||
check | |||
) |
Returns the current check for the given entity.
def get_check_type | ( | self, | |
check_type | |||
) |
def get_entity | ( | self, | |
entity | |||
) |
def get_limits | ( | self | ) |
Returns a dict with the resource and rate limits for the account.
def get_metric_data_points | ( | self, | |
entity, | |||
check, | |||
metric, | |||
start, | |||
end, | |||
points = None , |
|||
resolution = None , |
|||
stats = None |
|||
) |
Returns the data points for a given metric for the given period.
The 'start' and 'end' times must be specified; they can be be either Python date/datetime values, or a Unix timestamp.
The 'points' parameter represents the number of points to return. The 'resolution' parameter represents the granularity of the data. You must specify either 'points' or 'resolution'. The allowed values for resolution are: FULL MIN5 MIN20 MIN60 MIN240 MIN1440
Finally, the 'stats' parameter specifies the stats you want returned. By default only the 'average' is returned. You omit this parameter, pass in a single value, or pass in a list of values. The allowed values are: average variance min max
def get_monitoring_zone | ( | self, | |
mz_id | |||
) |
Returns the monitoring zone for the given ID.
def get_notification | ( | self, | |
notification_id | |||
) |
Returns the CloudMonitorNotification object for the specified ID.
def get_notification_plan | ( | self, | |
notification_plan_id | |||
) |
Returns the CloudMonitorNotificationPlan object for the specified ID.
def get_notification_type | ( | self, | |
nt_id | |||
) |
def list | ( | self, | |
limit = None , |
|||
marker = None |
|||
) |
The following methods are defined in the generic client class, but don't have meaning in monitoring, as there is not a single resource that defines this module.
Not applicable in Cloud Monitoring.
Reimplemented from BaseClient.
def list_alarms | ( | self, | |
entity | |||
) |
Returns a list of all the alarms created on the specified entity.
def list_check_types | ( | self | ) |
def list_checks | ( | self, | |
entity | |||
) |
def list_entities | ( | self | ) |
def list_metrics | ( | self, | |
entity, | |||
check | |||
) |
Returns a list of all the metrics associated with the specified check.
def list_monitoring_zones | ( | self | ) |
Returns a list of all available monitoring zones.
def list_notification_plans | ( | self | ) |
Returns a list of all defined notification plans.
def list_notification_types | ( | self | ) |
def list_notifications | ( | self | ) |
Returns a list of all defined notifications.
def test_notification | ( | self, | |
notification = None , |
|||
notification_type = None , |
|||
details = None |
|||
) |
This allows you to test either an existing notification, or a potential notification before creating it.
The actual notification comes from the same server where the actual alert messages come from. This allow you to, among other things, verify that your firewall is configured properly.
To test an existing notification, pass it as the 'notification' parameter and leave the other parameters empty. To pre-test a notification before creating it, leave 'notification' empty, but pass in the 'notification_type' and 'details'.
def update_alarm | ( | self, | |
entity, | |||
alarm, | |||
criteria = None , |
|||
disabled = False , |
|||
label = None , |
|||
name = None , |
|||
metadata = None |
|||
) |
Updates an existing alarm on the given entity.
def update_check | ( | self, | |
entity, | |||
check, | |||
label = None , |
|||
name = None , |
|||
disabled = None , |
|||
metadata = None , |
|||
monitoring_zones_poll = None , |
|||
timeout = None , |
|||
period = None , |
|||
target_alias = None , |
|||
target_hostname = None , |
|||
target_receiver = None |
|||
) |
Updates an existing check with any of the parameters.
def update_entity | ( | self, | |
entity, | |||
agent = None , |
|||
metadata = None |
|||
) |
Only the agent_id and metadata are able to be updated via the API.
def update_notification | ( | self, | |
notification, | |||
details | |||
) |
Updates the specified notification with the supplied details.
Reimplemented from BaseClient.