Azure / Azure/azure-libraries-for-java
Provide a Get by ID SDK method which fetches VirtualMachine model and instance views in a single API call
- Dominant language
- Java
- Stars
- 97
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
There is currently no way to retrieve the combined model and instance views of a single Virtual Machine using a Get by ID API call in the SDK. The Virtual Machine Get REST API supports this using the $expand parameter:
https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/get
`Azure.virtualMachines().getById()` and `Azure.virtualMachines().getByIdAsync()` both call the Get API without the $expand parameter. The only way I've found to retrieve instance view details after calling getById() is to attempt to access one of the instance properties such as VirtualMachine.powerState(). This forces the calling code to make two sequential API calls to Azure.
It would be ideal to have a way in the SDK to retrieve both model and instance views in a single API call since the underlying REST API supports this mechanism.
Contributor guide
Assessment
This issue has not been assessed yet.