Add existing Affinity Label to Host

As the title, have tried to add it using sysService.hostsService().hostService(hostID).affinityLabelsService().add().label(sysService.affinityLabelsService().labelService(labelID).get().send().label()).send(); and similar variants with no luck. TIA

This is correct approach, but better is if you just send the ID to be attached to the host, then the whole label object. Like this: sysService.hostsService().hostService("123") .affinityLabelsService() .add(). label(affinityLabel().id("456").build()) .send(); But your code should work just OK. What is the error you get? On 17/10/2019 14:41, scott.fitzgerald@oracle.com wrote:
As the title, have tried to add it using sysService.hostsService().hostService(hostID).affinityLabelsService().add().label(sysService.affinityLabelsService().labelService(labelID).get().send().label()).send();
and similar variants with no luck.
TIA _______________________________________________ Devel mailing list -- devel@ovirt.org To unsubscribe send an email to devel-leave@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/XZSUX7WK7SPYCQ...

Seems to be working now, strange. Maybe I was passing the wrong host at the time. Thanks.
participants (2)
-
Ondra Machacek
-
scott.fitzgerald@oracle.com