3

This REST API gives the List of Instances .

But as mentioned in the document it doesn't give InstanceViewStatus values.

How do we get the InstanceViewStatus while getting the list of instances ?

Cuz we don't wanna call more number of API's to get this info.

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
Arun Kumar G R
  • 178
  • 2
  • 13

1 Answers1

0

How do we get the InstanceViewStatus while getting the list of instances ?

Based on my knowledge, it is not impossible. They use different REST API.

List all Instances:

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2017-12-01

Get InstanceView

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/shuilinux/providers/Microsoft.Compute/virtualMachines/shui?api-version=2017-03-30&$expand=instanceView

For get-instanceview, resource group name and VM name are required.

For your scenario, you could use list all instance api to get all VM and vms ID then call get instanceview API. You need a loop.

Just a Rest API, it is not possible.

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45