New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/compute

Package Overview
Dependencies
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/compute - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

src/instance-group-manager.js

38

CHANGELOG.md

@@ -7,2 +7,40 @@ # Changelog

## v0.12.0
03-13-2019 14:47 PDT
### New Features
- feat: Add getManagedInstances and deleteInstances to InstanceGroupManger API ([#265](https://github.com/googleapis/nodejs-compute/pull/265))
- feat: add basic support for InstanceGroupManager ([#263](https://github.com/googleapis/nodejs-compute/pull/263))
### Bug Fixes
- fix: snapshot.delete() no longer throws ([#251](https://github.com/googleapis/nodejs-compute/pull/251))
### Dependencies
- fix(deps): update dependency @google-cloud/paginator to ^0.2.0 ([#274](https://github.com/googleapis/nodejs-compute/pull/274))
- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#267](https://github.com/googleapis/nodejs-compute/pull/267))
- fix(deps): update dependency @google-cloud/common to ^0.31.0 ([#258](https://github.com/googleapis/nodejs-compute/pull/258))
### Documentation
- docs: update links in contrib guide ([#268](https://github.com/googleapis/nodejs-compute/pull/268))
- docs: update contributing path in README ([#261](https://github.com/googleapis/nodejs-compute/pull/261))
- docs: move CONTRIBUTING.md to root ([#260](https://github.com/googleapis/nodejs-compute/pull/260))
- docs: add lint/fix example to contributing guide ([#257](https://github.com/googleapis/nodejs-compute/pull/257))
- docs: use the latest sendgrid npm module ([#246](https://github.com/googleapis/nodejs-compute/pull/246))
- docs(samples): modernize the samples ([#240](https://github.com/googleapis/nodejs-compute/pull/240))
### Internal / Testing Changes
- build: Add docuploader credentials to node publish jobs ([#272](https://github.com/googleapis/nodejs-compute/pull/272))
- build: use node10 to run samples-test, system-test etc ([#271](https://github.com/googleapis/nodejs-compute/pull/271))
- build: update release configuration
- chore(deps): update dependency mocha to v6 ([#269](https://github.com/googleapis/nodejs-compute/pull/269))
- build: use linkinator for docs test ([#266](https://github.com/googleapis/nodejs-compute/pull/266))
- build: create docs test npm scripts ([#264](https://github.com/googleapis/nodejs-compute/pull/264))
- build: test using @grpc/grpc-js in CI ([#262](https://github.com/googleapis/nodejs-compute/pull/262))
- chore(deps): update dependency eslint-config-prettier to v4 ([#255](https://github.com/googleapis/nodejs-compute/pull/255))
- build: ignore googleapis.com in doc link check ([#252](https://github.com/googleapis/nodejs-compute/pull/252))
- build: check broken links in generated docs ([#248](https://github.com/googleapis/nodejs-compute/pull/248))
- fix(deps): update dependency nodemailer to v5 ([#247](https://github.com/googleapis/nodejs-compute/pull/247))
- refactor: use Object.assign where possible ([#245](https://github.com/googleapis/nodejs-compute/pull/245))
## v0.11.0

@@ -9,0 +47,0 @@

23

package.json
{
"name": "@google-cloud/compute",
"description": "Google Compute Engine Client Library for Node.js",
"version": "0.11.0",
"version": "0.12.0",
"license": "Apache-2.0",

@@ -31,12 +31,14 @@ "author": "Google Inc.",

"lint": "eslint '**/*.js'",
"samples-test": "cd samples/ && npm link ../ && cd startup-script && npm link ../../ && cd ../ && npm test && cd ../",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"system-test": "mocha system-test/*.js --timeout 600000",
"test": "nyc mocha",
"fix": "eslint --fix '**/*.js'"
"fix": "eslint --fix '**/*.js'",
"docs-test": "linkinator docs -r --skip www.googleapis.com",
"predocs-test": "npm run docs"
},
"dependencies": {
"@google-cloud/common": "^0.29.1",
"@google-cloud/paginator": "^0.1.1",
"@google-cloud/common": "^0.31.0",
"@google-cloud/paginator": "^0.2.0",
"@google-cloud/projectify": "^0.3.0",
"@google-cloud/promisify": "^0.3.1",
"@google-cloud/promisify": "^0.4.0",
"arrify": "^1.0.1",

@@ -56,9 +58,9 @@ "async": "^2.6.1",

"eslint": "^5.0.0",
"eslint-config-prettier": "^3.0.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.0",
"ink-docstrap": "^1.3.2",
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.5.5",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"nyc": "^13.0.0",

@@ -68,4 +70,5 @@ "power-assert": "^1.5.0",

"proxyquire": "^2.0.1",
"uuid": "^3.2.1"
"uuid": "^3.2.1",
"linkinator": "^1.1.2"
}
}

@@ -100,3 +100,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

| --------------------------- | --------------------------------- | ------ |
| Create Virtual Machine with Apache and Custom Homepage | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/startup-script/index.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/startup-script/index.js,samples/README.md) |
| Create Virtual Machine with Apache and Custom Homepage | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/startupScript.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/startupScript.js,samples/README.md) |
| List Virtual Machines | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/vms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/vms.js,samples/README.md) |

@@ -121,3 +121,3 @@

Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-compute/blob/master/.github/CONTRIBUTING.md).
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-compute/blob/master/CONTRIBUTING.md).

@@ -124,0 +124,0 @@ ## License

@@ -20,3 +20,2 @@ /*!

const common = require('@google-cloud/common');
const extend = require('extend');
const format = require('string-format-obj');

@@ -250,3 +249,3 @@ const is = require('is');

uri: '/createSnapshot',
json: extend({}, options, {
json: Object.assign({}, options, {
name: name,

@@ -253,0 +252,0 @@ }),

@@ -123,3 +123,3 @@ /*!

*
* @see [Images: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/image/get}
* @see [Images: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/images/get}
* @see [Image Resource]{@link https://cloud.google.com/compute/docs/reference/v1/images}

@@ -126,0 +126,0 @@ *

@@ -21,3 +21,2 @@ /*!

const common = require('@google-cloud/common');
const extend = require('extend');
const is = require('is');

@@ -33,3 +32,3 @@ const {promisifyAll} = require('@google-cloud/promisify');

* @see [Creating Groups of Instances]{@link https://cloud.google.com/compute/docs/instance-groups}
* @see [Unmanaged Instance Groups]{@link https://cloud.google.com/compute/docs/instance-groups/unmanaged-groups}
* @see [Unmanaged Instance Groups]{@link https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-unmanaged-instances}
*

@@ -301,3 +300,3 @@ * @class

*
* @see [InstaceGroups: listInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/listInstances}
* @see [InstanceGroups: listInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/listInstances}
*

@@ -384,3 +383,3 @@ * @param {object=} options - Instance search options.

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -387,0 +386,0 @@ });

@@ -20,3 +20,2 @@ /*!

const common = require('@google-cloud/common');
const extend = require('extend');
const format = require('string-format-obj');

@@ -249,3 +248,3 @@ const is = require('is');

createFirewall(name, config, callback) {
config = extend({}, config, {
config = Object.assign({}, config, {
network: this.formattedName,

@@ -309,3 +308,3 @@ });

createSubnetwork(name, config, callback) {
config = extend({}, config, {
config = Object.assign({}, config, {
network: this.formattedName,

@@ -382,3 +381,3 @@ });

}
options = extend({}, options, {
options = Object.assign({}, options, {
filter: 'network eq .*' + this.formattedName,

@@ -420,3 +419,3 @@ });

getSubnetworksStream(options) {
options = extend({}, options, {
options = Object.assign({}, options, {
filter: 'network eq .*' + this.formattedName,

@@ -543,3 +542,3 @@ });

}
options = extend({}, options, {
options = Object.assign({}, options, {
filter: 'network eq .*' + this.formattedName,

@@ -581,3 +580,3 @@ });

getFirewallsStream(options) {
options = extend({}, options, {
options = Object.assign({}, options, {
filter: 'network eq .*' + this.formattedName,

@@ -584,0 +583,0 @@ });

@@ -20,3 +20,2 @@ /*!

const common = require('@google-cloud/common');
const extend = require('extend');
const is = require('is');

@@ -222,3 +221,3 @@ const {promisifyAll} = require('@google-cloud/promisify');

uri: '/addresses',
json: extend({}, options, {
json: Object.assign({}, options, {
name: name,

@@ -293,3 +292,3 @@ }),

const self = this;
const body = extend({}, config, {
const body = Object.assign({}, config, {
name: name,

@@ -462,3 +461,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -552,3 +551,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -641,3 +640,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -731,3 +730,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -734,0 +733,0 @@ });

@@ -179,3 +179,3 @@ /*!

*/
this.compute = isDisk ? scope.compute : scope;
this.compute = isDisk ? scope.zone.compute : scope;
/**

@@ -182,0 +182,0 @@ * @name Snapshot#name

@@ -138,4 +138,4 @@ /*!

*
* @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetwork}
* @see [Subnetwork: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetwork/get}
* @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks}
* @see [Subnetwork: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks/get}
*

@@ -142,0 +142,0 @@ * @method Subnetwork#getMetadata

@@ -21,3 +21,2 @@ /*!

const createErrorClass = require('create-error-class');
const extend = require('extend');
const format = require('string-format-obj');

@@ -315,3 +314,3 @@ const is = require('is');

}
const body = extend(
const body = Object.assign(
{

@@ -318,0 +317,0 @@ // Default the deviceName to the name of the disk, like the Console does.

@@ -33,2 +33,3 @@ /*!

const InstanceGroup = require('./instance-group.js');
const InstanceGroupManager = require('./instance-group-manager.js');
const MachineType = require('./machine-type.js');

@@ -366,3 +367,3 @@ const Operation = require('./operation.js');

const query = {};
const body = extend({}, config, {
const body = Object.assign({}, config, {
name: name,

@@ -453,3 +454,3 @@ });

}
const body = extend({}, options, {
const body = Object.assign({}, options, {
name: name,

@@ -587,3 +588,3 @@ });

const self = this;
const body = extend(
const body = Object.assign(
{

@@ -780,3 +781,3 @@ name: name,

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -869,3 +870,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -960,3 +961,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -975,2 +976,96 @@ });

/**
* Get a list of instance group managers for this zone.
*
* @see [InstanceGroupManagers Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers}
* @see [InstanceGroupManagers: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/list}
*
* @param {object=} options - Instance group manager search options.
* @param {boolean} options.autoPaginate - Have pagination handled
* automatically. Default: true.
* @param {string} options.filter - Search filter in the format of
* `{name} {comparison} {filterString}`.
* - **`name`**: the name of the field to compare
* - **`comparison`**: the comparison operator, `eq` (equal) or `ne`
* (not equal)
* - **`filterString`**: the string to filter to. For string fields, this
* can be a regular expression.
* @param {number} options.maxApiCalls - Maximum number of API calls to make.
* @param {number} options.maxResults - Maximum number of instance groups to
* return.
* @param {string} options.pageToken - A previously-returned page token
* representing part of the larger set of results to view.
* @param {function} callback - The callback function.
* @param {?error} callback.err - An error returned while making this request.
* @param {InstanceGroupManager[]} callback.instanceGroupManagers -
* InstanceGroupManager objects from this zone.
* @param {object} callback.apiResponse - The full API response.
*
* @example
* const Compute = require('@google-cloud/compute');
* const compute = new Compute();
* const zone = compute.zone('us-central1-a');
*
* zone.getInstanceGroupManagers(function(err, instanceGroupManagers) {
* // `instanceGroupManagers` is an array of `InstanceGroupManager` objects.
* });
*
* //-
* // To control how many API requests are made and page through the results
* // manually, set `autoPaginate` to `false`.
* //-
* function callback(err, instanceGroupManagers, nextQuery, apiResponse) {
* if (nextQuery) {
* // More results exist.
* zone.getInstanceGroupManagers(nextQuery, callback);
* }
* }
*
* zone.getInstanceGroupManagers({
* autoPaginate: false
* }, callback);
*
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* zone.getInstanceGroupManagers().then(function(data) {
* const instanceGroupManagerss = data[0];
* });
*/
getInstanceGroupManagers(options, callback) {
const self = this;
if (is.fn(options)) {
callback = options;
options = {};
}
options = options || {};
this.request(
{
uri: '/instanceGroupManagers',
qs: options,
},
function(err, resp) {
if (err) {
callback(err, null, null, resp);
return;
}
let nextQuery = null;
if (resp.nextPageToken) {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,
});
}
const instanceGroupManagers = (resp.items || []).map(function(
instanceGroupManager
) {
const instanceGroupManagerInstance = self.instanceGroupManager(
instanceGroupManager.name
);
instanceGroupManagerInstance.metadata = instanceGroupManager;
return instanceGroupManagerInstance;
});
callback(null, instanceGroupManagers, nextQuery, resp);
}
);
}
/**
* Get a list of machine types for this zone.

@@ -1032,3 +1127,3 @@ *

}
options = extend({}, options, {
options = Object.assign({}, options, {
filter: 'zone eq .*' + this.name,

@@ -1114,3 +1209,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -1201,3 +1296,3 @@ });

if (resp.nextPageToken) {
nextQuery = extend({}, options, {
nextQuery = Object.assign({}, options, {
pageToken: resp.nextPageToken,

@@ -1234,2 +1329,20 @@ });

/**
* Get a reference to a Google Compute Engine instance group manager.
*
* @see [InstanceGroupManagers Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers}
*
* @param {string} name - Name of the existing instance group manager.
* @returns {InstanceGroupManager}
*
* @example
* const Compute = require('@google-cloud/compute');
* const compute = new Compute();
* const zone = compute.zone('us-central1-a');
*
* const instanceGroupManager = zone.instanceGroupManager('my-instance-group-manager');
*/
instanceGroupManager(name) {
return new InstanceGroupManager(this, name);
}
/**
* Get a reference to a Google Compute Engine machine type.

@@ -1549,2 +1662,3 @@ *

'getInstanceGroups',
'getInstanceGroupManagers',
'getMachineTypes',

@@ -1565,2 +1679,3 @@ 'getOperations',

'instanceGroup',
'instanceGroupManager',
'machineType',

@@ -1567,0 +1682,0 @@ 'operation',

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc