Class: Dogapi::Client
- Inherits:
-
Object
- Object
- Dogapi::Client
- Defined in:
- lib/dogapi/facade.rb
Overview
A simple DogAPI client
See Dogapi::V1 for the thick underlying clients
Class methods return a tuple of (response_code
, response_body
). Unless otherwise noted, the response body is deserialized JSON. Up-to-date information about the JSON object structure is available in the HTTP API documentation, here.
Instance Attribute Summary collapse
-
#datadog_host ⇒ Object
rubocop:disable Metrics/ClassLength.
-
#v2 ⇒ Object
Returns the value of attribute v2.
Instance Method Summary collapse
- #add_items_to_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
-
#add_tags(host_id, tags, source = nil) ⇒ Object
Add the tags to the given host.
-
#alert(query, options = {}) ⇒ Object
ALERTS.
-
#all_tags(source = nil) ⇒ Object
Get all tags and their associated hosts at your org.
- #aws_integration_create(config) ⇒ Object
- #aws_integration_delete(config) ⇒ Object
- #aws_integration_generate_external_id(config) ⇒ Object
-
#aws_integration_list ⇒ Object
AWS INTEGRATION.
- #aws_integration_list_namespaces ⇒ Object
- #aws_integration_update(config, new_config) ⇒ Object
-
#aws_logs_add_lambda(config) ⇒ Object
AWS Logs Integration.
- #aws_logs_check_lambda(config) ⇒ Object
- #aws_logs_check_services(config) ⇒ Object
- #aws_logs_integration_delete(config) ⇒ Object
- #aws_logs_integrations_list ⇒ Object
- #aws_logs_list_services ⇒ Object
- #aws_logs_save_services(config) ⇒ Object
- #azure_integration_create(config) ⇒ Object
- #azure_integration_delete(config) ⇒ Object
-
#azure_integration_list ⇒ Object
AZURE INTEGRATION.
- #azure_integration_update(config) ⇒ Object
- #azure_integration_update_host_filters(config) ⇒ Object
- #batch_metrics ⇒ Object
- #can_delete_monitors(monitor_ids) ⇒ Object
- #can_delete_service_level_objective(slo_ids) ⇒ Object
- #cancel_downtime(downtime_id) ⇒ Object
- #cancel_downtime_by_scope(scope) ⇒ Object
-
#comment(message, options = {}) ⇒ Object
Post a comment.
-
#create_board(title, widgets, layout_type, options = {}) ⇒ Object
Create a dashboard.
-
#create_dashboard(title, description, graphs, template_variables = nil, read_only = false) ⇒ Object
Create a dashboard.
-
#create_dashboard_list(name) ⇒ Object
DASHBOARD LISTS.
- #create_embed(graph_json, description = {}) ⇒ Object
-
#create_integration(source_type_name, config) ⇒ Object
INTEGRATIONS.
-
#create_logs_pipeline(name, filter, options = {}) ⇒ Object
LOGS PIPELINES.
-
#create_screenboard(description) ⇒ Object
SCREENBOARD.
-
#create_service_level_objective(type, slo_name, thresholds, options = {}) ⇒ Object
SERVICE LEVEL OBJECTIVES.
-
#create_synthetics_test(type, config, options = {}) ⇒ Object
SYNTHETICS.
- #create_user(description = {}) ⇒ Object
- #delete_alert(alert_id) ⇒ Object
-
#delete_board(dashboard_id) ⇒ Object
Delete the given dashboard.
- #delete_comment(comment_id) ⇒ Object
-
#delete_dashboard(dash_id) ⇒ Object
Delete the given dashboard.
- #delete_dashboard_list(dashboard_list_id) ⇒ Object
-
#delete_event(id) ⇒ Object
Delete an event.
- #delete_integration(source_type_name) ⇒ Object
- #delete_items_from_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
- #delete_logs_pipeline(pipeline_id) ⇒ Object
- #delete_many_service_level_objective(slo_ids) ⇒ Object
- #delete_monitor(monitor_id, options = {}) ⇒ Object
- #delete_screenboard(board_id) ⇒ Object
- #delete_service_level_objective(slo_id) ⇒ Object
- #delete_synthetics_tests(test_ids) ⇒ Object
- #delete_timeframes_service_level_objective(ops) ⇒ Object
-
#detach_tags(host_id, source = nil) ⇒ Object
Remove all tags from the given host.
-
#detatch_tags(host_id) ⇒ Object
DEPRECATED: Spelling mistake temporarily preserved as an alias.
- #disable_user(handle) ⇒ Object
-
#emit_event(event, options = {}) ⇒ Object
Record an event.
-
#emit_point(metric, value, options = {}) ⇒ Object
Record a single point of metric data.
-
#emit_points(metric, points, options = {}) ⇒ Object
Record a set of points of metric data.
- #enable_embed(embed_id) ⇒ Object
- #gcp_integration_create(config) ⇒ Object
- #gcp_integration_delete(config) ⇒ Object
-
#gcp_integration_list ⇒ Object
GCP INTEGRATION.
- #gcp_integration_update(config) ⇒ Object
-
#get_active_metrics(from) ⇒ Object
Get a list of active metrics since a given time
from
The seconds since the unix epoch[Time, Integer]
. - #get_alert(alert_id) ⇒ Object
- #get_all_alerts ⇒ Object
-
#get_all_boards ⇒ Object
Fetch all dashboards.
- #get_all_dashboard_lists ⇒ Object
- #get_all_downtimes(options = {}) ⇒ Object
-
#get_all_embeds ⇒ Object
EMBEDS.
- #get_all_logs_pipelines ⇒ Object
- #get_all_monitors(options = {}) ⇒ Object
- #get_all_screenboards ⇒ Object
- #get_all_synthetics_tests ⇒ Object
- #get_all_users ⇒ Object
-
#get_board(dashboard_id) ⇒ Object
Fetch the given dashboard.
- #get_custom_metrics_usage(start_hr, end_hr = nil) ⇒ Object
-
#get_dashboard(dash_id) ⇒ Object
Fetch the given dashboard.
- #get_dashboard_list(dashboard_list_id) ⇒ Object
-
#get_dashboards ⇒ Object
Fetch all of the dashboards.
- #get_downtime(downtime_id, options = {}) ⇒ Object
- #get_embed(embed_id, description = {}) ⇒ Object
-
#get_event(id) ⇒ Object
Get the details of an event.
- #get_fargate_usage(start_hr, end_hr = nil) ⇒ Object
-
#get_hosts_usage(start_hr, end_hr = nil) ⇒ Object
Get hourly usage information for different datadog service Usage data is delayed by up to 72 hours from when it was incurred.
- #get_integration(source_type_name) ⇒ Object
- #get_items_of_dashboard_list(dashboard_list_id) ⇒ Object
- #get_logs_pipeline(pipeline_id) ⇒ Object
- #get_logs_usage(start_hr, end_hr = nil) ⇒ Object
-
#get_metadata(metric) ⇒ Object
Get metadata information on an existing Datadog metric.
- #get_monitor(monitor_id, options = {}) ⇒ Object
-
#get_points(query, from, to) ⇒ Object
Get a set of points by query between from and to.
- #get_screenboard(board_id) ⇒ Object
- #get_service_level_objective(slo_id) ⇒ Object
- #get_service_level_objective_history(slo_id, from_ts, to_ts) ⇒ Object
- #get_synthetics_devices ⇒ Object
- #get_synthetics_locations ⇒ Object
- #get_synthetics_result(test_id, result_id) ⇒ Object
- #get_synthetics_results(test_id) ⇒ Object
- #get_synthetics_test(test_id) ⇒ Object
- #get_synthetics_usage(start_hr, end_hr = nil) ⇒ Object
- #get_traces_usage(start_hr, end_hr = nil) ⇒ Object
- #get_user(handle) ⇒ Object
-
#graph_snapshot(metric_query, start_ts, end_ts, event_query = nil) ⇒ Object
Graph snapshot.
-
#host_tags(host_id, source = nil, by_source = false) ⇒ Object
Get all tags for the given host.
- #host_totals ⇒ Object
-
#initialize(api_key, application_key = nil, host = nil, device = nil, silent = true, timeout = nil, endpoint = nil, skip_ssl_validation = false) ⇒ Client
constructor
rubocop:disable Metrics/MethodLength, Metrics/LineLength.
-
#invite(emails, options = {}) ⇒ Object
User invite.
-
#monitor(type, query, options = {}) ⇒ Object
MONITORS.
- #mute_alerts ⇒ Object
-
#mute_host(hostname, options = {}) ⇒ Object
HOST MUTING.
- #mute_monitor(monitor_id, options = {}) ⇒ Object
- #mute_monitors ⇒ Object
- #resolve_monitors(monitor_groups = [], options = {}, version = nil) ⇒ Object
- #revoke_embed(embed_id) ⇒ Object
- #revoke_screenboard(board_id) ⇒ Object
-
#schedule_downtime(scope, options = {}) ⇒ Object
MONITOR DOWNTIME.
-
#search(query) ⇒ Object
Run the given search query.
-
#search_hosts(options = {}) ⇒ Object
HOSTS.
- #search_monitor_groups(options = {}) ⇒ Object
- #search_monitors(options = {}) ⇒ Object
- #search_service_level_objective(slo_ids = nil, query = nil, offset = nil, limit = nil) ⇒ Object
-
#service_check(check, host, status, options = {}) ⇒ Object
SERVICE CHECKS.
- #share_screenboard(board_id) ⇒ Object
-
#start_event(event, options = {}) ⇒ Object
DEPRECATED: Recording events with a duration has been deprecated.
- #start_pause_synthetics_test(test_id, new_status) ⇒ Object
-
#stream(start, stop, options = {}) ⇒ Object
Get an optionally filtered event stream.
- #unmute_alerts ⇒ Object
- #unmute_host(hostname) ⇒ Object
- #unmute_monitor(monitor_id, options = {}) ⇒ Object
- #unmute_monitors ⇒ Object
- #update_alert(alert_id, query, options = {}) ⇒ Object
-
#update_board(dashboard_id, title, widgets, layout_type, options = {}) ⇒ Object
Update a dashboard.
-
#update_comment(comment_id, options = {}) ⇒ Object
Post a comment.
-
#update_dashboard(dash_id, title, description, graphs, template_variables = nil, read_only = false) ⇒ Object
Update a dashboard.
- #update_dashboard_list(dashboard_list_id, name) ⇒ Object
- #update_downtime(downtime_id, options = {}) ⇒ Object
- #update_integration(source_type_name, config) ⇒ Object
- #update_items_of_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
- #update_logs_pipeline(pipeline_id, name, filter, options = {}) ⇒ Object
-
#update_metadata(metric, options = {}) ⇒ Object
Update metadata fields for an existing Datadog metric.
- #update_monitor(monitor_id, query, options = {}) ⇒ Object
- #update_screenboard(board_id, description) ⇒ Object
- #update_service_level_objective(slo_id, type, options = {}) ⇒ Object
- #update_synthetics_test(test_id, type, config, options = {}) ⇒ Object
-
#update_tags(host_id, tags, source = nil) ⇒ Object
Replace the tags on the given host.
- #update_user(handle, description = {}) ⇒ Object
- #validate_monitor(type, query, options = {}) ⇒ Object
Constructor Details
#initialize(api_key, application_key = nil, host = nil, device = nil, silent = true, timeout = nil, endpoint = nil, skip_ssl_validation = false) ⇒ Client
rubocop:disable Metrics/MethodLength, Metrics/LineLength
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/dogapi/facade.rb', line 68 def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil, skip_ssl_validation=false) if api_key @api_key = api_key else raise 'Please provide an API key to submit your data' end @application_key = application_key @datadog_host = endpoint || Dogapi.find_datadog_host() @host = host || Dogapi.find_localhost() @device = device # FIXME: refactor to avoid all this code duplication @metric_svc = Dogapi::V1::MetricService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @event_svc = Dogapi::V1::EventService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @tag_svc = Dogapi::V1::TagService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @comment_svc = Dogapi::V1::CommentService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @search_svc = Dogapi::V1::SearchService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @dash_service = Dogapi::V1::DashService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @dashboard_service = Dogapi::V1::DashboardService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @dashboard_list_service = Dogapi::V1::DashboardListService.new( @api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation ) @alert_svc = Dogapi::V1::AlertService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @user_svc = Dogapi::V1::UserService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @snapshot_svc = Dogapi::V1::SnapshotService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @embed_svc = Dogapi::V1::EmbedService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @screenboard_svc = Dogapi::V1::ScreenboardService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @monitor_svc = Dogapi::V1::MonitorService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @synthetics_svc = Dogapi::V1::SyntheticsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @service_check_svc = Dogapi::V1::ServiceCheckService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @metadata_svc = Dogapi::V1::MetadataService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @legacy_event_svc = Dogapi::EventService.new(@datadog_host) @hosts_svc = Dogapi::V1::HostsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @integration_svc = Dogapi::V1::IntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @aws_integration_svc = Dogapi::V1::AwsIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @aws_logs_svc = Dogapi::V1::AwsLogsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @usage_svc = Dogapi::V1::UsageService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @azure_integration_svc = Dogapi::V1::AzureIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @gcp_integration_svc = Dogapi::V1::GcpIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @service_level_objective_svc = Dogapi::V1::ServiceLevelObjectiveService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) @logs_pipeline_svc = Dogapi::V1::LogsPipelineService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation) # Support for Dashboard List API v2. @v2 = Dogapi::ClientV2.new(@api_key, @application_key, true, true, @datadog_host, skip_ssl_validation) end |
Instance Attribute Details
#datadog_host ⇒ Object
rubocop:disable Metrics/ClassLength
63 64 65 |
# File 'lib/dogapi/facade.rb', line 63 def datadog_host @datadog_host end |
#v2 ⇒ Object
Returns the value of attribute v2.
64 65 66 |
# File 'lib/dogapi/facade.rb', line 64 def v2 @v2 end |
Instance Method Details
#add_items_to_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
406 407 408 |
# File 'lib/dogapi/facade.rb', line 406 def add_items_to_dashboard_list(dashboard_list_id, dashboards) @dashboard_list_service.add_items(dashboard_list_id, dashboards) end |
#add_tags(host_id, tags, source = nil) ⇒ Object
Add the tags to the given host
host_id
can be the host’s numeric id or string name
tags
is and Array of Strings
298 299 300 |
# File 'lib/dogapi/facade.rb', line 298 def (host_id, , source=nil) @tag_svc.add(host_id, , source) end |
#alert(query, options = {}) ⇒ Object
ALERTS
426 427 428 |
# File 'lib/dogapi/facade.rb', line 426 def alert(query, = {}) @alert_svc.alert(query, ) end |
#all_tags(source = nil) ⇒ Object
Get all tags and their associated hosts at your org
282 283 284 |
# File 'lib/dogapi/facade.rb', line 282 def (source=nil) @tag_svc.get_all(source) end |
#aws_integration_create(config) ⇒ Object
818 819 820 |
# File 'lib/dogapi/facade.rb', line 818 def aws_integration_create(config) @aws_integration_svc.aws_integration_create(config) end |
#aws_integration_delete(config) ⇒ Object
822 823 824 |
# File 'lib/dogapi/facade.rb', line 822 def aws_integration_delete(config) @aws_integration_svc.aws_integration_delete(config) end |
#aws_integration_generate_external_id(config) ⇒ Object
830 831 832 |
# File 'lib/dogapi/facade.rb', line 830 def aws_integration_generate_external_id(config) @aws_integration_svc.aws_integration_generate_external_id(config) end |
#aws_integration_list ⇒ Object
AWS INTEGRATION
814 815 816 |
# File 'lib/dogapi/facade.rb', line 814 def aws_integration_list @aws_integration_svc.aws_integration_list end |
#aws_integration_list_namespaces ⇒ Object
826 827 828 |
# File 'lib/dogapi/facade.rb', line 826 def aws_integration_list_namespaces @aws_integration_svc.aws_integration_list_namespaces end |
#aws_integration_update(config, new_config) ⇒ Object
834 835 836 |
# File 'lib/dogapi/facade.rb', line 834 def aws_integration_update(config, new_config) @aws_integration_svc.aws_integration_update(config, new_config) end |
#aws_logs_add_lambda(config) ⇒ Object
AWS Logs Integration
842 843 844 |
# File 'lib/dogapi/facade.rb', line 842 def aws_logs_add_lambda(config) @aws_logs_svc.aws_logs_add_lambda(config) end |
#aws_logs_check_lambda(config) ⇒ Object
862 863 864 |
# File 'lib/dogapi/facade.rb', line 862 def aws_logs_check_lambda(config) @aws_logs_svc.aws_logs_check_lambda(config) end |
#aws_logs_check_services(config) ⇒ Object
866 867 868 |
# File 'lib/dogapi/facade.rb', line 866 def aws_logs_check_services(config) @aws_logs_svc.aws_logs_check_services(config) end |
#aws_logs_integration_delete(config) ⇒ Object
858 859 860 |
# File 'lib/dogapi/facade.rb', line 858 def aws_logs_integration_delete(config) @aws_logs_svc.aws_logs_integration_delete(config) end |
#aws_logs_integrations_list ⇒ Object
854 855 856 |
# File 'lib/dogapi/facade.rb', line 854 def aws_logs_integrations_list @aws_logs_svc.aws_logs_integrations_list end |
#aws_logs_list_services ⇒ Object
846 847 848 |
# File 'lib/dogapi/facade.rb', line 846 def aws_logs_list_services @aws_logs_svc.aws_logs_list_services end |
#aws_logs_save_services(config) ⇒ Object
850 851 852 |
# File 'lib/dogapi/facade.rb', line 850 def aws_logs_save_services(config) @aws_logs_svc.aws_logs_save_services(config) end |
#azure_integration_create(config) ⇒ Object
878 879 880 |
# File 'lib/dogapi/facade.rb', line 878 def azure_integration_create(config) @azure_integration_svc.azure_integration_create(config) end |
#azure_integration_delete(config) ⇒ Object
882 883 884 |
# File 'lib/dogapi/facade.rb', line 882 def azure_integration_delete(config) @azure_integration_svc.azure_integration_delete(config) end |
#azure_integration_list ⇒ Object
AZURE INTEGRATION
874 875 876 |
# File 'lib/dogapi/facade.rb', line 874 def azure_integration_list @azure_integration_svc.azure_integration_list end |
#azure_integration_update(config) ⇒ Object
890 891 892 |
# File 'lib/dogapi/facade.rb', line 890 def azure_integration_update(config) @azure_integration_svc.azure_integration_update(config) end |
#azure_integration_update_host_filters(config) ⇒ Object
886 887 888 |
# File 'lib/dogapi/facade.rb', line 886 def azure_integration_update_host_filters(config) @azure_integration_svc.azure_integration_update_host_filters(config) end |
#batch_metrics ⇒ Object
176 177 178 179 180 181 182 183 184 |
# File 'lib/dogapi/facade.rb', line 176 def batch_metrics() @metric_svc.switch_to_batched begin yield @metric_svc.flush_buffer # flush_buffer should returns the response from last API call ensure @metric_svc.switch_to_single end end |
#can_delete_monitors(monitor_ids) ⇒ Object
597 598 599 |
# File 'lib/dogapi/facade.rb', line 597 def can_delete_monitors(monitor_ids) @monitor_svc.can_delete_monitors(monitor_ids) end |
#can_delete_service_level_objective(slo_ids) ⇒ Object
705 706 707 |
# File 'lib/dogapi/facade.rb', line 705 def can_delete_service_level_objective(slo_ids) @service_level_objective_svc.can_delete_service_level_objective(slo_ids) end |
#cancel_downtime(downtime_id) ⇒ Object
657 658 659 |
# File 'lib/dogapi/facade.rb', line 657 def cancel_downtime(downtime_id) @monitor_svc.cancel_downtime(downtime_id) end |
#cancel_downtime_by_scope(scope) ⇒ Object
661 662 663 |
# File 'lib/dogapi/facade.rb', line 661 def cancel_downtime_by_scope(scope) @monitor_svc.cancel_downtime_by_scope(scope) end |
#comment(message, options = {}) ⇒ Object
Post a comment
254 255 256 |
# File 'lib/dogapi/facade.rb', line 254 def comment(, = {}) @comment_svc.comment(, ) end |
#create_board(title, widgets, layout_type, options = {}) ⇒ Object
Create a dashboard.
358 359 360 |
# File 'lib/dogapi/facade.rb', line 358 def create_board(title, , layout_type, = {}) @dashboard_service.create_board(title, , layout_type, ) end |
#create_dashboard(title, description, graphs, template_variables = nil, read_only = false) ⇒ Object
Create a dashboard.
329 330 331 |
# File 'lib/dogapi/facade.rb', line 329 def create_dashboard(title, description, graphs, template_variables = nil, read_only = false) @dash_service.create_dashboard(title, description, graphs, template_variables, read_only) end |
#create_dashboard_list(name) ⇒ Object
DASHBOARD LISTS
386 387 388 |
# File 'lib/dogapi/facade.rb', line 386 def create_dashboard_list(name) @dashboard_list_service.create(name) end |
#create_embed(graph_json, description = {}) ⇒ Object
495 496 497 |
# File 'lib/dogapi/facade.rb', line 495 def (graph_json, description= {}) @embed_svc.(graph_json, description) end |
#create_integration(source_type_name, config) ⇒ Object
INTEGRATIONS
795 796 797 |
# File 'lib/dogapi/facade.rb', line 795 def create_integration(source_type_name, config) @integration_svc.create_integration(source_type_name, config) end |
#create_logs_pipeline(name, filter, options = {}) ⇒ Object
LOGS PIPELINES
725 726 727 |
# File 'lib/dogapi/facade.rb', line 725 def create_logs_pipeline(name, filter, = {}) @logs_pipeline_svc.create_logs_pipeline(name, filter, ) end |
#create_screenboard(description) ⇒ Object
SCREENBOARD
510 511 512 |
# File 'lib/dogapi/facade.rb', line 510 def create_screenboard(description) @screenboard_svc.create_screenboard(description) end |
#create_service_level_objective(type, slo_name, thresholds, options = {}) ⇒ Object
SERVICE LEVEL OBJECTIVES
685 686 687 |
# File 'lib/dogapi/facade.rb', line 685 def create_service_level_objective(type, slo_name, thresholds, = {}) @service_level_objective_svc.create_service_level_objective(type, slo_name, thresholds, ) end |
#create_synthetics_test(type, config, options = {}) ⇒ Object
SYNTHETICS
541 542 543 |
# File 'lib/dogapi/facade.rb', line 541 def create_synthetics_test(type, config, = {}) @synthetics_svc.create_synthetics_test(type, config, ) end |
#create_user(description = {}) ⇒ Object
459 460 461 |
# File 'lib/dogapi/facade.rb', line 459 def create_user(description= {}) @user_svc.create_user(description) end |
#delete_alert(alert_id) ⇒ Object
438 439 440 |
# File 'lib/dogapi/facade.rb', line 438 def delete_alert(alert_id) @alert_svc.delete_alert(alert_id) end |
#delete_board(dashboard_id) ⇒ Object
Delete the given dashboard.
378 379 380 |
# File 'lib/dogapi/facade.rb', line 378 def delete_board(dashboard_id) @dashboard_service.delete_board(dashboard_id) end |
#delete_comment(comment_id) ⇒ Object
263 264 265 |
# File 'lib/dogapi/facade.rb', line 263 def delete_comment(comment_id) @comment_svc.delete_comment(comment_id) end |
#delete_dashboard(dash_id) ⇒ Object
Delete the given dashboard.
349 350 351 |
# File 'lib/dogapi/facade.rb', line 349 def delete_dashboard(dash_id) @dash_service.delete_dashboard(dash_id) end |
#delete_dashboard_list(dashboard_list_id) ⇒ Object
402 403 404 |
# File 'lib/dogapi/facade.rb', line 402 def delete_dashboard_list(dashboard_list_id) @dashboard_list_service.delete(dashboard_list_id) end |
#delete_event(id) ⇒ Object
Delete an event
id
of the event to delete
217 218 219 |
# File 'lib/dogapi/facade.rb', line 217 def delete_event(id) @event_svc.delete(id) end |
#delete_integration(source_type_name) ⇒ Object
807 808 809 |
# File 'lib/dogapi/facade.rb', line 807 def delete_integration(source_type_name) @integration_svc.delete_integration(source_type_name) end |
#delete_items_from_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
414 415 416 |
# File 'lib/dogapi/facade.rb', line 414 def delete_items_from_dashboard_list(dashboard_list_id, dashboards) @dashboard_list_service.delete_items(dashboard_list_id, dashboards) end |
#delete_logs_pipeline(pipeline_id) ⇒ Object
741 742 743 |
# File 'lib/dogapi/facade.rb', line 741 def delete_logs_pipeline(pipeline_id) @logs_pipeline_svc.delete_logs_pipeline(pipeline_id) end |
#delete_many_service_level_objective(slo_ids) ⇒ Object
713 714 715 |
# File 'lib/dogapi/facade.rb', line 713 def delete_many_service_level_objective(slo_ids) @service_level_objective_svc.delete_many_service_level_objective(slo_ids) end |
#delete_monitor(monitor_id, options = {}) ⇒ Object
601 602 603 |
# File 'lib/dogapi/facade.rb', line 601 def delete_monitor(monitor_id, = {}) @monitor_svc.delete_monitor(monitor_id, ) end |
#delete_screenboard(board_id) ⇒ Object
526 527 528 |
# File 'lib/dogapi/facade.rb', line 526 def delete_screenboard(board_id) @screenboard_svc.delete_screenboard(board_id) end |
#delete_service_level_objective(slo_id) ⇒ Object
709 710 711 |
# File 'lib/dogapi/facade.rb', line 709 def delete_service_level_objective(slo_id) @service_level_objective_svc.delete_service_level_objective(slo_id) end |
#delete_synthetics_tests(test_ids) ⇒ Object
549 550 551 |
# File 'lib/dogapi/facade.rb', line 549 def delete_synthetics_tests(test_ids) @synthetics_svc.delete_synthetics_tests(test_ids) end |
#delete_timeframes_service_level_objective(ops) ⇒ Object
717 718 719 |
# File 'lib/dogapi/facade.rb', line 717 def delete_timeframes_service_level_objective(ops) @service_level_objective_svc.delete_timeframes_service_level_objective(ops) end |
#detach_tags(host_id, source = nil) ⇒ Object
Remove all tags from the given host
host_id
can be the host’s numeric id or string name
320 321 322 |
# File 'lib/dogapi/facade.rb', line 320 def (host_id, source=nil) @tag_svc.detach(host_id, source) end |
#detatch_tags(host_id) ⇒ Object
DEPRECATED: Spelling mistake temporarily preserved as an alias.
312 313 314 315 |
# File 'lib/dogapi/facade.rb', line 312 def (host_id) warn '[DEPRECATION] Dogapi::Client.detatch() is deprecated. Use `detach` instead.' (host_id) end |
#disable_user(handle) ⇒ Object
475 476 477 |
# File 'lib/dogapi/facade.rb', line 475 def disable_user(handle) @user_svc.disable_user(handle) end |
#emit_event(event, options = {}) ⇒ Object
Record an event
Optional arguments:
:host => String
:device => String
201 202 203 204 205 |
# File 'lib/dogapi/facade.rb', line 201 def emit_event(event, = {}) scope = override_scope @event_svc.post(event, scope) end |
#emit_point(metric, value, options = {}) ⇒ Object
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/dogapi/facade.rb', line 132 def emit_point(metric, value, = {}) defaults = { :timestamp => Time.now } = defaults.merge() self.emit_points( metric, [[[:timestamp], value]], ) end |
#emit_points(metric, points, options = {}) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/dogapi/facade.rb', line 154 def emit_points(metric, points, = {}) scope = override_scope points.each do |p| p[0].kind_of? Time or raise 'Not a Time' p[0] = p[0].to_i p[1] = p[1].to_f # TODO: stupid to_f will never raise an exception end @metric_svc.submit(metric, points, scope, ) end |
#enable_embed(embed_id) ⇒ Object
499 500 501 |
# File 'lib/dogapi/facade.rb', line 499 def () @embed_svc.() end |
#gcp_integration_create(config) ⇒ Object
905 906 907 |
# File 'lib/dogapi/facade.rb', line 905 def gcp_integration_create(config) @gcp_integration_svc.gcp_integration_create(config) end |
#gcp_integration_delete(config) ⇒ Object
901 902 903 |
# File 'lib/dogapi/facade.rb', line 901 def gcp_integration_delete(config) @gcp_integration_svc.gcp_integration_delete(config) end |
#gcp_integration_list ⇒ Object
GCP INTEGRATION
897 898 899 |
# File 'lib/dogapi/facade.rb', line 897 def gcp_integration_list @gcp_integration_svc.gcp_integration_list end |
#gcp_integration_update(config) ⇒ Object
909 910 911 |
# File 'lib/dogapi/facade.rb', line 909 def gcp_integration_update(config) @gcp_integration_svc.gcp_integration_update(config) end |
#get_active_metrics(from) ⇒ Object
Get a list of active metrics since a given time from
The seconds since the unix epoch [Time, Integer]
189 190 191 |
# File 'lib/dogapi/facade.rb', line 189 def get_active_metrics(from) @metric_svc.get_active_metrics(from) end |
#get_alert(alert_id) ⇒ Object
434 435 436 |
# File 'lib/dogapi/facade.rb', line 434 def get_alert(alert_id) @alert_svc.get_alert(alert_id) end |
#get_all_alerts ⇒ Object
442 443 444 |
# File 'lib/dogapi/facade.rb', line 442 def get_all_alerts() @alert_svc.get_all_alerts() end |
#get_all_boards ⇒ Object
Fetch all dashboards.
373 374 375 |
# File 'lib/dogapi/facade.rb', line 373 def get_all_boards() @dashboard_service.get_all_boards() end |
#get_all_dashboard_lists ⇒ Object
398 399 400 |
# File 'lib/dogapi/facade.rb', line 398 def get_all_dashboard_lists() @dashboard_list_service.all() end |
#get_all_downtimes(options = {}) ⇒ Object
665 666 667 |
# File 'lib/dogapi/facade.rb', line 665 def get_all_downtimes(= {}) @monitor_svc.get_all_downtimes() end |
#get_all_embeds ⇒ Object
EMBEDS
487 488 489 |
# File 'lib/dogapi/facade.rb', line 487 def () @embed_svc.() end |
#get_all_logs_pipelines ⇒ Object
733 734 735 |
# File 'lib/dogapi/facade.rb', line 733 def get_all_logs_pipelines @logs_pipeline_svc.get_all_logs_pipelines end |
#get_all_monitors(options = {}) ⇒ Object
605 606 607 |
# File 'lib/dogapi/facade.rb', line 605 def get_all_monitors(= {}) @monitor_svc.get_all_monitors() end |
#get_all_screenboards ⇒ Object
522 523 524 |
# File 'lib/dogapi/facade.rb', line 522 def get_all_screenboards() @screenboard_svc.get_all_screenboards() end |
#get_all_synthetics_tests ⇒ Object
557 558 559 |
# File 'lib/dogapi/facade.rb', line 557 def get_all_synthetics_tests @synthetics_svc.get_all_synthetics_tests() end |
#get_all_users ⇒ Object
463 464 465 |
# File 'lib/dogapi/facade.rb', line 463 def get_all_users() @user_svc.get_all_users() end |
#get_board(dashboard_id) ⇒ Object
Fetch the given dashboard.
368 369 370 |
# File 'lib/dogapi/facade.rb', line 368 def get_board(dashboard_id) @dashboard_service.get_board(dashboard_id) end |
#get_custom_metrics_usage(start_hr, end_hr = nil) ⇒ Object
932 933 934 |
# File 'lib/dogapi/facade.rb', line 932 def get_custom_metrics_usage(start_hr, end_hr = nil) @usage_svc.get_custom_metrics_usage(start_hr, end_hr) end |
#get_dashboard(dash_id) ⇒ Object
Fetch the given dashboard.
339 340 341 |
# File 'lib/dogapi/facade.rb', line 339 def get_dashboard(dash_id) @dash_service.get_dashboard(dash_id) end |
#get_dashboard_list(dashboard_list_id) ⇒ Object
394 395 396 |
# File 'lib/dogapi/facade.rb', line 394 def get_dashboard_list(dashboard_list_id) @dashboard_list_service.get(dashboard_list_id) end |
#get_dashboards ⇒ Object
Fetch all of the dashboards.
344 345 346 |
# File 'lib/dogapi/facade.rb', line 344 def get_dashboards @dash_service.get_dashboards end |
#get_downtime(downtime_id, options = {}) ⇒ Object
653 654 655 |
# File 'lib/dogapi/facade.rb', line 653 def get_downtime(downtime_id, = {}) @monitor_svc.get_downtime(downtime_id, ) end |
#get_embed(embed_id, description = {}) ⇒ Object
491 492 493 |
# File 'lib/dogapi/facade.rb', line 491 def (, description= {}) @embed_svc.(, description) end |
#get_event(id) ⇒ Object
Get the details of an event
id
of the event to get
210 211 212 |
# File 'lib/dogapi/facade.rb', line 210 def get_event(id) @event_svc.get(id) end |
#get_fargate_usage(start_hr, end_hr = nil) ⇒ Object
944 945 946 |
# File 'lib/dogapi/facade.rb', line 944 def get_fargate_usage(start_hr, end_hr = nil) @usage_svc.get_fargate_usage(start_hr, end_hr) end |
#get_hosts_usage(start_hr, end_hr = nil) ⇒ Object
Get hourly usage information for different datadog service Usage data is delayed by up to 72 hours from when it was incurred. It is retained for the past 15 months.# format of dates is ISO-8601 UTC YYYY-MM-DDThh ex:
require 'time'
Time.now.utc.strftime('%Y-%m-%dT%H')
> “2019-05-05T13”
924 925 926 |
# File 'lib/dogapi/facade.rb', line 924 def get_hosts_usage(start_hr, end_hr = nil) @usage_svc.get_hosts_usage(start_hr, end_hr) end |
#get_integration(source_type_name) ⇒ Object
803 804 805 |
# File 'lib/dogapi/facade.rb', line 803 def get_integration(source_type_name) @integration_svc.get_integration(source_type_name) end |
#get_items_of_dashboard_list(dashboard_list_id) ⇒ Object
418 419 420 |
# File 'lib/dogapi/facade.rb', line 418 def get_items_of_dashboard_list(dashboard_list_id) @dashboard_list_service.get_items(dashboard_list_id) end |
#get_logs_pipeline(pipeline_id) ⇒ Object
729 730 731 |
# File 'lib/dogapi/facade.rb', line 729 def get_logs_pipeline(pipeline_id) @logs_pipeline_svc.get_logs_pipeline(pipeline_id) end |
#get_logs_usage(start_hr, end_hr = nil) ⇒ Object
928 929 930 |
# File 'lib/dogapi/facade.rb', line 928 def get_logs_usage(start_hr, end_hr = nil) @usage_svc.get_logs_usage(start_hr, end_hr) end |
#get_metadata(metric) ⇒ Object
Get metadata information on an existing Datadog metric
758 759 760 |
# File 'lib/dogapi/facade.rb', line 758 def (metric) @metadata_svc.get(metric) end |
#get_monitor(monitor_id, options = {}) ⇒ Object
593 594 595 |
# File 'lib/dogapi/facade.rb', line 593 def get_monitor(monitor_id, = {}) @monitor_svc.get_monitor(monitor_id, ) end |
#get_points(query, from, to) ⇒ Object
Get a set of points by query between from and to
from
The seconds since the unix epoch [Time, Integer]
to
The seconds since the unix epoch [Time, Integer]
query
The query string [String]
172 173 174 |
# File 'lib/dogapi/facade.rb', line 172 def get_points(query, from, to) @metric_svc.get(query, from, to) end |
#get_screenboard(board_id) ⇒ Object
518 519 520 |
# File 'lib/dogapi/facade.rb', line 518 def get_screenboard(board_id) @screenboard_svc.get_screenboard(board_id) end |
#get_service_level_objective(slo_id) ⇒ Object
693 694 695 |
# File 'lib/dogapi/facade.rb', line 693 def get_service_level_objective(slo_id) @service_level_objective_svc.get_service_level_objective(slo_id) end |
#get_service_level_objective_history(slo_id, from_ts, to_ts) ⇒ Object
697 698 699 |
# File 'lib/dogapi/facade.rb', line 697 def get_service_level_objective_history(slo_id, from_ts, to_ts) @service_level_objective_svc.get_service_level_objective_history(slo_id, from_ts, to_ts) end |
#get_synthetics_devices ⇒ Object
573 574 575 |
# File 'lib/dogapi/facade.rb', line 573 def get_synthetics_devices @synthetics_svc.get_synthetics_devices() end |
#get_synthetics_locations ⇒ Object
577 578 579 |
# File 'lib/dogapi/facade.rb', line 577 def get_synthetics_locations @synthetics_svc.get_synthetics_locations() end |
#get_synthetics_result(test_id, result_id) ⇒ Object
569 570 571 |
# File 'lib/dogapi/facade.rb', line 569 def get_synthetics_result(test_id, result_id) @synthetics_svc.get_synthetics_result(test_id, result_id) end |
#get_synthetics_results(test_id) ⇒ Object
565 566 567 |
# File 'lib/dogapi/facade.rb', line 565 def get_synthetics_results(test_id) @synthetics_svc.get_synthetics_results(test_id) end |
#get_synthetics_test(test_id) ⇒ Object
561 562 563 |
# File 'lib/dogapi/facade.rb', line 561 def get_synthetics_test(test_id) @synthetics_svc.get_synthetics_test(test_id) end |
#get_synthetics_usage(start_hr, end_hr = nil) ⇒ Object
940 941 942 |
# File 'lib/dogapi/facade.rb', line 940 def get_synthetics_usage(start_hr, end_hr = nil) @usage_svc.get_synthetics_usage(start_hr, end_hr) end |
#get_traces_usage(start_hr, end_hr = nil) ⇒ Object
936 937 938 |
# File 'lib/dogapi/facade.rb', line 936 def get_traces_usage(start_hr, end_hr = nil) @usage_svc.get_traces_usage(start_hr, end_hr) end |
#get_user(handle) ⇒ Object
467 468 469 |
# File 'lib/dogapi/facade.rb', line 467 def get_user(handle) @user_svc.get_user(handle) end |
#graph_snapshot(metric_query, start_ts, end_ts, event_query = nil) ⇒ Object
Graph snapshot
480 481 482 |
# File 'lib/dogapi/facade.rb', line 480 def graph_snapshot(metric_query, start_ts, end_ts, event_query=nil) @snapshot_svc.snapshot(metric_query, start_ts, end_ts, event_query) end |
#host_tags(host_id, source = nil, by_source = false) ⇒ Object
Get all tags for the given host
host_id
can be the host’s numeric id or string name
289 290 291 |
# File 'lib/dogapi/facade.rb', line 289 def (host_id, source=nil, by_source=false) @tag_svc.get(host_id, source, by_source) end |
#host_totals ⇒ Object
787 788 789 |
# File 'lib/dogapi/facade.rb', line 787 def host_totals() @hosts_svc.totals() end |
#invite(emails, options = {}) ⇒ Object
User invite
455 456 457 |
# File 'lib/dogapi/facade.rb', line 455 def invite(emails, = {}) @user_svc.invite(emails, ) end |
#monitor(type, query, options = {}) ⇒ Object
MONITORS
585 586 587 |
# File 'lib/dogapi/facade.rb', line 585 def monitor(type, query, = {}) @monitor_svc.monitor(type, query, ) end |
#mute_alerts ⇒ Object
446 447 448 |
# File 'lib/dogapi/facade.rb', line 446 def mute_alerts() @alert_svc.mute_alerts() end |
#mute_host(hostname, options = {}) ⇒ Object
HOST MUTING
673 674 675 |
# File 'lib/dogapi/facade.rb', line 673 def mute_host(hostname, = {}) @monitor_svc.mute_host(hostname, ) end |
#mute_monitor(monitor_id, options = {}) ⇒ Object
621 622 623 |
# File 'lib/dogapi/facade.rb', line 621 def mute_monitor(monitor_id, = {}) @monitor_svc.mute_monitor(monitor_id, ) end |
#mute_monitors ⇒ Object
613 614 615 |
# File 'lib/dogapi/facade.rb', line 613 def mute_monitors() @monitor_svc.mute_monitors() end |
#resolve_monitors(monitor_groups = [], options = {}, version = nil) ⇒ Object
629 630 631 |
# File 'lib/dogapi/facade.rb', line 629 def resolve_monitors(monitor_groups = [], = {}, version = nil) @monitor_svc.resolve_monitors(monitor_groups, , version) end |
#revoke_embed(embed_id) ⇒ Object
503 504 505 |
# File 'lib/dogapi/facade.rb', line 503 def () @embed_svc.() end |
#revoke_screenboard(board_id) ⇒ Object
534 535 536 |
# File 'lib/dogapi/facade.rb', line 534 def revoke_screenboard(board_id) @screenboard_svc.revoke_screenboard(board_id) end |
#schedule_downtime(scope, options = {}) ⇒ Object
MONITOR DOWNTIME
645 646 647 |
# File 'lib/dogapi/facade.rb', line 645 def schedule_downtime(scope, = {}) @monitor_svc.schedule_downtime(scope, ) end |
#search(query) ⇒ Object
Run the given search query.
272 273 274 |
# File 'lib/dogapi/facade.rb', line 272 def search(query) @search_svc.search query end |
#search_hosts(options = {}) ⇒ Object
HOSTS
783 784 785 |
# File 'lib/dogapi/facade.rb', line 783 def search_hosts( = {}) @hosts_svc.search() end |
#search_monitor_groups(options = {}) ⇒ Object
637 638 639 |
# File 'lib/dogapi/facade.rb', line 637 def search_monitor_groups( = {}) @monitor_svc.search_monitor_groups() end |
#search_monitors(options = {}) ⇒ Object
633 634 635 |
# File 'lib/dogapi/facade.rb', line 633 def search_monitors( = {}) @monitor_svc.search_monitors() end |
#search_service_level_objective(slo_ids = nil, query = nil, offset = nil, limit = nil) ⇒ Object
701 702 703 |
# File 'lib/dogapi/facade.rb', line 701 def search_service_level_objective(slo_ids = nil, query = nil, offset = nil, limit = nil) @service_level_objective_svc.search_service_level_objective(slo_ids, query, offset, limit) end |
#service_check(check, host, status, options = {}) ⇒ Object
SERVICE CHECKS
749 750 751 |
# File 'lib/dogapi/facade.rb', line 749 def service_check(check, host, status, = {}) @service_check_svc.service_check(check, host, status, ) end |
#share_screenboard(board_id) ⇒ Object
530 531 532 |
# File 'lib/dogapi/facade.rb', line 530 def share_screenboard(board_id) @screenboard_svc.share_screenboard(board_id) end |
#start_event(event, options = {}) ⇒ Object
DEPRECATED: Recording events with a duration has been deprecated. The functionality will be removed in a later release.
237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/dogapi/facade.rb', line 237 def start_event(event, = {}) warn '[DEPRECATION] Dogapi::Client.start_event() is deprecated. Use `emit_event` instead.' defaults = { :source_type => nil } = defaults.merge() scope = override_scope @legacy_event_svc.start(@api_key, event, scope, [:source_type]) do yield end end |
#start_pause_synthetics_test(test_id, new_status) ⇒ Object
553 554 555 |
# File 'lib/dogapi/facade.rb', line 553 def start_pause_synthetics_test(test_id, new_status) @synthetics_svc.start_pause_synthetics_test(test_id, new_status) end |
#stream(start, stop, options = {}) ⇒ Object
Get an optionally filtered event stream
start
is a Time object for when to start the stream
stop
is a Time object for when to end the stream
Optional arguments:
:priority => "normal" or "low"
:sources => String, see https://github.com/DataDog/dogapi/wiki/Event for a current list of sources
:tags => Array of Strings
231 232 233 |
# File 'lib/dogapi/facade.rb', line 231 def stream(start, stop, = {}) @event_svc.stream(start, stop, ) end |
#unmute_alerts ⇒ Object
450 451 452 |
# File 'lib/dogapi/facade.rb', line 450 def unmute_alerts() @alert_svc.unmute_alerts() end |
#unmute_host(hostname) ⇒ Object
677 678 679 |
# File 'lib/dogapi/facade.rb', line 677 def unmute_host(hostname) @monitor_svc.unmute_host(hostname) end |
#unmute_monitor(monitor_id, options = {}) ⇒ Object
625 626 627 |
# File 'lib/dogapi/facade.rb', line 625 def unmute_monitor(monitor_id, = {}) @monitor_svc.unmute_monitor(monitor_id, ) end |
#unmute_monitors ⇒ Object
617 618 619 |
# File 'lib/dogapi/facade.rb', line 617 def unmute_monitors() @monitor_svc.unmute_monitors() end |
#update_alert(alert_id, query, options = {}) ⇒ Object
430 431 432 |
# File 'lib/dogapi/facade.rb', line 430 def update_alert(alert_id, query, = {}) @alert_svc.update_alert(alert_id, query, ) end |
#update_board(dashboard_id, title, widgets, layout_type, options = {}) ⇒ Object
Update a dashboard.
363 364 365 |
# File 'lib/dogapi/facade.rb', line 363 def update_board(dashboard_id, title, , layout_type, = {}) @dashboard_service.update_board(dashboard_id, title, , layout_type, ) end |
#update_comment(comment_id, options = {}) ⇒ Object
Post a comment
259 260 261 |
# File 'lib/dogapi/facade.rb', line 259 def update_comment(comment_id, = {}) @comment_svc.update_comment(comment_id, ) end |
#update_dashboard(dash_id, title, description, graphs, template_variables = nil, read_only = false) ⇒ Object
Update a dashboard.
334 335 336 |
# File 'lib/dogapi/facade.rb', line 334 def update_dashboard(dash_id, title, description, graphs, template_variables = nil, read_only = false) @dash_service.update_dashboard(dash_id, title, description, graphs, template_variables, read_only) end |
#update_dashboard_list(dashboard_list_id, name) ⇒ Object
390 391 392 |
# File 'lib/dogapi/facade.rb', line 390 def update_dashboard_list(dashboard_list_id, name) @dashboard_list_service.update(dashboard_list_id, name) end |
#update_downtime(downtime_id, options = {}) ⇒ Object
649 650 651 |
# File 'lib/dogapi/facade.rb', line 649 def update_downtime(downtime_id, = {}) @monitor_svc.update_downtime(downtime_id, ) end |
#update_integration(source_type_name, config) ⇒ Object
799 800 801 |
# File 'lib/dogapi/facade.rb', line 799 def update_integration(source_type_name, config) @integration_svc.update_integration(source_type_name, config) end |
#update_items_of_dashboard_list(dashboard_list_id, dashboards) ⇒ Object
410 411 412 |
# File 'lib/dogapi/facade.rb', line 410 def update_items_of_dashboard_list(dashboard_list_id, dashboards) @dashboard_list_service.update_items(dashboard_list_id, dashboards) end |
#update_logs_pipeline(pipeline_id, name, filter, options = {}) ⇒ Object
737 738 739 |
# File 'lib/dogapi/facade.rb', line 737 def update_logs_pipeline(pipeline_id, name, filter, = {}) @logs_pipeline_svc.update_logs_pipeline(pipeline_id, name, filter, ) end |
#update_metadata(metric, options = {}) ⇒ Object
Update metadata fields for an existing Datadog metric. If the metadata does not exist for the metric it is created by the update. Optional arguments:
:type => String, type of the metric (ex. "gauge", "rate", etc.)
see http://docs.datadoghq.com/metrictypes/
:description => String, description of the metric
:short_name => String, short name of the metric
:unit => String, unit type associated with the metric (ex. "byte", "operation")
see http://docs.datadoghq.com/units/ for full list
:per_unit => String, per unit type (ex. "second" as in "queries per second")
see http://docs.datadoghq.com/units/ for full
:statsd_interval => Integer, statsd flush interval for metric in seconds (if applicable)
775 776 777 |
# File 'lib/dogapi/facade.rb', line 775 def (metric, = {}) @metadata_svc.update(metric, ) end |
#update_monitor(monitor_id, query, options = {}) ⇒ Object
589 590 591 |
# File 'lib/dogapi/facade.rb', line 589 def update_monitor(monitor_id, query, = {}) @monitor_svc.update_monitor(monitor_id, query, ) end |
#update_screenboard(board_id, description) ⇒ Object
514 515 516 |
# File 'lib/dogapi/facade.rb', line 514 def update_screenboard(board_id, description) @screenboard_svc.update_screenboard(board_id, description) end |
#update_service_level_objective(slo_id, type, options = {}) ⇒ Object
689 690 691 |
# File 'lib/dogapi/facade.rb', line 689 def update_service_level_objective(slo_id, type, = {}) @service_level_objective_svc.update_service_level_objective(slo_id, type, ) end |
#update_synthetics_test(test_id, type, config, options = {}) ⇒ Object
545 546 547 |
# File 'lib/dogapi/facade.rb', line 545 def update_synthetics_test(test_id, type, config, = {}) @synthetics_svc.update_synthetics_test(test_id, type, config, ) end |
#update_tags(host_id, tags, source = nil) ⇒ Object
Replace the tags on the given host
host_id
can be the host’s numeric id or string name
tags
is and Array of Strings
307 308 309 |
# File 'lib/dogapi/facade.rb', line 307 def (host_id, , source=nil) @tag_svc.update(host_id, , source) end |
#update_user(handle, description = {}) ⇒ Object
471 472 473 |
# File 'lib/dogapi/facade.rb', line 471 def update_user(handle, description= {}) @user_svc.update_user(handle, description) end |
#validate_monitor(type, query, options = {}) ⇒ Object
609 610 611 |
# File 'lib/dogapi/facade.rb', line 609 def validate_monitor(type, query, = {}) @monitor_svc.validate_monitor(type, query, ) end |