GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — compute: vm: add resize() by stephenplusplus · Pull Request #1469 · googleapis/google-cloud-node

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Aug 5, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This takes over from #1448, adding a resize method on the VM object.

To Dos

  • Start the VM again after setting the new machine type
  • Rename method
  • Explain the stopping and starting in the docs
vm.resize('n1-standard-1', function(err, apiResponse) {
  if (!err) {
    // VM resized successfully!
  }
});

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2016
@stephenplusplus stephenplusplus mentioned this pull request Aug 5, 2016
implement VM.prototype.setMachineType #1448
Closed
@stephenplusplus stephenplusplus added the api: compute Issues related to the Compute Engine API. label Aug 5, 2016
@stephenplusplus stephenplusplus assigned callmehiphop Aug 7, 2016
callmehiphop
callmehiphop reviewed Aug 8, 2016
View reviewed changes
Comment thread packages/compute/src/vm.js Outdated
}

callback = callback || common.util.noop;

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus added the don't merge label Aug 8, 2016
@stephenplusplus
stephenplusplus force-pushed the spp--1448 branch 4 times, most recently from 126105e to 00691a9 Compare August 16, 2016 19:23
@stephenplusplus

stephenplusplus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

@callmehiphop could you take a look at the updates and see if this is the best case for the user? It should definitely be the most "automatic", I'm just not sure if it could create surprises. I've played with an options object to control the behavior, but it felt too verbose and confusing. LMK if you think this new behavior is okay or if you have any ideas on how to improve.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

callmehiphop
callmehiphop reviewed Aug 16, 2016
View reviewed changes
Comment thread packages/compute/src/vm.js Outdated
});
};

