we are missing a way to invoke the GetStorageDomainListById query in the REST API. this query is being used in the GUI in the 'Storage -> Data Centers' sub-tab. [AFAIR, this query returns a list of storage domains, in which each item is the exact same storage domain, in the context (status, etc.) of the data-center to which this storage domain is attached]
From a quick look, this query seems to always return 0 or 1 storage domains, depending if the domain with the given ID is attached to a pool or not. I think with a bit of tinkering it can be dropped completely and replaced with calls to GetStorageDomainById. Tal/Daniel - can you confirm?
(In reply to Allon Mureinik from comment #1) > From a quick look, this query seems to always return 0 or 1 storage domains, > depending if the domain with the given ID is attached to a pool or not. > I think with a bit of tinkering it can be dropped completely and replaced > with calls to GetStorageDomainById. > > Tal/Daniel - can you confirm? Actually, the query can return multiple results - in case of an ISO domain that is attached to multiple DCs (used for 'storage -> data-centers' sub-tab).
I think this can be solved adding to the Storage Domain entities a list of links to the Data Centers they are attached to. For example: GET /storagedomains/{storagedomain:id} <storage_domain id="..." href="..."> <name>mydata</name> <data_centers> <data_center id="..." href="..."/> <data_center id="..." href="..."/> ... </data_centers> </storage_domain> With this information the client (the GUI in this case) can find the identifiers of the data centers and then retrieve them using an additional call. Note that we already have a this link, but only for one Data Center, and only in the /datacenters/{datacenter:id}/storagedomains collection. That must be preserved for backwards compatibility.
Juan, can you please provide some doctext for this BZ?
Juan, can you please provide steps to reproduce?
The steps to reproduce are the following: 1. Create at least two data centers, each with at least one storage domain and hone host. 2. Create a ISO storage domain and attach it to the previously created data centers. 3. Request the representation of the storage domain to the RESTAPI using the top level /storagedomains collection, for example using a script like the following: #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="***" curl \ --insecure \ --user "${user}:${password}" \ --header "Accept: application/xml" \ "${url}/storagedomains/the_id_of_the_iso_domain" The result should contain a "data_centers" element, and it should contain references to the two data centers it is attached to: <data_centers> <data_center id="the_id_of_the_first_data_center"/> <data_center id="the_id_of_the_second_data_center"/> </data_centers> (This is enough to verify that the bug is solved, but to verify that there isn't a backwards compatibility issue we should also check that the old single "data_center" element is also available when requesting the storage domain via the /datacenter/{datacenter:id}/storagedomains subcollection.) 4. Request the representation of the ISO domain using the /datacenter/{datacenter:id}/storagedomains subcollection: #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="***" curl \ --insecure \ --user "${user}:${password}" \ --header "Accept: application/xml" \ "${url}/datacenters/the_id_of_the_data_center/storagedomains/the_id_of_the_iso_storage_domain" The result should contain the new "data_centers" element and also the old "data_center" element: <!-- This is the old single element: --> <data_center id="b8953853-4771-4768-b83f-1216bc6bf934"/> <!-- This is the new multiple element: --> <data_centers> <data_center id="b8953853-4771-4768-b83f-1216bc6bf934"/> <data_center id="e4c1c8cb-c539-42bb-9038-9c1487bf5cd8"/> </data_centers>
verified on 3.6 master
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE