pyrax
Python Bindings for the Rackspace Cloud
|
Handles all of the entity-specific requests. More...
Public Member Functions | |
def | update_entity |
Updates the specified entity's values with the supplied parameters. | |
def | list_checks |
Returns a list of all CloudMonitorChecks defined for this entity. | |
def | create_check |
Creates a check on the entity with the specified attributes. | |
def | find_all_checks |
Finds all checks for a given entity with attributes matching ``**kwargs``. | |
def | update_check |
def | get_check |
Returns the current version of the check for the entity. | |
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 | 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 this entity. | |
def | delete_alarm |
Deletes the specified alarm. |
Handles all of the entity-specific requests.
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.
Note that the 'criteria' parameter, if supplied, should be a string representing the DSL for describing alerting conditions and their output states. Pyrax does not do any validation of these criteria statements; it is up to you as the developer to understand the language and correctly form the statement. This alarm language is documented online in the Cloud Monitoring section of http://docs.rackspace.com.
def create_check | ( | self, | |
entity, | |||
label = None , |
|||
name = None , |
|||
check_type = None , |
|||
details = None , |
|||
disabled = False , |
|||
metadata = 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.
If the 'test_only' parameter is True, then the check is not created; instead, the check is run and the results of the test run returned. If 'include_debug' is True, additional debug information is returned. According to the current Cloud Monitoring docs: "Currently debug information is only available for the remote.http check and includes the response body."
def delete_alarm | ( | self, | |
entity, | |||
alarm | |||
) |
Deletes the specified alarm.
def delete_check | ( | self, | |
entity, | |||
check | |||
) |
Deletes the specified check from the entity.
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 get_alarm | ( | self, | |
entity, | |||
alarm | |||
) |
Returns the alarm with the specified ID for this entity.
If a CloudMonitorAlarm instance is passed, returns a new CloudMonitorAlarm object with the current state from the API.
def get_check | ( | self, | |
entity, | |||
check | |||
) |
Returns the current version of the check for the entity.
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, a string representing a date/datetime in either of 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DD' formats, 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', but not both. The allowed values for resolution are: 'FULL', 'MIN5', 'MIN20', 'MIN60', 'MIN240', and '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', and 'max'
def list_alarms | ( | self, | |
entity | |||
) |
Returns a list of all the alarms created on the specified entity.
def list_checks | ( | self, | |
entity | |||
) |
Returns a list of all CloudMonitorChecks defined for this entity.
def list_metrics | ( | self, | |
entity, | |||
check | |||
) |
Returns a list of all the metrics associated with the specified check.
def update_alarm | ( | self, | |
entity, | |||
alarm, | |||
criteria = None , |
|||
disabled = False , |
|||
label = None , |
|||
name = None , |
|||
metadata = None |
|||
) |
Updates an existing alarm on the given entity.
See the comments on the 'create_alarm()' regarding the criteria parameter.
def update_check | ( | self, | |
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 |
|||
) |
def update_entity | ( | self, | |
entity, | |||
agent = None , |
|||
metadata = None |
|||
) |
Updates the specified entity's values with the supplied parameters.