create_agent_token(options = {})
click to toggle source
def create_agent_token(options = {})
data = options.dup
request(
:body => JSON.encode(data),
:expects => [201],
:method => 'POST',
:path => 'agent_tokens'
)
end
create_alarm(entity_id, options = {})
click to toggle source
def create_alarm(entity_id, options = {})
data = options.dup
request(
:body => JSON.encode(data),
:expects => [201],
:method => 'POST',
:path => "entities/#{entity_id}/alarms"
)
end
create_check(entity_id, options = {})
click to toggle source
def create_check(entity_id, options = {})
data = options.dup
request(
:body => JSON.encode(data),
:expects => [201],
:method => 'POST',
:path => "entities/#{entity_id}/checks"
)
end
create_entity(options = {})
click to toggle source
def create_entity(options = {})
data = options.dup
request(
:body => JSON.encode(data),
:expects => [201],
:method => 'POST',
:path => 'entities'
)
end
delete_agent_token(token_id)
click to toggle source
def delete_agent_token(token_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "agent_tokens/#{token_id}"
)
end
delete_alarm(entity_id, alarm_id)
click to toggle source
def delete_alarm(entity_id, alarm_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "entities/#{entity_id}/alarms/#{alarm_id}"
)
end
delete_check(entity_id, check_id)
click to toggle source
def delete_check(entity_id, check_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "entities/#{entity_id}/checks/#{check_id}"
)
end
delete_entity(entity_id)
click to toggle source
def delete_entity(entity_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "entities/#{entity_id}"
)
end
endpoint_uri(service_endpoint_url=nil)
click to toggle source
def endpoint_uri(service_endpoint_url=nil)
@uri = super(@rackspace_endpoint || service_endpoint_url, :rackspace_monitoring_url)
end
evaluate_alarm_example(id, options = {})
click to toggle source
def evaluate_alarm_example(id, options = {})
options ||= {}
data = {:values => options.dup}
request(
:body => JSON.encode(data),
:expects => [200],
:method => 'POST',
:path => "alarm_examples/#{id}"
)
end
get_agent_token(id)
click to toggle source
def get_agent_token(id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agent_tokens/#{id}"
)
end
get_alarm(entity_id, alarm_id)
click to toggle source
def get_alarm(entity_id, alarm_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/alarms/#{alarm_id}"
)
end
get_alarm_example(id)
click to toggle source
def get_alarm_example(id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "alarm_examples/#{id}"
)
end
get_check(entity_id, check_id)
click to toggle source
def get_check(entity_id, check_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/checks/#{check_id}"
)
end
get_entity(entity_id)
click to toggle source
def get_entity(entity_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}"
)
end
list_agent_tokens(options={})
click to toggle source
def list_agent_tokens(options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => 'agent_tokens',
:query => options
)
end
list_alarm_examples()
click to toggle source
def list_alarm_examples
request(
:expects => [200, 203],
:method => 'GET',
:path => 'alarm_examples'
)
end
list_alarms(entity_id)
click to toggle source
def list_alarms(entity_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/alarms"
)
end
list_check_types()
click to toggle source
def list_check_types
request(
:expects => [200, 203],
:method => 'GET',
:path => "check_types"
)
end
list_checks(entity_id)
click to toggle source
def list_checks(entity_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/checks"
)
end
list_data_points(entity_id, check_id, metric_name, options)
click to toggle source
def list_data_points(entity_id, check_id, metric_name, options)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/checks/#{check_id}/metrics/#{metric_name}/plot",
:query => options
)
end
list_entities(options={})
click to toggle source
def list_entities(options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => 'entities',
:query => options
)
end
list_metrics(entity_id, check_id)
click to toggle source
def list_metrics(entity_id, check_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/checks/#{check_id}/metrics"
)
end
list_notification_plans()
click to toggle source
def list_notification_plans
request(
:expects => [200],
:method => 'GET',
:path => "notification_plans"
)
end
list_overview(options={})
click to toggle source
def list_overview(options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => "views/overview",
:query => options
)
end
region()
click to toggle source
def region
@rackspace_region
end
reload()
click to toggle source
def reload
@connection.reset
end
service_name()
click to toggle source
def service_name
:cloudMonitoring
end
update_alarm(entity_id, id, options)
click to toggle source
def update_alarm(entity_id, id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{entity_id}/alarms/#{id}"
)
end
update_check(entity_id, id, options)
click to toggle source
def update_check(entity_id, id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{entity_id}/checks/#{id}"
)
end
update_entity(id, options)
click to toggle source
def update_entity(id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{id}"
)
end