Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

feat!: new generated version of compute API #537

Merged
merged 28 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7b9da47
feat!: DIREGAPIC Compute alpha
alexander-fenster Jan 5, 2021
fed3dee
feat: update protos, proper packaging
alexander-fenster Jan 12, 2021
e7e6260
tests: add GCE tests for diregapic (#549)
georgiyekkert Apr 29, 2021
7b941ee
feat: regenerated sources
alexander-fenster Apr 29, 2021
588ffcb
test: make system tests run
alexander-fenster Apr 29, 2021
cde1be4
fix: lint
alexander-fenster Apr 29, 2021
c53bd19
feat: regenerated with optional fields
alexander-fenster May 5, 2021
c0679ad
Merge branch 'master' into diregapic
alexander-fenster May 5, 2021
ce6bd95
regenerate lib with IPProtocl_
summer-ji-eng May 13, 2021
88307b4
update gax version
summer-ji-eng May 13, 2021
30cd27d
feat(samples): Add compute_* samples (#560)
FrodoTheTrue Jun 3, 2021
b36cf87
fix(readme): diregapic release (#568)
FrodoTheTrue Jun 8, 2021
203a38f
fix(samples): add text remarks and fixes
FrodoTheTrue Jun 9, 2021
a4e3884
fix: merge diregapic with master (#577)
summer-ji-eng Jun 16, 2021
6f254d1
Merge branch 'master' into diregapic
alexander-fenster Jun 16, 2021
3345d2e
🦉 Updates from OwlBot
gcf-owl-bot[bot] Jun 16, 2021
f1d2706
docs(samples): add default-value sample (#575)
FrodoTheTrue Jun 24, 2021
dfb3c3c
🦉 Updates from OwlBot
gcf-owl-bot[bot] Jun 24, 2021
fd54a00
chore: adds library_type to repo metadata (#581)
danoscarmike Jun 27, 2021
f7c8bef
split usage export sample (#587)
FrodoTheTrue Jun 30, 2021
df53b41
🦉 Updates from OwlBot
gcf-owl-bot[bot] Jun 30, 2021
84ba87f
test: additional tests for group manager (#578)
georgiyekkert Jul 23, 2021
44e9c14
feat: generate client library with supporting paging (#589)
summer-ji-eng Jul 30, 2021
1b4e72b
feat(samples): add pagination samples
FrodoTheTrue Aug 6, 2021
223e39b
🦉 Updates from OwlBot
gcf-owl-bot[bot] Aug 6, 2021
023c36e
feat!: merge Diregapic feature in master branch
summer-ji-eng Aug 11, 2021
371165b
🦉 Updates from OwlBot
gcf-owl-bot[bot] Aug 11, 2021
28a3b20
tests: add pagination tests (#595)
georgiyekkert Aug 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .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 .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 .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 .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 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) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could port a couple of the more interesting samples to the new API surface.

| 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 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