Closed genet022 closed 2 years ago
please note I provided one of these granular details. Note that in the first example containers
is missing a tilda (~
)
curl
ing the correct endpoint yields a response rather than the 404 Response. However, this missing metadata still could be an issue
❯ curl "https://api.jujucharms.com/charmstore/v5/~containers/coredns/meta/any?channel=edge"
{"Id":"cs:~containers/coredns-21"}
running this locally, here's the URL that's generated in charmstore.py line 127
https://api.jujucharms.com/charmstore/v5/~containers/easyrsa/meta/any?include=bundle-machine-count&include=bundle-metadata&include=bundle-unit-count&include=charm-actions&include=charm-config&include=charm-metadata&include=common-info&include=extra-info&include=owner&include=published&include=resources&include=supported-series&include=terms
❯ curl https://api.jujucharms.com/charmstore/v5/\~containers/easyrsa/meta/any\?include\=bundle-machine-count\&include\=bundle-metadata\&include\=bundle-unit-count\&include\=charm-actions\&include\=charm-config\&include\=charm-metadata\&include\=common-info\&include\=extra-info\&include\=owner\&include\=published\&include\=resources\&include\=supported-series\&include\=terms | jq
{
"Id": "cs:~containers/easyrsa-441",
"Meta": {
"published": {
"Info": [
{
"Channel": "stable",
"Current": true
},
{
"Channel": "candidate",
"Current": false
},
{
"Channel": "beta",
"Current": true
},
{
"Channel": "edge",
"Current": false
}
]
},
"supported-series": {
"SupportedSeries": [
"focal",
"bionic",
"xenial",
"trusty"
]
}
}
}
By design, charmhub does NOT implement all of the old charmstore APIs, that was never the goal/intent. It's enough of a subset to allow Juju to deploy a charm.
I see a "Name" value provided e.g. here:
$ curl -s "https://api.jujucharms.com/charmstore/v5/~containers/easyrsa/meta/any?channel=stable&include=id&include=supported-series&include=published" | jq .
{
"Id": "cs:~containers/easyrsa-441",
"Meta": {
"id": {
"Id": "cs:~containers/easyrsa-441",
"Name": "easyrsa",
"Revision": 441,
"User": "containers"
},
"published": {
"Info": [
{
"Channel": "stable",
"Current": true
}
]
},
"supported-series": {
"SupportedSeries": [
"focal",
"bionic",
"xenial",
"trusty"
]
}
}
}
so maybe it now lives under Meta.id.Name. A change to Python-libjuju to use that might work. I don't know whether that's the field you need, though.
the url to query actually is generated by another pip package theblues
since the url generated here doesn't have the query parameters include=id
, this isn't returned to python-libjuju
this section is missing
"id": {
"Id": "cs:~containers/easyrsa-441",
"Name": "easyrsa",
"Revision": 441,
"User": "containers"
},
Fixed after #635
Previously supported APIs have broke after the switch from Charmstore to Charmhub. Presumably due to Charmhub not supporting the old APIs.
A simple reproducible example:
A bit more granular: