@gluecode-it/google-cloud-vm-handler
v1.1.8
Published
A wrapper to start and stop google cloud vms with integrated a event handler
Downloads
3
Readme
A wrapper to start and stop google cloud vms with integrated a event handler.
Contents
Installation
$ npm install @gluecode-it/google-cloud-vm-handler @google-cloud/compute
Quick Start
const Compute = require("@google-cloud/compute");
import { GoogleVM, VmHandler } from "@gluecode-it/google-cloud-vm-handler";
const compute = new Compute();
const zone = compute.zone("europe-west-1");
const vm = zone.vm("instance-1") as GoogleVM;
const vmHandler = new VmHandler(vm);
await vmHandler.start();
vmHandler.onStarted(() => {
await vmHandler.stop();
});