<div dir="ltr">I meant to follow up with this last week but lost track. In addition to the raw API for getting charm content, you can also just do `charm pull $CHARM_ID` to get the archive zip, in case that's easier.<div><br></div><div>For charm stats, the API docs that Rick linked to includes the "stats" endpoint. You can see some example usage of that in <a href="https://github.com/juju-solutions/k8s-kpi-scripts/blob/master/src/files/thirdparty/k8s-charm-cs-stats">https://github.com/juju-solutions/k8s-kpi-scripts/blob/master/src/files/thirdparty/k8s-charm-cs-stats</a></div><div><br></div><div>For layer and interfaces, you can use the GitHub API to query how many layers and interfaces are available (ex. <a href="https://github.com/juju-solutions/charmbuild-kpi-import/blob/master/scripts/github">https://github.com/juju-solutions/charmbuild-kpi-import/blob/master/scripts/github</a>) but unfortunately there's no easy way at this time to tell how many charms a given layer is used in.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 26, 2018 at 3:25 AM, Merlijn Sebrechts <span dir="ltr"><<a href="mailto:merlijn.sebrechts@gmail.com" target="_blank">merlijn.sebrechts@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Awesome! Thanks guys!</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-01-25 17:38 GMT+01:00 Rick Harding <span dir="ltr"><<a href="mailto:rick.harding@canonical.com" target="_blank">rick.harding@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:13px"><a href="https://github.com/juju/charmstore/blob/v5-unstable/docs/API.md" target="_blank">https://github.com/juju/charms<wbr>tore/blob/v5-unstable/docs/<wbr>API.md</a> is the docs for the API to the charmstore itself. As Adam notes, you can pull down any file and there's manifest call that lists out the files in the charm. From there you could probably check if the charm has a layers.yaml and if so fetch that file, parse it, etc. </span><br><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><a href="https://github.com/juju/charmstore/blob/v5-unstable/docs/API.md#get-idmetamanifest" target="_blank">https://github.com/juju/charms<wbr>tore/blob/v5-unstable/docs/<wbr>API.md#get-idmetamanifest</a></span><br></div></div><br><div class="gmail_quote"><div><div class="m_7392387877296488986h5"><div dir="ltr">On Thu, Jan 25, 2018 at 11:22 AM Adam Collard <<a href="mailto:adam.collard@canonical.com" target="_blank">adam.collard@canonical.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_7392387877296488986h5"><div dir="ltr">Hi Merlijn,</div><div dir="ltr"><br><br><div><div class="gmail_quote"></div></div><div dir="ltr"><div><div class="gmail_quote"><div dir="ltr">On Thu, 25 Jan 2018 at 16:17 Merlijn Sebrechts <<a href="mailto:merlijn.sebrechts@gmail.com" target="_blank">merlijn.sebrechts@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all<div><br></div><div><br></div><div>I'm writing a Juju-related paper and I'd like to get statistics on Charm, layer and interface usage. Are these publicly available?</div><div><br></div><div>Related: is there a documented API to get the code of the charms that are available in the charm store?</div></div></blockquote></div></div></div></div><div dir="ltr"><div dir="ltr"><div><div class="gmail_quote"><div><br>GET <a href="https://api.jujucharms.com/charmstore/v5/$MY_CHARM_NAME/archive/" target="_blank">https://api.jujucharms.com/cha<wbr>rmstore/v5/$MY_CHARM_NAME/arch<wbr>ive/</a> will give you a .zip<br>and<br><br>GET <a href="https://api.jujucharms.com/charmstore/v5/$MY_CHARM_NAME/archive/$PATH/$TO/$FILE" target="_blank">https://api.jujucharms.com/cha<wbr>rmstore/v5/$MY_CHARM_NAME/arch<wbr>ive/$PATH/$TO/$FILE</a><br></div><div>will give you the 'raw' contents.<br><br></div><div>e.g. curl <a href="https://api.jujucharms.com/charmstore/v5/postgresql/archive/hooks/install" target="_blank">https://api.jujucharms.com/cha<wbr>rmstore/v5/postgresql/archive/<wbr>hooks/install</a><br><br></div><div>YMMV,<br><br></div>Adam<br></div></div></div></div></div></div><span class="m_7392387877296488986HOEnZb"><font color="#888888">
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailm<wbr>an/listinfo/juju-dev</a><br>
</font></span></blockquote></div>
</blockquote></div><br></div>
</div></div><br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div>