-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compute: vm: add resize() #1469
Conversation
|
||
callback = callback || common.util.noop; | ||
|
||
this.stop(function(err, operation, apiResponse) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
126105e
to
00691a9
Compare
@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 |
@@ -579,4 +637,24 @@ VM.prototype.request = function(reqOpts, callback) { | |||
}); | |||
}; | |||
|
|||
VM.prototype.execAfterOperation_ = function(callback) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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 |
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 |
Perhaps |
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 Maybe we should wait for the next meeting and bring it up then. |
Feedback was to change to a name that implies magic is happening, i.e. |
00691a9
to
5152158
Compare
@callmehiphop PTAL! I renamed the method to *the method is not static because to use it from "VM", we introduce a cross dependency from |
* | ||
* 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 | ||
* type. After it is sucessfully changed, the VM will be started. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* compute: vm: add setMachineType * restart if necessary * rename to resize * add `start` option
This takes over from #1448, adding a
resize
method on the VM object.To Dos