I’m trying to find a way to retrieve the Associated Deployment Role Objects for servers, including the object info that I’m able to see in the GUI (zones, etc). I’m able to use this below to get the roles, but that embedded data doesn’t include the zone/network, and using the returned ID to get the object doesn’t contain that data either. Is there another way?
Actually, if you do it your way by fetching /api/v2/servers/<id> and embed(deploymentRoles) the embedded role’s _link.up.href will have the zone object to which the deploymentRole is assigned (at least for the DNS deployment role). You can’t embed _links.up but you could separately fetch that object. Oddly /api/v2/servers/<id>/deploymentRoles does not return the link to the zone, but /api/v2/servers/<id>?fields=embed(deploymentRoles) does. There must be some subtle distinction that causes this but I don’t really know why...
Actually, if you do it your way by fetching /api/v2/servers/<id> and embed(deploymentRoles) the embedded role’s _link.up.href will have the zone object to which the deploymentRole is assigned (at least for the DNS deployment role). You can’t embed _links.up but you could separately fetch that object. Oddly /api/v2/servers/<id>/deploymentRoles does not return the link to the zone, but /api/v2/servers/<id>?fields=embed(deploymentRoles) does. There must be some subtle distinction that causes this but I don’t really know why...