# Upgrading a Service with API v2

**URL:** <https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142>\
**Category:** Rancher 1.x\
**Created:** [August 18, 2017, 1:55pm UTC](https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142 "2017-08-18T13:55:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisp](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@chrisp](https://forums.suse.com/u/chrisp)\
**Post date:** [August 18, 2017, 1:55pm UTC](https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142/1 "2017-08-18T13:55:23Z")

</div>

I am trying to upgrade a service using the the v2-beta API. The end goal is to simply pull a docker image and deploy it without changing any configurations on the service. Is there a simple way to do this? I was leaning toward having to send the entire service configuration in the body under “inServiceUpgradeStrategy” on the upgrade service request, but that seems crazy to have to do that on each request if I want to preserve the launch configuration I have already set in the UI.

Any help would be awesome!

---

<div class="post-metadata">

**Author:** ![vkruoso](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vkruoso/32/583_2.png) [@vkruoso](https://forums.suse.com/u/vkruoso)\
**Post date:** [August 24, 2017, 8:43pm UTC](https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142/2 "2017-08-24T20:43:11Z")

</div>

Hi @chrisp!

I did it a few days ago. You can send only the values you want to change in the `inServiceStrategy` of your request. No need to specify all the launchConfig. Although its not crazy to get the launchConfig from the current service, change what you need and send the entire config again. The server will handle applying only the diff.

This is the reference you need:  
[http://rancher.com/docs/rancher/v1.6/en/api/v2-beta/api-resources/service/#upgrade](http://rancher.com/docs/rancher/v1.6/en/api/v2-beta/api-resources/service/#upgrade)

Thanks.

---

<div class="post-metadata">

**Author:** ![chrisp](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@chrisp](https://forums.suse.com/u/chrisp)\
**Post date:** [August 25, 2017, 4:07pm UTC](https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142/3 "2017-08-25T16:07:23Z")

</div>

Ah ok, thanks @vkruoso! Do you also happen to know if you can tell it to finish and upgrade in the upgrade request so I don’t have to make two API calls to upgrade and finish and upgrade of a service?

---

<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:** [August 25, 2017, 6:55pm UTC](https://forums.suse.com/t/upgrading-a-service-with-api-v2/7142/4 "2017-08-25T18:55:09Z")

</div>

No, finish is a separate call.

(In Rancher 2.0 it will not be needed anymore, the service will just go back to active, you can rollback if needed, and the old containers are garbage collected eventually or there’s an action to clean them up)
