swh.web.api.views.vault module

swh.web.api.views.vault.api_vault_cook_directory(request, dir_id)[source]
GET /api/1/vault/directory/(dir_id)/
POST /api/1/vault/directory/(dir_id)/

Request the cooking of an archive for a directory or check its cooking status.

That endpoint enables to create a vault cooking task for a directory through a POST request or check the status of a previously created one through a GET request.

Once the cooking task has been executed, the resulting archive can be downloaded using the dedicated endpoint GET /api/1/vault/directory/(dir_id)/raw/.

Then to extract the cooked directory in the current one, use:

$ tar xvf path/to/directory.tar.gz
Parameters
  • dir_id (string) – the directory’s sha1 identifier

Query Parameters
  • email (string) – e-mail to notify when the archive is ready

Request Headers
  • Accept – the requested response content type, either application/json (default) or application/yaml

Response Headers
Response JSON Object
  • fetch_url (string) – the url from which to download the archive once it has been cooked (see GET /api/1/vault/directory/(dir_id)/raw/)

  • obj_type (string) – the type of object to cook (directory or revision)

  • progress_message (string) – message describing the cooking task progress

  • id (number) – the cooking task id

  • status (string) – the cooking task status (either new, pending, done or failed)

  • obj_id (string) – the identifier of the object to cook

Status Codes
  • 200 OK – no error

  • 400 Bad Request – an invalid directory identifier has been provided

  • 404 Not Found – requested directory did not receive any cooking request yet (in case of GET) or can not be found in the archive (in case of POST)

swh.web.api.views.vault.api_vault_fetch_directory(request, dir_id)[source]
GET /api/1/vault/directory/(dir_id)/raw/

Fetch the cooked archive for a directory.

See GET /api/1/vault/directory/(dir_id)/ to get more details on directory cooking.

Parameters
  • dir_id (string) – the directory’s sha1 identifier

Response Headers
Status Codes
  • 200 OK – no error

  • 400 Bad Request – an invalid directory identifier has been provided

  • 404 Not Found – requested directory did not receive any cooking request yet (in case of GET) or can not be found in the archive (in case of POST)

swh.web.api.views.vault.api_vault_cook_revision_gitfast(request, rev_id)[source]
GET /api/1/vault/revision/(rev_id)/gitfast/
POST /api/1/vault/revision/(rev_id)/gitfast/

Request the cooking of a gitfast archive for a revision or check its cooking status.

That endpoint enables to create a vault cooking task for a revision through a POST request or check the status of a previously created one through a GET request.

Once the cooking task has been executed, the resulting gitfast archive can be downloaded using the dedicated endpoint GET /api/1/vault/revision/(rev_id)/gitfast/raw/.

Then to import the revision in the current directory, use:

$ git init
$ zcat path/to/revision.gitfast.gz | git fast-import
$ git checkout HEAD
Parameters
  • rev_id (string) – the revision’s sha1 identifier

Query Parameters
  • email (string) – e-mail to notify when the gitfast archive is ready

Request Headers
  • Accept – the requested response content type, either application/json (default) or application/yaml

Response Headers
Response JSON Object
  • fetch_url (string) – the url from which to download the archive once it has been cooked (see GET /api/1/vault/revision/(rev_id)/gitfast/raw/)

  • obj_type (string) – the type of object to cook (directory or revision)

  • progress_message (string) – message describing the cooking task progress

  • id (number) – the cooking task id

  • status (string) – the cooking task status (new/pending/done/failed)

  • obj_id (string) – the identifier of the object to cook

Status Codes
  • 200 OK – no error

  • 400 Bad Request – an invalid revision identifier has been provided

  • 404 Not Found – requested directory did not receive any cooking request yet (in case of GET) or can not be found in the archive (in case of POST)

swh.web.api.views.vault.api_vault_fetch_revision_gitfast(request, rev_id)[source]
GET /api/1/vault/revision/(rev_id)/gitfast/raw/

Fetch the cooked gitfast archive for a revision.

See GET /api/1/vault/revision/(rev_id)/gitfast/ to get more details on directory cooking.

Parameters
  • rev_id (string) – the revision’s sha1 identifier

Response Headers
Status Codes
  • 200 OK – no error

  • 400 Bad Request – an invalid revision identifier has been provided

  • 404 Not Found – requested directory did not receive any cooking request yet (in case of GET) or can not be found in the archive (in case of POST)