94
93
public information is returned. In this case, results requiring authorization
95
94
(if any) will be omitted.
98
Any entity in the charm store is considered to be part of one or more "channels"
99
(think "distribution channels"). Currently supported channels are "unpublished",
100
"development" and "stable". All entities are initially (and always) part
101
of the "unpublished" channel; subsequent operations on the publish
102
endpoint can make entities available in other channels.
104
All requests that take one or more entity ids as parameters
105
accept a "channel" query parameter that influences what channel
106
is chosen to resolve the ids. The default channel is "stable".
108
For example, if wordpress-3 has just been published to the stable
109
channel, and wordpress-4 has been published to the development
110
then a GET of wordpress/meta/id-revision?channel=development
111
will return {"Revision": 4} and a GET of wordpress/wordpress/meta/id-revision
112
will return {"Revision": 3} because the default channel is "stable".
99
116
The version of the API is indicated by an initial "vN" prefix to the path.
283
299
#### PUT *id*/publish
285
A PUT to ~*user*/*anyseries*/*name*-*anyrevision* sets whether the
286
corresponding charm or bundle is published and can be accessed through a URL
287
with no channel. If the revision number is not specified, the id is resolved to
288
the charm or bundle with the latest development revision number when
289
publishing, and to the charm or bundle with the latest non-development revision
290
number when unpublishing. The id must not include the development channel.
301
A PUT to the publish endpoint publishes the entity with the given id
302
on the channels provided in the request body. It reports an error if
303
there are no channels specified or if one of the channels is invalid
304
(the "unpublished" channel is special and is also considered invalid in
307
See the section on Channels in the introduction for how the published
308
channels affects id resolving.
293
311
type PublishRequest struct {
298
If Published is true, the charm or bundle is made available at the
299
non-development URL with the same revision number. If Published is false, the
302
The response includes the id and promulgated id of the entity after the action
306
type PublishResponse struct {
308
PromulgatedId *charm.URL `json:",omitempty"`
312
If the charm or bundle have been unpublished, the identifiers in the response
313
will represent the corresponding development charm or bundle.
316
On success, the response body will be empty.
315
318
Example: `PUT ~charmers/trusty/django-42/publish`
323
"Channels" : ["stable"],
327
"Id" : "cs:~charmers/trusty/django-42",
328
"PromulgatedId": "cs:trusty/django-10",
327
After the above request, ~charmers/trusty/django will
328
resolve to ~charmers/trusty/django-42 unless a different
329
channel is specified in the request.
1076
#### GET *id*/meta/published
1078
The `meta/published` path returns a list of the channels that
1079
the entity has been published to.
1082
type PublishedResponse struct {
1083
// Info holds an entry for each channel that the
1084
// entity has been published to.
1085
Info []PublishedInfo
1088
// PublishedInfo holds information on a channel that an entity
1089
// has been published to.
1090
type PublishedInfo struct {
1091
// Channel holds the value of the channel that
1092
// the entity has been published to.
1093
// This will never be "unpublished" as entities
1094
// cannot be published to that channel.
1097
// Current holds whether the entity is the most
1098
// recently published member of the channel.
1103
#### GET *id*/meta/terms
1105
The `meta/terms` path returns a list of terms and conditions (as recorded in
1106
the terms field of the charm metadata) the user must agree to in order to
1107
obtain the archive of the given charm id.
1109
Example: `GET some-charm/meta/terms`
1113
"enterprise-terms/1",
1076
1118
#### GET *id*/meta/archive-size
1078
1120
The `meta/archive-size` path returns the archive size, in bytes, of the archive