Hi Ondra,
I tried your URL but it not worked. I want to retrieve all the attached vms
by a disk, so I cloud not provide a specified vm name for searching. Also
tried with
https://fqdn/ovirt-engine/api/vms?search=
<
https://fqdn/ovirt-engine/api/disks?search=vm_names=myvmname>
*disk=DISKNAME*, unfortunately the `disk` parameter is not supported.
Put it differently, how could I get the disk list by rest API as same as
shown by visiting admin portal at
https://fqdn/ovirt-engine/webadmin/?#disks,
which indicates the attached vm name for each disk.
<
https://10.1.111.222/ovirt-engine/webadmin/?locale=en_US#disks>
On Fri, Jun 1, 2018 at 8:51 AM, Joey Ma <majunjiev(a)gmail.com> wrote:
OK, got it. Search is a powerful solution. Thank you very much.
On Thu, May 31, 2018 at 6:49 PM, Ondra Machacek <omachace(a)redhat.com>
wrote:
> On 05/31/2018 09:28 AM, iterjpnic wrote:
>
>> Hi all,
>>
>> I use oVirt engine API v4.2 for implementing terraform oVirt provider.
>> And I want to check if a Disk has been attached to a VM, so I need to find
>> all vms attached by this disk.
>> But after I checked the GET-Response data from the
>> "/ovirt-engine/api/disks/<disk-id>" rest url, there has no
>> disk-attachment/vm related properties or links. I could get a trade-off, by
>> the following steps:
>> 1. getting all vms
>> 2. get all disk-attachments of each vm
>> 3. check if the given disk id equals to the `disk` property of each
>> disk-attachment`
>> 4. If equals, append the vm to result list
>>
>> Is there any simpler and smarter way to get this? Thanks.
>>
>
> Hi, you can use following:
>
>
https://fqdn/ovirt-engine/api/disks?search=vm_names=myvmname
>
> _______________________________________________
>> Users mailing list -- users(a)ovirt.org
>> To unsubscribe send an email to users-leave(a)ovirt.org
>> Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
>> oVirt Code of Conduct:
https://www.ovirt.org/communit
>> y/about/community-guidelines/
>> List Archives:
https://lists.ovirt.org/archiv
>> es/list/users(a)ovirt.org/message/6LVOIVEUUO7PXVV36GH3V6GSURQV4ALO/
>>
>>