class Facter::GCE::Metadata
@api private
Constants
- CONNECTION_ERRORS
- METADATA_URL
Public Class Methods
new(url = METADATA_URL)
click to toggle source
# File lib/facter/gce/metadata.rb, line 22 def initialize(url = METADATA_URL) @url = url end
Public Instance Methods
fetch()
click to toggle source
# File lib/facter/gce/metadata.rb, line 26 def fetch with_metadata_server do |body| # This will only be reached if the confine associated with this class # was true which means that JSON was required, but it's a bit # questionable that we're relying on JSON being loaded as a side # effect of that. hash = ::JSON.parse(body) transform_metadata!(hash) hash end end