daedalus-gc-compute
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "daedalus-gc-compute", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Daedalus Solutions", | ||
@@ -5,0 +5,0 @@ "description": "Google Compute Engine Client Library for Node.js", |
@@ -517,2 +517,4 @@ /*! | ||
* [this list of accepted OS names](https://github.com/stephenplusplus/gce-images#accepted-os-names). | ||
* @param {string=} config.diskSize - Specify the disk size in Gb. Default: `50` | ||
* @param {string=} config.sshKey - Specify the ssh key for remote connection to the instance | ||
* @param {string[]=} config.tags - An array of tags. | ||
@@ -606,5 +608,20 @@ * @param {function} callback - The callback function. | ||
} | ||
] | ||
], | ||
scheduling: { | ||
preemptible: false, | ||
onHostMaintenance: "MIGRATE", | ||
automaticRestart: true | ||
}, | ||
}, config); | ||
if(body.sshKey){ | ||
body.metadata = { | ||
items: [{ | ||
key: "ssh-keys", | ||
value: body.sshKey | ||
}] | ||
}; | ||
delete body.sshKey; | ||
} | ||
if (body.machineType.indexOf('/') === -1) { | ||
@@ -678,3 +695,7 @@ // The specified machineType is only a partial name, e.g. 'n1-standard-1'. | ||
} | ||
let diskSize = "50"; | ||
if(body.diskSize){ | ||
diskSize = body.diskSize; | ||
delete body.diskSize; | ||
} | ||
delete body.os; | ||
@@ -686,6 +707,8 @@ body.disks = body.disks || []; | ||
initializeParams: { | ||
sourceImage: image.selfLink | ||
sourceImage: image.selfLink, | ||
diskSizeGb: diskSize | ||
} | ||
}); | ||
self.createVM(name, body, callback); | ||
@@ -692,0 +715,0 @@ }); |
314834
9505