Update load balancer tagets via API

Hi,

I am using Rancher v1.1.4 and I am trying to update load balancer targets via Rancher API.

I succeeded adding service link :

curl -s -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"serviceLink":{"name":"cloudsso-wt-seb-moulinex-myapp-myadminid", "serviceId":"1s157", "uuid":"076cbb3e-62e2-4120-9e57-2ce43694e470"}}' \
'http://rancher:8080/v1/projects/1a5/services/1s156/?action=addservicelink'

…but Request Host and Target Port are empty :

I tried to update “ServiceConsumeMaps”…but didn’t work…

curl -s -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"name": null, "ports": ["wt-test.int.idaas.orange.com=8080"]}' \
http://rancher:8080/v1/projects/1a5/serviceconsumemaps/1scm359/?action=update

Can you help me please?

Thank you.

Edgar

Ports go in the addservicelink: http://docs.rancher.com/rancher/v1.1/en/api/v1/api-resources/loadBalancerService/#addservicelink

Please upgrade to a modern version as soon as possible (where the load balancer API is different and easier to use). 1.1 was basically the first stable release, literally about half the life of the company ago. It will be officially completely unsupported even for customers next month, (but I don’t think there even are any left on it). There are significant bugs and all the old Docker daemons it is compatible with have major security vulnerabilities.

Hi Vincent,

Thank you, it works!

Ok, I will upgrade to a modern version as soon as possible.

Regards