Reference documentation and code samples for the Google Cloud Platform environment queries class Google::Cloud::Env::ComputeMetadata::Response.
Basic HTTP response object, returned by #lookup_response.
This object duck-types the status
, body
, and headers
fields of
Faraday::Response
. It also includes the CLOCK_MONOTONIC time when
the data was retrieved.
Inherits
- Object
Methods
#body
def body() -> String
The HTTP response body
- (String)
#google_flavor?
def google_flavor?() -> boolean
Returns true if the metadata-flavor is correct for Google Cloud
- (boolean)
#headers
def headers() -> Hash{String=>String}
The HTTP response headers
- (Hash{String=>String})
#initialize
def initialize(status, body, headers) -> Response
Create a response object.
- status (Integer) — The HTTP status, normally 200
- body (String) — The HTTP body as a string
-
headers (Hash{String=>String}) — The HTTP response headers.
Normally, the
Metadata-Flavor
header must be set to the valueGoogle
.
- (Response) — a new instance of Response
#retrieval_monotonic_time
def retrieval_monotonic_time() -> Numeric
The CLOCK_MONOTONIC time at which this response was retrieved.
- (Numeric)
#status
def status() -> Integer
The HTTP status code
- (Integer)