Get Service Details from VM object?

Is there a way to get the Service details from a VM object? I don’t see anything in the attributes on the vm object returned by the API, and no methods seem to return any information related to the service a VM is associated with.

Is there an attribute or query through the API that could be used?



Hope this helps,

Perfect, that gives me exactly what I was looking for, thank you!

I’m not clear how I would have learned that ‘service’ was an attribute (virtual attribute?) that could be and needed to be explicitly requested from reviewing the docs.

If in doubt as to what’s available, make a REST “OPTIONS” call to the collection, which will list all of the available attributes, virtual attributes, relationships, and subcollections. In the case of vms, “service” is a relationship, for example:

OPTIONS https://<miq>/api/vms

 "relationships": [

(see also

Hope this helps,

1 Like

Awesome, thank you so much for explaining, as always, really appreciate that you take the time to respond.