VMware vSphere

 View Only

Get-HardDisk using API rest

  • 1.  Get-HardDisk using API rest

    Posted Dec 25, 2020 05:50 PM

    Dear All,

    I am a bit stuck trying to implement a (quite easy) powerCli command by using Api-rest. In particular I would like to get the same output as the command

    Get-HardDisk -VM vm_name

    In particular, I am interested to get for a specific VM (or for all of them at the same time, is the same), the informaton about the persistence of its disks. While the PowerCli command does it immediately, I'm having troubles to get the same result via API-rest (http://vmware.github.io/vsphere-automation-sdk-rest/6.7.1/)

    I genuinely thought to find such information with /rest/vcenter/vm/{vm}/hardware/disk (http://vmware.github.io/vsphere-automation-sdk-rest/6.7.1/operations/com/vmware/vcenter/vm/hardware/disk.list-operation.html), however the persistence property is not in the response of this API, and I have no clues on where to find it.

    Do you have any suggestion I could try?

    Thanks a lot for your help.

    Riccardo