Charm series in API URL

Timothy Youell timothy at spicule.co.uk
Tue Jun 26 15:14:29 UTC 2018


Hello all, 

I’ve been part of a small project with Spicule Ltd recently involving extraction of Charm deployment data from the Juju Charm API. Why is it so that the only way to get the deployment data showing for Charms that are only deployable on one series, is by leaving the series section of the URL blank? 

For instance, to view the deployment data of the apache-drill Charm from spiculecharms, which is only deployable on xenial, the following URL is used:
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download::apache-drill:spiculecharms:*?by=day&start=2018-04-19&end=2018-06-26&include=promulgated <https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download::apache-drill:spiculecharms:*?by=day&start=2018-04-19&end=2018-06-26&include=promulgated>
Which returns deployment data per day for the Charm: 
“
[
{
"Date": "2018-04-25",
"Count": 2
},
{
"Date": "2018-04-26",
"Count": 2
}, ...
“
Notice the :: where the series should be between the two colons. 

If xenial is placed between the colons, like so,
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download:xenial:apache-drill:spiculecharms:*?by=day&start=2018-04-19&end=2018-06-26&include=promulgated <https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download:xenial:apache-drill:spiculecharms:*?by=day&start=2018-04-19&end=2018-06-26&include=promulgated>
no data is returned:
“
[
{
"Count": 0
}
]
“
If the Charm is deployable on more than one series, such as hadoop-plugin from bigdata-charmers, which is deployable on both xenial and trusty, then the addition of the series does show the deployment data: 
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download:xenial:hadoop-plugin:bigdata-charmers:5?by=day&start=2016-04-01&end=2018-06-20&include=promulgated <https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download:xenial:hadoop-plugin:bigdata-charmers:5?by=day&start=2016-04-01&end=2018-06-20&include=promulgated>

Any insight into this would be greatly appreciated.

Thanks,

Tim Youell
-- 


Spicule Limited is registered in England & Wales. Company Number: 
09954122. Registered office: First Floor, Telecom House, 125-135 Preston 
Road, Brighton, England, BN1 6AF. VAT No. 251478891.




All engagements 
are subject to Spicule Terms and Conditions of Business. This email and its 
contents are intended solely for the individual to whom it is addressed and 
may contain information that is confidential, privileged or otherwise 
protected from disclosure, distributing or copying. Any views or opinions 
presented in this email are solely those of the author and do not 
necessarily represent those of Spicule Limited. The company accepts no 
liability for any damage caused by any virus transmitted by this email. If 
you have received this message in error, please notify us immediately by 
reply email before deleting it from your system. Service of legal notice 
cannot be effected on Spicule Limited by email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20180626/e5e00e11/attachment.html>


More information about the Juju mailing list