Openshift: How to retrieve a container_service corresponding to a service via REST?


#1

Hello, I provisioned a catalog item based on Openshift httpd-example and I’m able to get the corresponding service object via /api/services/{serviceId} endpoint. However, I would like also like to retrieve the corresponding container_service (which I can see in UI under Compute > Containers > Container Services). Looking at the response from /api endpoint, there is now container_services endpoint. (I’m using CloudForms Version 5.9.3.4.20180702181921_afd03d7, or ManageIQ Version gaprindashvili-6.20181101152640_460a0a8.)

After some experiments, I found a complicated way to reach the container_service: If I use /api/container_projects/{projectId}?attributes=container_services, I’m able to list all container service from a container_project. Then I realized that one of the orchestration stack resources returned by /api/services/{serviceId}/orchestration_stacks/{orchestrationStackId}?attributes=resources shares the ems_ref with one of the container_services - so I have a link between a service and a container service.

Anyway, is there a more direct way to get a container service for a service via REST?

Also, is it possible to get the container_groups corresponding to a container_service? Is it possible to get container_service_port_configs corresponding to a container_service? The CloudForms/ManageIQ UI shows all of this but I would like to get the info via REST.