Class: PagerDuty::ExternalServices::Service

Inherits:
Service show all
Includes:
Common::Client::Concerns::Monitoring
Defined in:
lib/pagerduty/external_services/service.rb

Constant Summary collapse

QUERY =

Equivalent to ‘External:’

CGI.escape(Settings.maintenance.service_query_prefix)
LIMIT =
100

Constants inherited from Service

Service::STATSD_KEY_PREFIX

Instance Method Summary collapse

Methods included from Common::Client::Concerns::Monitoring

#increment, #increment_failure, #increment_total, #with_monitoring

Methods inherited from Service

#headers, #perform

Methods inherited from Common::Client::Base

#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#get_servicesPagerDuty::ExternalServices::Response

Calls PagerDuty’s GET /services endpoint, and returns a pre-serialized representation of the raw response.

Returns:

See Also:



26
27
28
29
30
31
32
# File 'lib/pagerduty/external_services/service.rb', line 26

def get_services
  with_monitoring do
    raw_response = perform(:get, "/services?limit=#{LIMIT}&query=#{QUERY}")

    PagerDuty::ExternalServices::Response.from(raw_response)
  end
end