lib/sensu/extensions/check-deps.rb
# Make an HTTP GET request to the Sensu API, using the URI
# path provided. Uses Sensu settings to determine how to
# connect to the API.
#
# @param path [String]
# @return [Object] http response object.
Make an HTTP GET request to the Sensu API, using the URI
path provided. Uses Sensu settings to determine how to
connect to the API.
Make an HTTP GET request to the Sensu API using the URI path provided . Uses Sensu settings to determine how to connect to the API .
def sensu_api_get_request(path)
        api = @settings[:api] || {}
        request = Net::HTTP::Get.new(path)
        if api[:user]
          request.basic_auth(api[:user], api[:password])
        end
        Net::HTTP.new(api[:host] || '127.0.0.1', api[:port] || 4567).start do |http|
          http.request(request)
        end
      end
def sensu_api_get_request ( path ) api = @settings [ :api ] || { } request = Net :: HTTP :: Get . new ( path ) if api [ :user ] request . basic_auth ( api [ :user ] , api [ :password ] ) end Net :: HTTP . new ( api [ :host ] || '127.0.0.1' , api [ :port ] || 4567 ) . start do | http | http . request ( request ) end end
Make an HTTP GET request to the Sensu API, using the URI
path provided.
Make an HTTP GET request to the Sensu API using the URI path provided .
http response object.
http response object .
Object
path
<not_specific>
<not_specific>
None