# View compose files from API?

**URL:** <https://forums.suse.com/t/view-compose-files-from-api/2947>\
**Category:** Rancher 1.x\
**Created:** [May 27, 2016, 6:07pm UTC](https://forums.suse.com/t/view-compose-files-from-api/2947 "2016-05-27T18:07:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjwoodr](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjwoodr/32/199_2.png) [@sjwoodr](https://forums.suse.com/u/sjwoodr)\
**Post date:** [May 27, 2016, 6:07pm UTC](https://forums.suse.com/t/view-compose-files-from-api/2947/1 "2016-05-27T18:07:19Z")

</div>

I’m trying to view the compose files (docker-compose, rancher-compose) for each stack via the API. When I go to [http://rancher:8080/v1/projects/1a5/environments](http://rancher:8080/v1/projects/1a5/environments) … I see everything, but the “dockerCompose” node is set to “null” for each stack.

![](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/54c01321d8f357439c5c76c3026aceb7c1443f0a.png)

I was expecting to see something there in that dockerCompose node. Should I be looking elsewhere for this? Note that I’m logged in as Owner in Rancher UI before I opened up the API.

---

<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 27, 2016, 7:51pm UTC](https://forums.suse.com/t/view-compose-files-from-api/2947/2 "2016-05-27T19:51:12Z")

</div>

Yeah those field probably shouldn’t be readable after create… they are the initial compose files that were (not, in this case) imported when you created the stack (environment). The `exportconfig` action will give you back the live config strings (as displayed in the UI), or the `composeConfig` link will download a ZIP that contains them.

---

<div class="post-metadata">

**Author:** ![sjwoodr](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjwoodr/32/199_2.png) [@sjwoodr](https://forums.suse.com/u/sjwoodr)\
**Post date:** [May 27, 2016, 8:05pm UTC](https://forums.suse.com/t/view-compose-files-from-api/2947/3 "2016-05-27T20:05:41Z")

</div>

Yeah I saw the link for downloading the zip file. Wasn’t exactly what we need… but we’ll come up with some solution. Thanks for the response!

---

<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 27, 2016, 8:08pm UTC](https://forums.suse.com/t/view-compose-files-from-api/2947/4 "2016-05-27T20:08:37Z")

</div>

You probably want the `POST ${actions.exportconfig}` **action** , it returns a JSON object that contains the `dockerCompose` and `rancherCompose`.

The `composeConfig` **link** does the ZIP download, which is probably not useful for you (it exists because there’s no way to generate a file to download from the UI even if we have retrieved the strings from the action).
