lib/fluent/plugin/common.rb
# EC2 Metadata server returns everything in one call. Store it after the
# first fetch to avoid making multiple calls.
EC2 Metadata server returns everything in one call. Store it after the
first fetch to avoid making multiple calls.
EC2 Metadata server returns everything in one call . Store it after the first fetch to avoid making multiple calls .
def ec2_metadata(platform)
      raise "Called ec2_metadata with platform=#{platform}" unless
        platform == Platform::EC2
      unless @ec2_metadata
        open('http://' + METADATA_SERVICE_ADDR +
             '/latest/dynamic/instance-identity/document', proxy: false) do |f|
          contents = f.read
          @ec2_metadata = JSON.parse(contents)
        end
      end
      @ec2_metadata
    end
def ec2_metadata ( platform ) raise "Called ec2_metadata with platform=#{platform}" unless platform == Platform :: EC2 unless @ec2_metadata open ( 'http://' + METADATA_SERVICE_ADDR + '/latest/dynamic/instance-identity/document' , proxy : false ) do | f | contents = f . read @ec2_metadata = JSON . parse ( contents ) end end @ec2_metadata end
EC2 Metadata server returns everything in one call.
EC2 Metadata server returns everything in one call .
# See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
platform
<not_specific>