# Update load balancer tagets via API

**URL:** <https://forums.suse.com/t/update-load-balancer-tagets-via-api/6446>\
**Category:** Rancher 1.x\
**Created:** [May 23, 2017, 2:46pm UTC](https://forums.suse.com/t/update-load-balancer-tagets-via-api/6446 "2017-05-23T14:46:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://forums.suse.com/u/Edgar)\
**Post date:** [May 23, 2017, 2:46pm UTC](https://forums.suse.com/t/update-load-balancer-tagets-via-api/6446/1 "2017-05-23T14:46:48Z")

</div>

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 :

 ![](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/0/06b814b20ccfbdae2779a0f0ddbff83ffdad5edb.png)

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

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [May 23, 2017, 3:53pm UTC](https://forums.suse.com/t/update-load-balancer-tagets-via-api/6446/2 "2017-05-23T15:53:27Z")

</div>

Ports go in the `addservicelink`: [http://docs.rancher.com/rancher/v1.1/en/api/v1/api-resources/loadBalancerService/#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.

---

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://forums.suse.com/u/Edgar)\
**Post date:** [May 23, 2017, 4:49pm UTC](https://forums.suse.com/t/update-load-balancer-tagets-via-api/6446/3 "2017-05-23T16:49:45Z")

</div>

Hi Vincent,

Thank you, it works!

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

Regards
