getTagReferences() for each virtual guest returns nothing
It will return null or zero. However gettags() works well which help to retrieve all tags in an account.
Could you provide more detail? Adding the following code to the listServers example for guests seems to work without issue:
Guest.Service guestService = guest.asService(client);
for (Reference tagRef : guestService.getTagReferences()) {
Tag tag = tagRef.getTag();
System.out.format("Tag: %s\n", tag.getName());
}
Are you sure your guests have tags? If not, have you tried using setTags? An example:
Guest.Service guestService = guest.asService(client);
guestService.setTags("hi,hello,hola");
If you use that example, the above output for the same guest should be:
Tag: hello
Tag: hola
Tag: hi
for (Guest g: guests) { List<Reference> tagRefs = g.getTagReferences(); logger.info(g.getHostname()); for(Reference tagRef : tagRefs){ Tag tag = tagRef.getTag(); logger.info(tag.getName()); } }
I am able to get the guest hostname but not the tags for each guest.The tags are there as I can see the tags which I have set through SoftLayer UI.
If you haven't masked tagReferences on the guest objects, calling getTagReferences() on a Guest won't return anything since that wasn't returned by the API.
If you call getTagReferences() on a Guest.Service object (see my example above), that will make a request to the API to get the tag references for you.
Closing issue due to lack of updates.