Skip to content

Commit

Permalink
feat!: new generated version of compute API (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Aug 11, 2021
1 parent 91767d6 commit ddc6369
Show file tree
Hide file tree
Showing 379 changed files with 877,018 additions and 24,985 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-compute/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
out/
Expand All @@ -9,6 +10,5 @@ system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
__pycache__
.vscode
package-lock.json
__pycache__
12 changes: 8 additions & 4 deletions packages/google-cloud-compute/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

Expand All @@ -31,18 +34,19 @@ module.exports = {
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'src'
'build/src',
'protos'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2019 Google, LLC.',
copyright: 'Copyright 2021 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/compute',
theme: 'lumen',
default: {
"outputSourceFiles": false
outputSourceFiles: false
}
},
markdown: {
Expand Down
5 changes: 2 additions & 3 deletions packages/google-cloud-compute/.mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
const config = {
"enable-source-maps": true,
"throw-deprecation": true,
// There seems to be a regression such that overrides are not being
// supported by mocha:
"timeout": 1200000
"timeout": 10000,
"recursive": true
}
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
delete config['throw-deprecation'];
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-compute/.repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"distribution_name": "@google-cloud/compute",
"api_id": "compute.googleapis.com",
"requires_billing": true,
"library_type": "GAPIC_AUTO",
"codeowner_team": "@googleapis/api-compute"
}
48 changes: 11 additions & 37 deletions packages/google-cloud-compute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)
* [Using the client library](#using-the-client-library)

* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
Expand All @@ -55,36 +55,6 @@ npm install @google-cloud/compute
```


### Using the client library

```javascript
// Imports the Google Cloud client library
const Compute = require('@google-cloud/compute');

// Creates a client
const compute = new Compute();

async function quickstart() {
// Create a new VM using the latest OS image of your choice.
const zone = compute.zone('us-central1-c');

// TODO(developer): choose a name for the VM
// const vmName = 'vm-name';

// Start the VM create task
const [vm, operation] = await zone.createVM(vmName, {os: 'ubuntu'});
console.log(vm);

// `operation` lets you check the status of long-running tasks.
await operation.promise();

// Complete!
console.log('Virtual machine created!');
}
quickstart();

```



## Samples
Expand All @@ -93,14 +63,18 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-compute/tre

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Create VM | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createVM.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/createVM.js,samples/README.md) |
| Delete VM | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteVM.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/deleteVM.js,samples/README.md) |
| List VMs | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listVMs.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/listVMs.js,samples/README.md) |
| Create Instance | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createInstance.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/createInstance.js,samples/README.md) |
| Delete Instance | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteInstance.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/deleteInstance.js,samples/README.md) |
| Disable Usage Export | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/disableUsageExport.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/disableUsageExport.js,samples/README.md) |
| Get Usage Export Bucket | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/getUsageExportBucket.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/getUsageExportBucket.js,samples/README.md) |
| List All Instances | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listAllInstances.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/listAllInstances.js,samples/README.md) |
| List Images | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImages.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/listImages.js,samples/README.md) |
| List Images By Page | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImagesByPage.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/listImagesByPage.js,samples/README.md) |
| List Instances | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listInstances.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/listInstances.js,samples/README.md) |
| Mailjet | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/mailjet.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/mailjet.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/quickstart.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/quickstart.js,samples/README.md) |
| Sendgrid | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/sendgrid.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/sendgrid.js,samples/README.md) |
| Startup Script | [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) |
| Vms | [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) |
| Set Usage Export Bucket | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/setUsageExportBucket.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/setUsageExportBucket.js,samples/README.md) |
| Wait For Operation | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/waitForOperation.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/waitForOperation.js,samples/README.md) |



Expand Down
144 changes: 112 additions & 32 deletions packages/google-cloud-compute/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "@google-cloud/compute",
"description": "Google Compute Engine Client Library for Node.js",
"version": "2.6.0",
"version": "3.0.0-alpha.3",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
"node": ">=10"
},
"repository": "googleapis/nodejs-compute",
"main": "./src/index.js",
"license": "Apache-2.0",
"author": "Google LLC",
"main": "build/src/index.js",
"files": [
"src"
"build/src",
"build/protos"
],
"keywords": [
"google apis client",
Expand All @@ -21,46 +24,123 @@
"google cloud platform",
"google cloud",
"cloud",
"google compute engine",
"compute engine"
"google compute",
"compute",
"accelerator types",
"addresses",
"autoscalers",
"backend buckets",
"backend services",
"disks",
"disk types",
"external vpn gateways",
"firewalls",
"forwarding rules",
"global addresses",
"global forwarding rules",
"global network endpoint groups",
"global operations",
"global organization operations",
"health checks",
"images",
"instance group managers",
"instance groups",
"instances",
"instance templates",
"interconnect attachments",
"interconnect locations",
"interconnects",
"license codes",
"licenses",
"machine types",
"network endpoint groups",
"networks",
"node groups",
"node templates",
"node types",
"packet mirrorings",
"projects",
"region autoscalers",
"region backend services",
"region commitments",
"region disks",
"region disk types",
"region health checks",
"region health check services",
"region instance group managers",
"region instance groups",
"region network endpoint groups",
"region notification endpoints",
"region operations",
"regions",
"region ssl certificates",
"region target http proxies",
"region target https proxies",
"region url maps",
"reservations",
"resource policies",
"routers",
"routes",
"security policies",
"snapshots",
"ssl certificates",
"ssl policies",
"subnetworks",
"target grpc proxies",
"target http proxies",
"target https proxies",
"target instances",
"target pools",
"target ssl proxies",
"target tcp proxies",
"target vpn gateways",
"url maps",
"vpn gateways",
"vpn tunnels",
"zone operations",
"zones"
],
"scripts": {
"docs": "jsdoc -c .jsdoc.js",
"test": "c8 node build/test/run.js",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"system-test": "mocha build/system-test system-test/*.js",
"lint": "gts check",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"system-test": "mocha system-test/*.js --timeout 1200000",
"test": "c8 mocha",
"fix": "gts fix",
"docs": "jsdoc -c .jsdoc.js",
"docs-test": "linkinator docs",
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/",
"compile-protos": "compileProtos src",
"predocs-test": "npm run docs",
"prepare": "npm run compile-protos && npm run compile",
"prelint": "cd samples; npm link ../; npm install",
"clean": "gts clean",
"precompile": "gts clean"
},
"dependencies": {
"@google-cloud/common": "^3.0.0",
"@google-cloud/paginator": "^3.0.0",
"@google-cloud/projectify": "^2.0.0",
"@google-cloud/promisify": "^2.0.0",
"arrify": "^2.0.0",
"async": "^3.0.0",
"extend": "^3.0.2",
"gce-images": "^3.0.0",
"is": "^3.2.1",
"string-format-obj": "^1.1.1"
"google-gax": "^2.13.0"
},
"devDependencies": {
"c8": "^7.0.0",
"codecov": "^3.0.2",
"concat-stream": "^2.0.0",
"gts": "^2.0.2",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^8.0.0",
"proxyquire": "^2.0.1",
"typescript": "^3.8.3",
"uuid": "^8.0.0"
"@types/mocha": "^8.2.0",
"@types/node": "^14.14.13",
"@types/sinon": "^9.0.9",
"c8": "^7.3.5",
"chai": "^4.3.4",
"gts": "^3.1.0",
"jsdoc": "^3.6.6",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.6",
"linkinator": "^2.8.0",
"mocha": "^8.2.1",
"null-loader": "^4.0.1",
"pack-n-play": "^1.0.0-2",
"sinon": "^9.2.2",
"ts-loader": "^8.0.12",
"typescript": "^4.1.3",
"uuid": "^8.0.0",
"webpack": "^5.10.1",
"webpack-cli": "^4.2.0"
},
"engines": {
"node": ">=10"
}
}
Loading

0 comments on commit ddc6369

Please sign in to comment.