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
create_notification(options = {})
click to toggle source
def create_notification(options = {})
data = options.dup
request(
:body => JSON.encode(data),
:expects => [201],
:method => 'POST',
:path => 'notifications'
)
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
delete_notification(notification_id)
click to toggle source
def delete_notification(notification_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "notifications/#{notification_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(agent_id)
click to toggle source
def get_agent(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_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_cpus_info(agent_id)
click to toggle source
def get_cpus_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/cpus"
)
end
get_disks_info(agent_id)
click to toggle source
def get_disks_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/disks"
)
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
get_filesystems_info(agent_id)
click to toggle source
def get_filesystems_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/filesystems"
)
end
get_logged_in_user_info(agent_id)
click to toggle source
def get_logged_in_user_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/who"
)
end
get_memory_info(agent_id)
click to toggle source
def get_memory_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/memory"
)
end
get_monitoring_zone(by_id)
click to toggle source
def get_monitoring_zone by_id
request(
:expects => [200],
:method => 'GET',
:path => "monitoring_zones/#{by_id}"
)
end
get_network_interfaces_info(agent_id)
click to toggle source
def get_network_interfaces_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/network_interfaces"
)
end
get_notification(notification_id)
click to toggle source
def get_notification(notification_id)
request(
:expects => [200],
:method => 'GET',
:path => "notifications/#{notification_id}"
)
end
get_processes_info(agent_id)
click to toggle source
def get_processes_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/processes"
)
end
get_system_info(agent_id)
click to toggle source
def get_system_info(agent_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents/#{agent_id}/host_info/system"
)
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_agents()
click to toggle source
def list_agents
request(
:expects => [200, 203],
:method => 'GET',
:path => "agents"
)
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, options={})
click to toggle source
def list_alarms(entity_id, options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/alarms",
:query => options
)
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, options={})
click to toggle source
def list_checks(entity_id, options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => "entities/#{entity_id}/checks",
:query => options
)
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_monitoring_zones()
click to toggle source
def list_monitoring_zones
request(
:expects => [200],
:method => 'GET',
:path => "monitoring_zones"
)
end
list_notification_plans()
click to toggle source
def list_notification_plans
request(
:expects => [200],
:method => 'GET',
:path => "notification_plans"
)
end
list_notifications(options={})
click to toggle source
def list_notifications(options={})
request(
:expects => [200],
:method => 'GET',
:path => "notifications",
:query => options
)
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, alarm_id, options)
click to toggle source
def update_alarm(entity_id, alarm_id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{entity_id}/alarms/#{alarm_id}"
)
end
update_check(entity_id, check_id, options)
click to toggle source
def update_check(entity_id, check_id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{entity_id}/checks/#{check_id}"
)
end
update_entity(entity_id, options)
click to toggle source
def update_entity(entity_id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "entities/#{entity_id}"
)
end
update_notification(id, options)
click to toggle source
def update_notification(id, options)
request(
:body => JSON.encode(options),
:expects => [204],
:method => 'PUT',
:path => "notifications/#{id}"
)
end