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, [email protected] 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 -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]/message/XZSUX7WK7SPYCQN7DDPEZZIHVP5RFMFV/

_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]/message/IVTKIY4UK2M3HQFZOMR2TMRQJUYGARID/

Reply via email to