VM.prototype.execAfterOperation_ = function(callback) {

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

I'm a bit hesitant making all these guesses, only because to the user it might feel a bit magical. What if instead of just automatically doing all this, we added an option like restart? That way it was a bit less magical and if for some reason the user wanted to programmatically restart the VM on their own, they could.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

That is an option, but makes the API have different response args to the user's callback. If we just do the API call, which assumes the VM is not running, we would return an operation. If we do a restart, what do we return? I thought it would be weird to return the vm.start() operation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

Perhaps setMachineType shouldn't restart the VM then? We can have it simply set the machine type and nothing else. Then add a convenience method that sits on top of it and will restart the VM?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

What would that look like? Having two methods for doing the same thing isn't very "us"-- in this case, I think we just have to pick one or the other. A machine type can only be changed if the machine isn't running, so that means if we just expose the "raw" way (just make the API call), the user will always have to call vm.stop() first. And since we're usually "smart" for the user, that's why I keep ending up at doing it for them.

Maybe we should wait for the next meeting and bring it up then.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus unassigned callmehiphop Aug 19, 2016
@stephenplusplus

stephenplusplus commented Aug 23, 2016

Copy link
Copy Markdown
Contributor Author

Feedback was to change to a name that implies magic is happening, i.e. vm.resize(). Whereas setMachineType doesn't imply "we're restarting your VM".

callmehiphop reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stephenplusplus added 3 commits August 29, 2016 08:08
@stephenplusplus
compute: vm: add setMachineType
c4996d4
@stephenplusplus
restart if necessary
bca19d1
@stephenplusplus
rename to resize
5152158
@stephenplusplus
stephenplusplus force-pushed the spp--1448 branch from 00691a9 to 5152158 Compare August 29, 2016 14:25
@stephenplusplus stephenplusplus changed the title compute: vm: add setMachineType compute: vm: add resize() Aug 29, 2016
@stephenplusplus stephenplusplus removed the don't merge label Aug 29, 2016
@stephenplusplus stephenplusplus assigned callmehiphop Aug 29, 2016
@stephenplusplus

stephenplusplus commented Aug 29, 2016

Copy link
Copy Markdown
Contributor Author

@callmehiphop PTAL! I renamed the method to resize, put a "private" execAfterOperation_ method on the top level Compute instance*, wrote some tests, and added docs.

*the method is not static because to use it from "VM", we introduce a cross dependency from index.js and vm.js. This didn't make the require call throw, but did result in an undefined Compute.execAfterOperation_ method. It was easier to put it on the Compute instance.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Aug 29, 2016

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 5152158 on stephenplusplus:spp--1448 into 069d827 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

callmehiphop
callmehiphop reviewed Aug 29, 2016
View reviewed changes
Comment thread packages/compute/src/vm.js
* [Predefined machine types]{@link https://cloud.google.com/compute/docs/machine-types#predefined_machine_types}.
*
* In order to change the machine type, the VM must not be running. This method
* will automatically stop the VM if it is running before changing the machine

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
add start option
457e882
@callmehiphop
callmehiphop merged commit 737b916 into googleapis:master Aug 29, 2016
@coveralls

coveralls commented Aug 29, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 457e882 on stephenplusplus:spp--1448 into 069d827 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@snyk-bot snyk-bot mentioned this pull request Sep 15, 2021
[Snyk] Fix for 1 vulnerabilities mikolajroszak/google-cloud-node#1
Open
sofisl pushed a commit that referenced this pull request Nov 17, 2022
@stephenplusplus @callmehiphop
compute: vm: add resize() (#1469)
539ac4b
* compute: vm: add setMachineType

* restart if necessary

* rename to resize

* add `start` option
@sofisl sofisl mentioned this pull request Nov 17, 2022
migrate code from googleapis/nodejs-compute #3666
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Feb 3, 2026
@renovate-bot @leahecole
fix(deps): update dependency big.js to v7 (#1469)
a4408e6
Co-authored-by: Leah E. Cole <[email protected]>
sofisl pushed a commit that referenced this pull request Feb 26, 2026
Benjamin E. Coe
fix(build): set default branch to main (#1469)
f5b8618
sofisl pushed a commit that referenced this pull request Feb 26, 2026
@release-please
chore: release 5.16.0 (#1521)
9c93ef4
🤖 I have created a release \*beep\* \*boop\*
---
## [5.16.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.2...v5.16.0) (2021-12-09)


### Features

* add eslintignore for sameple generated code ([#1302](https://www.github.com/googleapis/nodejs-spanner/issues/1302)) ([#1520](https://www.github.com/googleapis/nodejs-spanner/issues/1520)) ([f835b72](https://www.github.com/googleapis/nodejs-spanner/commit/f835b721210d01b11d7f5751ee06f13518e7fe0f))


### Bug Fixes

* **build:** set default branch to main ([#1469](https://www.github.com/googleapis/nodejs-spanner/issues/1469)) ([152985a](https://www.github.com/googleapis/nodejs-spanner/commit/152985a1f783534e6b3e3ce332a1333dec67269d))
* **cloud-rad:** move comments for TSDoc ([#1509](https://www.github.com/googleapis/nodejs-spanner/issues/1509)) ([1c49922](https://www.github.com/googleapis/nodejs-spanner/commit/1c49922c75bd56dbd0456318bee8a336eb088156))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
GautamSharda pushed a commit that referenced this pull request Mar 5, 2026
@gcf-owl-bot
build: update Node.js generator to compile protos (#1469)
47079bd
* build: update Node.js generator to compile protos

PiperOrigin-RevId: 582493526

Source-Link: googleapis/googleapis@7c4e4b5

Source-Link: googleapis/googleapis-gen@368cfb6
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzY4Y2ZiNjUxMDE2ZDZhOTNjYTZlNDg4Y2JjMzRlMmQxZDlkMjEyYyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
@renovate-bot
fix(deps): update dependency google-gax to v2.29.4 (#1469)
baa4c2c
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [google-gax](https://togithub.com/googleapis/gax-nodejs) | [`2.29.0` -> `2.29.4`](https://renovatebot.com/diffs/npm/google-gax/2.29.0/2.29.4) | [![age](https://badges.renovateapi.com/packages/npm/google-gax/2.29.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/google-gax/2.29.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/google-gax/2.29.4/compatibility-slim/2.29.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/google-gax/2.29.4/confidence-slim/2.29.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/gax-nodejs</summary>

### [`v2.29.4`](https://togithub.com/googleapis/gax-nodejs/blob/HEAD/CHANGELOG.md#&#8203;2294-httpsgithubcomgoogleapisgax-nodejscomparev2293v2294-2022-01-19)

[Compare Source](https://togithub.com/googleapis/gax-nodejs/compare/v2.29.3...v2.29.4)

### [`v2.29.3`](https://togithub.com/googleapis/gax-nodejs/blob/HEAD/CHANGELOG.md#&#8203;2293-httpsgithubcomgoogleapisgax-nodejscomparev2292v2293-2022-01-11)

[Compare Source](https://togithub.com/googleapis/gax-nodejs/compare/v2.29.2...v2.29.3)

### [`v2.29.2`](https://togithub.com/googleapis/gax-nodejs/blob/HEAD/CHANGELOG.md#&#8203;2292-httpsgithubcomgoogleapisgax-nodejscomparev2291v2292-2022-01-11)

[Compare Source](https://togithub.com/googleapis/gax-nodejs/compare/v2.29.1...v2.29.2)

### [`v2.29.1`](https://togithub.com/googleapis/gax-nodejs/blob/HEAD/CHANGELOG.md#&#8203;2291-httpswwwgithubcomgoogleapisgax-nodejscomparev2290v2291-2022-01-06)

[Compare Source](https://togithub.com/googleapis/gax-nodejs/compare/v2.29.0...v2.29.1)

</details>

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-pubsub).
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
@release-please
chore(main): release 2.18.5 (#1467)
782f477
🤖 I have created a release *beep* *boop*
---


### [2.18.5](googleapis/nodejs-pubsub@v2.18.4...v2.18.5) (2022-01-21)


### Bug Fixes

* **deps:** update dependency @opentelemetry/semantic-conventions to v1 ([#1407](googleapis/nodejs-pubsub#1407)) ([740d78c](googleapis/nodejs-pubsub@740d78c))
* **deps:** update dependency google-gax to v2.29.0 ([#1452](googleapis/nodejs-pubsub#1452)) ([f419137](googleapis/nodejs-pubsub@f419137))
* **deps:** update dependency google-gax to v2.29.4 ([#1469](googleapis/nodejs-pubsub#1469)) ([8abbfa7](googleapis/nodejs-pubsub@8abbfa7))
* update to work with latest node types (changed the return type of Stream.destroy()) ([#1464](googleapis/nodejs-pubsub#1464)) ([fddc2e7](googleapis/nodejs-pubsub@fddc2e7))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@callmehiphop callmehiphop

Labels

api: compute Issues related to the Compute Engine API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@stephenplusplus @callmehiphop @coveralls @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.