Package gcp-metadata (5.0.1)

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

Parameter
NameDescription
optionsstring | Options
Returns
TypeDescription
Promise<T>
Type Parameter
TypeDescription
T

isAvailable()

export declare function isAvailable(): Promise

Determine if the metadata server is currently available.

Returns
TypeDescription
Promise<boolean>

project(options)

export declare function project

Obtain metadata for the current GCP Project.

Parameter
NameDescription
optionsstring | Options
Returns
TypeDescription
Promise<T>
Type Parameter
TypeDescription
T

requestTimeout()

export declare function requestTimeout(): number;

Obtain the timeout for requests to the metadata server.

Returns
TypeDescription
number

resetIsAvailableCache()

export declare function resetIsAvailableCache(): void;

reset the memoized isAvailable() lookup.

Returns
TypeDescription
void