Skip to content

Add endpoint to support direct download of specific package or extension  #90

@jcfr

Description

@jcfr

Is your feature request related to a problem? Please describe.

Downloading a specific package without using the python client currently requires multiple calls. This lead to complex implementation.

For example:

# Get app_id
app_id=$(curl -X GET --header "Accept: application/json" "https://slicer-packages.kitware.com/api/v1/app?name=Slicer" | jq ".[0]._id" -r)
https://slicer-packages.kitware.com/api/v1/app?name=Slicer

app_id=5f4474d0e1d8c75dfc705482
echo "app_id: ${app_id}"

# Get item_id
revision=29917
os=macosx
arch=amd64
item_id=$(curl -X GET --header "Accept: application/json" "https://slicer-packages.kitware.com/api/v1/app/${app_id}/package?os=${os}&arch=${arch}&revision=${revision}" -s | jq ".[0]._id" -r)
echo "item_id: ${item_id}"

# Get file_id
curl -X GET "https://slicer-packages.kitware.com/api/v1/item/${item_id}/download" -O

Describe the solution you'd like

Add new endpoints.

There are few possible approaches to define the routes

Explicitly include release_id_or_name, os, arch, revision

For example:

GET /app/:app_id_or_name/:release_id_or_name/package/:os/:arch/:revision/download
GET /app/:app_id_or_name/:release_id_or_name/extension/:os/:arch/:revision/download

where:

  • app_id_or_name: 5f4474d0e1d8c75dfc705482 or Slicer
  • release_id_or_name: draft, release name like 4.10, or id of the release
  • os: linux, macosx or `win
  • arch: amd64
  • revision: 29917

Examples:

/app/Slicer/4.15/package/macosx/amd64/29917/download
/app/Slicer/draft/package/macosx/amd64/29917/download

Only with os, arch, revision

GET /app/:app_id_or_name/package/:os/:arch/:revision/download
GET /app/:app_id_or_name/extension/:os/:arch/:revision/download

and then additional parameter would be passed using &param1=value1.

All filters as parameters

GET /app/:app_id_or_name/package/download
GET /app/:app_id_or_name/extension/download

If more than packages is found, report an error requesting user to be more specific with specific filters.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions