ManageIQ / azure-armrest

Ruby interface for Azure using the new REST API
Apache License 2.0
15 stars 36 forks source link

Modify the VirtualMachineService#get method to include instance view information #381

Closed djberg96 closed 4 years ago

djberg96 commented 5 years ago

As of June 2018 the Azure REST API was modified to allow inline expansion of the instance view properties in a standard GET call for a single instance:

https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/get

This would be handy for the Azure provider, since we currently end up making a separate call for each VM to get power state information.

Supporting the $expand url parameter was also necessary for this to work.

Oddly, the ability to use $expand does not yet appear to be supported for other calls.

Note that this is technically a breaking change and we should consider a major version bump if accepted.

bzwei commented 5 years ago

To avoid the need of a new major version, can we keep everything untouched but add a new method called get_model_and_instance_view?

djberg96 commented 5 years ago

@bzwei I don't really want to add another method. Instead I changed it to just add an optional 3rd argument, so it won't be included by default, but you could do this:

vm.get(vm_name, vm_group, :expand => 'instanceView')

This gives us the capability without breaking backwards compatibility.

miq-bot commented 4 years ago

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

miq-bot commented 4 years ago

Checked commits https://github.com/djberg96/azure-armrest/compare/cfa66b9eac2487a3d6eb6b1effeddcc07b8e9cdd~...bcb4c76bd47862ef493430925f4fdabbe01dfb4d with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :+1: