Hello,
I am unsure about the reason, but we do return status only under
storageomdomain subresource of the datacenters resource. So in order to
get the SD status you have to do following:
SystemService sysService = connection.systemService();
DataCentersService dcsService = sysService.dataCentersService();
DataCenter dc = dcsService.list()
.search(dcName)
.send()
.dataCenters()
.get(0);
DataCenterService dcService = dcsService.dataCenterService(dc.id());
StorageDomain sd = dcService.storageDomainsService().list()
.send()
.storageDomains()
.get(0);
System.out.println(sd.status());
I am CCing Tal who may know the reason why we don't expose status to the
/api/storagedomains endpoint.
On 27/09/2019 17:06, donagh.moran(a)oracle.com wrote:
> Hi as the subject suggests I'm having problems reading the state of the Storage
Domain when not in one of two states active or unattached.
>
> I am developing in Java an reading the state with the piece of code below
>
> StorageDomain sd = sysService.storageDomainsService().list()
> .search(storageDomainName)
> .send()
> .storageDomains()
> .get(0);
> sd.status();
>
> Issue when deactivating
> In the UI it goes from active too inactive. When I recursively get the storage domain
and check its status via the SDK the status never gets set to inactive, instead it goes
from inactive to null and stays o a null state.
>
> Issue when activating
> In the UI it goes from unattached, locked then active. When I recursively get the
storage domain and check its status via the SDK it goes from unattached null then active.
>
> As far as I can tell the only two states detected are unattached and active out of
the ENUM of possible states listed below, of which non are null. I presume as I can check
for two of the eight possible states, that means I am correct in my approach.
>
> ACTIVATING("activating"),
> ACTIVE("active"),
> DETACHING("detaching"),
> INACTIVE("inactive"),
> LOCKED("locked"),
> MAINTENANCE("maintenance"),
> MIXED("mixed"),
> PREPARING_FOR_MAINTENANCE("preparing_for_maintenance"),
> UNATTACHED("unattached"),
> UNKNOWN("unknown"),
>
> Any help would be much appreciated, on whether this is a potential known or unknown
bug or whether I doing something wrong in my approach to retrieving the state of the
domain.
>
> Regards
> Donagh
>
>
> _______________________________________________
> Devel mailing list -- devel(a)ovirt.org
> To unsubscribe send an email to devel-leave(a)ovirt.org
> Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
https://lists.ovirt.org/archives/list/devel@ovirt.org/message/4HVHEC6CAD4...
>