Module: FluentECS::Resource::ClassMethods

Defined in:
lib/fluent_ecs/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resource_endpointObject

Returns the value of attribute resource_endpoint.



12
13
14
# File 'lib/fluent_ecs/resource.rb', line 12

def resource_endpoint
  @resource_endpoint
end

Instance Method Details

#getObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fluent_ecs/resource.rb', line 14

def get
  response = super(resource_endpoint)
  if response.success?
    response.parsed_response
  else
    err = "GET #{base_uri}#{resource_endpoint}" \
          " failed with code: #{response.code}"
    raise RequestError, err
  end
rescue Errno::ECONNREFUSED, HTTParty::Error, Timeout::Error => e
  raise IntrospectError, e.message
end