Support API and patch versions in charmhub fetch_library and fetch_libraries

Bug #2060146 reported by Alex Lowe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
New
Undecided
Unassigned

Bug Description

More details: https://docs.google.com/document/d/1W6vpXDgom9HLGWNblnnwJIAcM9Lx_liJ56mIJ-ONujc/edit

The `fetch-library` charmhub endpoint should accept an api and optional patch version, like so:

```
/v1/<namespace>/libraries/<name>/<library_id>?api=<integer>&patch=<integer>
```

If patch is provided, api is necessary; however, if api is provided without providing patch, it will retrieve the latest revision that matches that api version.

Likewise for `fetch_libraries` it should be able to accept JSON like this:

```
[
  {
 "charm-name": "some-charm",
 "library-name": "latest-lib",
  },
  {
 "charm-name": "some-charm",
 "library-name": "api-specified",
 "api": 1,
  },
  {
 "charm-name": "some-charm",
 "library-name": "api-and-patch-specified",
 "api": 1,
 "patch": 0
  }
]

```

with the same requirements as `fetch_library`

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.