Discussion:
Charm series in API URL
Timothy Youell
2018-06-26 15:14:29 UTC
Permalink
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.
Martin Hilton
2018-06-26 15:46:08 UTC
Permalink
Hi Tim,

The statistics are based on the name of the charm itself. Once upon a time
all charms contained the series in their name. Using your example above
cs:~bigdata-charmers/trusty/hadoop-plugin-5 (
https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/trusty/5) is a
different charm from cs:~bigdata-charmers/xenial/hadoop-plugin-5 (
https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/xenial/5). Later
charms are generally multi-series where the series is not included in the
name. For example cs:~bigdata-charmers/hadoop-plugin-35 (
https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/35). You'll notice
that to get the statistics for the later version of the charm are not
accessible at https://api.jujucharms.com/charmstore/v5/stats/counter/
archive-download:xenial:hadoop-plugin:bigdata-charmers:35?by=day&start=2016-
04-01&end=2018-06-20&include=promulgated, but can be found at
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download::
hadoop-plugin:bigdata-charmers:35?by=day&start=2016-
04-01&end=2018-06-20&include=promulgated.

cs:~spiculecharms/apache-drill is considered a multi-series charm in this
respect as there is no series in the name.

I hope that clarifies things.
​
Martin
Mark Shuttleworth
2018-06-27 09:16:30 UTC
Permalink
Our intention is to shift charm names entirely to the snap naming
system. It provides a much more useful approach to publication,
versioning, beta/rc/edge, CI/CD.

So I would ask the store team to make sure that every change they make
is a step in that direction, and preferably, that they are lifting
wholesale chunks of code from the snap world into the charm world.

We've learned a lot in the past five years, we should use that ;)

Mark
Post by Martin Hilton
Hi Tim,
The statistics are based on the name of the charm itself. Once upon a
time all charms contained the series in their name. Using your example
above cs:~bigdata-charmers/trusty/hadoop-plugin-5
(https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/trusty/5) is
a different charm from cs:~bigdata-charmers/xenial/hadoop-plugin-5
(https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/xenial/5).
Later charms are generally multi-series where the series is not
included in the name. For example
cs:~bigdata-charmers/hadoop-plugin-35
(https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/35). You'll
notice that to get the statistics for the later version of the charm
are not accessible at
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download:xenial:hadoop-plugin:bigdata-charmers:35?by=day&start=2016-04-01&end=2018-06-20&include=promulgated,
but can be found at
https://api.jujucharms.com/charmstore/v5/stats/counter/archive-download::hadoop-plugin:bigdata-charmers:35?by=day&start=2016-04-01&end=2018-06-20&include=promulgated.
cs:~spiculecharms/apache-drill is considered a multi-series charm in
this respect as there is no series in the name.
I hope that clarifies things.
​
Martin
Timothy Youell
2018-06-27 12:19:27 UTC
Permalink
That makes a lot more sense, thank you Martin.

If the push to the snap naming system can provide a more useful framework for publication, versioning etc then it’s definitely worth going for Mark - it would also allow people like me, who are fairly new to the Juju world, to gain a better understanding of the interaction between snap and charm.

Tim
Our intention is to shift charm names entirely to the snap naming system. It provides a much more useful approach to publication, versioning, beta/rc/edge, CI/CD.
So I would ask the store team to make sure that every change they make is a step in that direction, and preferably, that they are lifting wholesale chunks of code from the snap world into the charm world.
We've learned a lot in the past five years, we should use that ;)
Mark
Post by Martin Hilton
Hi Tim,
The statistics are based on the name of the charm itself. Once upon a time all charms contained the series in their name. Using your example above cs:~bigdata-charmers/trusty/hadoop-plugin-5 (https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/trusty/5 <https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/trusty/5>) is a different charm from cs:~bigdata-charmers/xenial/hadoop-plugin-5 (https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/xenial/5 <https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/xenial/5>). Later charms are generally multi-series where the series is not included in the name. For example cs:~bigdata-charmers/hadoop-plugin-35 (https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/35 <https://jujucharms.com/u/bigdata-charmers/hadoop-plugin/35>). You'll notice that to get the statistics for the later version of the charm are not accessible at https://api.jujucharms.com/ <https://api.jujucharms.com/>charmstore/v5/stats/counter/archive-download:xenial:hadoop-plugin:bigdata-charmers:35?by=day&start=2016-04-01&end=2018-06-20&include=promulgated, but can be found at https://api.jujucharms.com/ <https://api.jujucharms.com/>charmstore/v5/stats/counter/archive-download::hadoop-plugin:bigdata-charmers:35?by=day&start=2016-04-01&end=2018-06-20&include=promulgated.
cs:~spiculecharms/apache-drill is considered a multi-series charm in this respect as there is no series in the name.
I hope that clarifies things.
​
Martin
--
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.
Loading...