class Google::Cloud::Env::ComputeMetadata
def internal_lookup path, query, open_timeout, request_timeout
- Private: -
def internal_lookup path, query, open_timeout, request_timeout full_path = path ? "#{PATH_BASE}/#{path}" : "" http_response = connection.get full_path do |req| req.params = query if query req.headers = FLAVOR_HEADER req.options.timeout = request_timeout if request_timeout req.options.open_timeout = open_timeout if open_timeout end response = Response.new http_response.status, http_response.body, http_response.headers if path.nil? post_update_existence(response.status == 200 && response.google_flavor?, response.retrieval_monotonic_time) elsif response.google_flavor? post_update_existence true, response.retrieval_monotonic_time end lifetime = determine_data_lifetime path, response.body.strip LazyValue.expiring_value lifetime, response rescue *TRANSIENT_EXCEPTIONS post_update_existence false raise MetadataServerNotResponding end