Sodarcache REST API Documentation

This document contains the HTTP REST API documentation for the sodarcache app.

Sodarcache REST API Versioning

Media Type

application/vnd.bihealth.sodar-core.sodarcache+json

Current Version

1.0

Accepted Versions

1.0

Header Example

Accept: application/vnd.bihealth.sodar-core.sodarcache+json; version=x.y

Sodarcache REST API Views

class sodarcache.views_api.CacheItemRetrieveAPIView(**kwargs)[source]

Retrieve a cache item along with its data. Returns 404 if cache item is not set.

URL: /cache/api/retrieve/{Project.sodar_uuid}/{app_name}/{item_name}

Methods: GET

Returns:

  • project: Project UUID (string)

  • app_name: Name of app to which the item belongs (string)

  • name: Item name (string)

  • data: Item data (JSON)

  • date_modified: Item modification datetime (YYYY-MM-DDThh:mm:ssZ)

  • user: User who created the item (SODARUserSerializer dict or None)

class sodarcache.views_api.CacheItemDateRetrieveAPIView(**kwargs)[source]

Retrieve timestamp of the last update to a cache item. Returns 404 if cache item is not set.

URL: /cache/api/retrieve/date/{Project.sodar_uuid}/{app_name}/{item_name}

Methods: GET

Returns:

  • update_time: Update timestamp in seconds since epoch (integer)

class sodarcache.views_api.CacheItemSetAPIView(**kwargs)[source]

Create or update a cache item. Replaces an existing item with the same project, app name and item name if previously set. Returns 200 on both a successful creation and update.

URL: /cache/api/set/{Project.sodar_uuid}/{app_name}/{item_name}

Methods: POST

Parameters:

  • data: Full item data to be set (JSON)