Class GCEImages (5.0.0)

Package

gce-images

Constructors

(constructor)(config)

constructor(config?: GCEImagesConfig | AuthOptions);

Constructs a new instance of the GCEImages class

Parameter
NameDescription
config GCEImagesConfig | AuthOptions

Properties

OS_TO_URL

OS_TO_URL: {
        [index: string]: string;
    };

OS_URLS

OS_URLS: OSUrls;

Methods

_filterDeprecated(image)

_filterDeprecated(image: Image): boolean;
Parameter
NameDescription
image Image_2
Returns
TypeDescription
boolean

_getAllByOS(options)

_getAllByOS(options: GetOptions & {
        osNames: string[];
    }): Promise<Image[]>;
Parameter
NameDescription
options GetOptions & { osNames: string[]; }
Returns
TypeDescription
Promise<Image[]>

_parseArguments(options, callback)

_parseArguments<O, C>(options: any, callback: any): ParsedArguments<O, C>;
Parameters
NameDescription
options any
callback any
Returns
TypeDescription
ParsedArguments<O, C>
Type Parameters
NameDescription
O
C

_parseOsInput(os)

_parseOsInput(os: string): {
        name: string;
        version: string;
        url: string;
    };
Parameter
NameDescription
os string
Returns
TypeDescription
{ name: string; version: string; url: string; }

_sortNewestFirst(imageA, imageB)

_sortNewestFirst(imageA: Image, imageB: Image): 0 | 1 | -1;
Parameters
NameDescription
imageA Image_2
imageB Image_2
Returns
TypeDescription
0 | 1 | -1

getAll(cb)

getAll(cb: GetAllCallback): void;

Get all available images.

Parameter
NameDescription
cb GetAllCallback
Returns
TypeDescription
void

{Promise} if callback is omitted.

getAll(opts)

getAll(opts?: GetOptions | string): Promise<Image[] | ImagesMap>;
Parameter
NameDescription
opts GetOptions | string
Returns
TypeDescription
Promise<Image[] | ImagesMap>

getAll(opts, cb)

getAll(opts: GetOptions | string, cb: GetAllCallback): void;
Parameters
NameDescription
opts GetOptions | string
cb GetAllCallback
Returns
TypeDescription
void

getLatest(cb)

getLatest(cb: GetLatestCallback): void;

Get all available images, but only return the newest one.

Parameter
NameDescription
cb GetLatestCallback
Returns
TypeDescription
void

{Promise} if callback is omitted.

getLatest(opts)

getLatest(opts?: GetOptions | string): Promise<Image | ImageMap>;
Parameter
NameDescription
opts GetOptions | string
Returns
TypeDescription
Promise<Image | ImageMap>

getLatest(opts, cb)

getLatest(opts: GetOptions | string, cb: GetLatestCallback): void;
Parameters
NameDescription
opts GetOptions | string
cb GetLatestCallback
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>