@google-cloud/compute
Advanced tools
Comparing version 2.4.2 to 2.4.3
@@ -7,2 +7,9 @@ # Changelog | ||
### [2.4.3](https://www.github.com/googleapis/nodejs-compute/compare/v2.4.2...v2.4.3) (2021-01-27) | ||
### Bug Fixes | ||
* handle parameters to image.create() ([#541](https://www.github.com/googleapis/nodejs-compute/issues/541)) ([3b3a7dd](https://www.github.com/googleapis/nodejs-compute/commit/3b3a7dd81790b788d5d53947e2948df55b702c93)) | ||
### [2.4.2](https://www.github.com/googleapis/nodejs-compute/compare/v2.4.1...v2.4.2) (2021-01-07) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/compute", | ||
"description": "Google Compute Engine Client Library for Node.js", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Google Inc.", |
@@ -41,33 +41,2 @@ /*! | ||
/** | ||
* Create an image. | ||
* | ||
* @method Image#create | ||
* @param {Disk} disk - See {@link Compute#createImage}. | ||
* @param {object} [options] - See {@link Compute#createImage}. | ||
* | ||
* @example | ||
* const Compute = require('@google-cloud/compute'); | ||
* const compute = new Compute(); | ||
* const zone = compute.zone('us-central1-a'); | ||
* const disk = zone.disk('disk1'); | ||
* const image = compute.image('image-name'); | ||
* | ||
* image.create(disk, function(err, image, operation, apiResponse) { | ||
* // `image` is an Image object. | ||
* | ||
* // `operation` is an Operation object that can be used to check the | ||
* // status of the request. | ||
* }); | ||
* | ||
* //- | ||
* // If the callback is omitted, we'll return a Promise. | ||
* //- | ||
* image.create(disk).then(function(data) { | ||
* const image = data[0]; | ||
* const operation = data[1]; | ||
* const apiResponse = data[2]; | ||
* }); | ||
*/ | ||
create: true, | ||
/** | ||
* Check if the image exists. | ||
@@ -158,3 +127,2 @@ * | ||
id: name, | ||
createMethod: compute.createImage.bind(compute), | ||
methods: methods, | ||
@@ -164,3 +132,38 @@ pollIntervalMs: compute.pollIntervalMs, | ||
} | ||
/** | ||
* Create an image. | ||
* | ||
* @method Image#create | ||
* @param {Disk} disk - See {@link Compute#createImage}. | ||
* @param {object} [options] - See {@link Compute#createImage}. | ||
* | ||
* @example | ||
* const Compute = require('@google-cloud/compute'); | ||
* const compute = new Compute(); | ||
* const zone = compute.zone('us-central1-a'); | ||
* const disk = zone.disk('disk1'); | ||
* const image = compute.image('image-name'); | ||
* | ||
* image.create(disk, function(err, image, operation, apiResponse) { | ||
* // `image` is an Image object. | ||
* | ||
* // `operation` is an Operation object that can be used to check the | ||
* // status of the request. | ||
* }); | ||
* | ||
* //- | ||
* // If the callback is omitted, we'll return a Promise. | ||
* //- | ||
* image.create(disk).then(function(data) { | ||
* const image = data[0]; | ||
* const operation = data[1]; | ||
* const apiResponse = data[2]; | ||
* }); | ||
*/ | ||
create(disk, options, callback) { | ||
this.parent.createImage(this.id, disk, options, callback); | ||
} | ||
/** | ||
* Delete the image. | ||
@@ -167,0 +170,0 @@ * |
Sorry, the diff of this file is too big to display
443959
11741