# API docs and client libraries

**URL:** <https://forums.suse.com/t/api-docs-and-client-libraries/1013>\
**Category:** Rancher 1.x\
**Created:** [November 19, 2015, 3:16pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013 "2015-11-19T15:16:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [November 19, 2015, 3:16pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/1 "2015-11-19T15:16:58Z")

</div>

Hi.

Any information on when API documentation will be available, and maybe even client libraries if those are planned?

---

<div class="post-metadata">

**Author:** ![jloisel](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jloisel](https://forums.suse.com/u/jloisel)\
**Post date:** [November 19, 2015, 4:27pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/2 "2015-11-19T16:27:33Z")

</div>

We have made our own Java client very quickly using Retrofit + Jackson. It’s just a matter of mapping the json objects into Java objects, and map the rest calls using a Retrofit annotated interface.

The rest api is self-documented on http:///v1. Altough, it would be interesting to have a documentation which explains what object is for what. It’s a bit confusing between physicalHosts, hosts, machines etc.

---

<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:** [November 19, 2015, 4:45pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/3 "2015-11-19T16:45:46Z")

</div>

We (well, @denise and @prachi mostly) are working on docs right now to publish in the next week or two.

There are [Go](https://github.com/rancher/go-rancher) and [Python](https://github.com/rancher/gdapi-python) libraries that we use internally, and a [PHP](https://github.com/godaddy/gdapi-php) one I wrote a long time ago. Beyond that we would like to have official clients for more languages but have no immediate plans.

---

<div class="post-metadata">

**Author:** ![sdlarsen](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sdlarsen](https://forums.suse.com/u/sdlarsen)\
**Post date:** [November 20, 2015, 9:08am UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/4 "2015-11-20T09:08:41Z")

</div>

Thank you for the update. I’ll have a look at the Python library while waiting for the docs.

---

<div class="post-metadata">

**Author:** ![jloisel](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jloisel](https://forums.suse.com/u/jloisel)\
**Post date:** [November 20, 2015, 10:52am UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/5 "2015-11-20T10:52:50Z")

</div>

The python client won’t help you much since it’s a generic client to query the GDAPI REST 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:** [November 20, 2015, 3:46pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/6 "2015-11-20T15:46:28Z")

</div>

Every language’s client we make will be generic, (or generically generated code). All of the API is described by the schema it returns, there is no need to write Rancher-specific code for a client library.

(You’re right that it won’t help as far as documentation though.)

---

<div class="post-metadata">

**Author:** ![jloisel](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jloisel](https://forums.suse.com/u/jloisel)\
**Post date:** [November 20, 2015, 5:10pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/7 "2015-11-20T17:10:11Z")

</div>

It’s not possible to write a completely generic client in Java. The language is not as dynamic as Python or Php. And, at some point, you need to rely on the nature of the objects even with a generic client.

I think the GDapi basically just avoids to hardcode the endpoint urls in the client. It also serves as a micro-documentation about the service and the object structures behind.

---

<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:** [November 20, 2015, 7:13pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/8 "2015-11-20T19:13:45Z")

</div>

@jloisel All of Cattle (the core of Rancher) is Java. The schemas describing every type and field are there specifically to make it possible to generate code for strongly-typed languages like Go and Java, because nobody wants to manually maintain classes for $x APIs \* $y resources \* $z languages every time a new field is added.

---

<div class="post-metadata">

**Author:** ![jloisel](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jloisel](https://forums.suse.com/u/jloisel)\
**Post date:** [November 20, 2015, 7:55pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/9 "2015-11-20T19:55:10Z")

</div>

Thanks for the insight. 😊

Is a Java client planned anything soon? I would be interested since i could then throw away our hardcoded beans and rest api calls.

---

<div class="post-metadata">

**Author:** ![zhanglei.neu](https://avatars.discourse-cdn.com/v4/letter/z/9fc348/32.png) [@zhanglei.neu](https://forums.suse.com/u/zhanglei.neu)\
**Post date:** [December 10, 2015, 6:47pm UTC](https://forums.suse.com/t/api-docs-and-client-libraries/1013/10 "2015-12-10T18:47:04Z")

</div>

Is a Java client planned anything soon?
