Add to the HTTPS API server the ability
to serve local charm files.
As discussed with Rick and Dimiter if the query includes the file,
then the file contents are served. If file points to a directory
an error is returned. If the query does not include a file, then
a JSON response is sent including a list of charm files.
Affected files (+352, -30 lines):
A [revision details]
M state/api/params/internal.go
M state/apiserver/apiserver.go
M state/apiserver/charms.go
M state/apiserver/charms_test.go
Reviewers: mp+207994_ code.launchpad. net,
Message:
Please take a look.
Description:
Implement the get charm file API.
Add to the HTTPS API server the ability
to serve local charm files.
As discussed with Rick and Dimiter if the query includes the file,
then the file contents are served. If file points to a directory
an error is returned. If the query does not include a file, then
a JSON response is sent including a list of charm files.
QA: /github. com/hatched/ ghost-charm to/ghost- charm-master. zip -H /user-admin: MYPASSWD@ 10.0.3. 1:17070/ charms? series= precise`. :"local: precise/ ghost-4" }. precise/ ghost-4& file=icon. svg" /user-admin: MYPASSWD@ 10.0.3. 1:17070/ charms` precise/ ghost-4& file=hooks/ install" /user-admin: MYPASSWD@ 10.0.3. 1:17070/ charms`: precise/ ghost-4& file=hooks" /user-admin: MYPASSWD@ 10.0.3. 1:17070/ charms`: you should see a 403 precise/ ghost-4" /user-admin: MYPASSWD@ 10.0.3. 1:17070/ charms`.
- Download the Ghost charm from https:/
(the zip archive can be downloaded from the sidebar on the right).
- Bootstrap a local environment using this branch.
- Upload the ghost local charm, e.g.:
`curl -ikL --data-binary @/path/
"Content-Type: application/zip"
https:/
The response should be something like:
{"CharmURL"
- Download ghost charm files, e.g.:
`curl -ikLG -d "url=local:
https:/
or
`curl -ikLG -d "url=local:
https:/
you should see the file contents.
- Ensure directories are not allowed, e.g.:
`curl -ikLG -d "url=local:
https:/
forbidden.
- Retrieve a list of the charm files:
`curl -ikLG -d "url=local:
https:/
- Done, destroy the environment, thank you!
https:/ /code.launchpad .net/~frankban/ juju-core/ get-charm- api/+merge/ 207994
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/67750045/
Affected files (+352, -30 lines): params/ internal. go /apiserver. go /charms. go /charms_ test.go
A [revision details]
M state/api/
M state/apiserver
M state/apiserver
M state/apiserver