I'm attempting to automate our deployment process for compute engine, but I don't see any way to create images with this module. Is it possible?
Looking at the compute engine docs, it seems like it should be.
We currently don't support the Image API, however as a temporary workaround I think you can use Compute#request to make the request.
var compute = gcloud.compute();
compute.request({
method: 'POST',
uri: '/global/images',
json: {
name: 'image-name',
rawDisk: {
source: 'storage-path'
}
}
}, function(err, resp) {
if (err) {
// request error
}
var operation = compute.operation(resp.name);
operation.on('complete', function() {
// image is created
});
operation.on('error', function() {
// error occured
});
});
Thanks for writing up that code @callmehiphop. That should indeed work.
We have an issue tracking all of the missing APIs from GCE that we still have to implement: #1073. Help is very welcome :)
@callmehiphop thanks for this!
Most helpful comment
We currently don't support the Image API, however as a temporary workaround I think you can use
Compute#requestto make the request.