--- title: Distributor node public API v0.1.0 language_tabs: - javascript: JavaScript - shell: Shell language_clients: - javascript: "" - shell: "" toc_footers: - Distributor node public API includes: [] search: true highlight_theme: darkula headingLevel: 2 ---

Distributor node public API v0.1.0

> Scroll down for code samples, example requests and responses. Distributor node public API Base URLs: * http://localhost:3334/api/v1/ Email: Support License: GPL-3.0-only

Default

## public.status > Code samples ```javascript const headers = { 'Accept':'application/json' }; fetch('http://localhost:3334/api/v1/status', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X GET http://localhost:3334/api/v1/status \ -H 'Accept: application/json' ``` `GET /status` Returns json object describing current node status. > Example responses > 200 Response ```json { "id": "string", "objectsInCache": 0, "storageLimit": 0, "storageUsed": 0, "uptime": 0, "downloadsInProgress": 0 } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[StatusResponse](#schemastatusresponse)| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## public.buckets > Code samples ```javascript const headers = { 'Accept':'application/json' }; fetch('http://localhost:3334/api/v1/buckets', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X GET http://localhost:3334/api/v1/buckets \ -H 'Accept: application/json' ``` `GET /buckets` Returns list of distributed buckets > Example responses > 200 Response ```json { "bucketIds": [ "string" ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[BucketsResponse](#schemabucketsresponse)| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## public.assetHead > Code samples ```javascript fetch('http://localhost:3334/api/v1/assets/{objectId}', { method: 'HEAD' }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X HEAD http://localhost:3334/api/v1/assets/{objectId} ``` `HEAD /assets/{objectId}` Returns asset response headers (cache status, content type and/or length, accepted ranges etc.)

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |objectId|path|string|true|Data Object ID|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Object is supported and should be send on GET request.|None| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Data object does not exist.|None| |421|[Misdirected request](https://tools.ietf.org/html/rfc7540#section-9.1.2)|Misdirected request. Data object not supported by the node.|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ### Response Headers |Status|Header|Type|Format|Description| |---|---|---|---|---| |200|X-Cache|string||Describes cache status of an object. Hit - object is already fully fetched in distributor node's cache. Pending - object is still beeing fetched from the storage node. Miss - object is neither in cache not currently beeing fetched. Fetching from storage node may be triggered.| ## public.asset > Code samples ```javascript const headers = { 'Accept':'image/*' }; fetch('http://localhost:3334/api/v1/assets/{objectId}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X GET http://localhost:3334/api/v1/assets/{objectId} \ -H 'Accept: image/*' ``` `GET /assets/{objectId}` Returns a media file.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |objectId|path|string|true|Data Object ID| > Example responses > 200 Response > 404 Response ```json { "type": "string", "message": "string" } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Full available object data sent|string| |206|[Partial Content](https://tools.ietf.org/html/rfc7233#section-4.1)|Requested partial object data sent|string| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Data object does not exist.|[ErrorResponse](#schemaerrorresponse)| |421|[Misdirected request](https://tools.ietf.org/html/rfc7540#section-9.1.2)|Misdirected request. Data object not supported.|[ErrorResponse](#schemaerrorresponse)| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ### Response Headers |Status|Header|Type|Format|Description| |---|---|---|---|---| |200|X-Cache|string||Describes cache status of an object. Hit - object is already fully fetched in distributor node's cache. Pending - object is still beeing fetched from the storage node. Miss - object is neither in cache not currently beeing fetched. Fetching from storage node may be triggered.| |200|X-Data-Source|string||Describes the source of data stream. External - the request was proxied to a storage node. Local - the data is streamed from local file.| |206|X-Cache|string||Describes cache status of an object. Hit - object is already fully fetched in distributor node's cache. Pending - object is still beeing fetched from the storage node. Miss - object is neither in cache not currently beeing fetched. Fetching from storage node may be triggered.| |206|X-Data-Source|string||Describes the source of data stream. External - the request was proxied to a storage node. Local - the data is streamed from local file.| # Schemas

ErrorResponse

```json { "type": "string", "message": "string" } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |type|string|false|none|none| |message|string|true|none|none|

StatusResponse

```json { "id": "string", "objectsInCache": 0, "storageLimit": 0, "storageUsed": 0, "uptime": 0, "downloadsInProgress": 0 } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |id|string|true|none|none| |objectsInCache|integer|true|none|none| |storageLimit|integer|true|none|none| |storageUsed|integer|true|none|none| |uptime|integer|true|none|none| |downloadsInProgress|integer|true|none|none|

BucketsResponse

```json { "bucketIds": [ "string" ] } ``` ### Properties oneOf |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |*anonymous*|object|false|none|none| |» bucketIds|[string]|true|none|none| xor |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |*anonymous*|object|false|none|none| |» allByWorkerId|integer|true|none|none| undefined