Interfaces
Options
Variables
BASE_PATH
BASE_PATH
=
"/computeMetadata/v1"
HEADER_NAME
HEADER_NAME
=
"Metadata-Flavor"
HEADER_VALUE
HEADER_VALUE
=
"Google"
HEADERS
HEADERS
:
Readonly
< {
"metadata-flavor"
:=
""
"google"
;
=
""
}
=
""
>
HOST_ADDRESS
HOST_ADDRESS
=
"http://169.254.169.254"
SECONDARY_HOST_ADDRESS
SECONDARY_HOST_ADDRESS
=
"http://metadata.google.internal."
Functions
instance(options)
export
declare
function
instance
Obtain metadata for the current GCE instance
Returns
Type
Description
Promise
<T>
Type Parameter
Type
Description
T
isAvailable()
export
declare
function
isAvailable
()
:
Promise
Determine if the metadata server is currently available.
Returns
Type
Description
Promise
<boolean>
project(options)
export
declare
function
project
Obtain metadata for the current GCP Project.
Returns
Type
Description
Promise
<T>
Type Parameter
Type
Description
T
requestTimeout()
export
declare
function
requestTimeout
()
:
number
;
Obtain the timeout for requests to the metadata server.
Returns
Type
Description
number
resetIsAvailableCache()
export
declare
function
resetIsAvailableCache
()
:
void
;
reset the memoized isAvailable() lookup.
Returns
Type
Description
void