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

Distributor node operator API v0.1.0

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

Default

## operator.stopApi > Code samples ```javascript const headers = { 'Authorization':'Bearer {access-token}' }; fetch('http://localhost:3335/api/v1/stop-api', { method: 'POST', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X POST http://localhost:3335/api/v1/stop-api \ -H 'Authorization: Bearer {access-token}' ``` `POST /stop-api` Turns off the public api.

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Not authorized|None| |409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Already stopped|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## operator.startApi > Code samples ```javascript const headers = { 'Authorization':'Bearer {access-token}' }; fetch('http://localhost:3335/api/v1/start-api', { method: 'POST', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X POST http://localhost:3335/api/v1/start-api \ -H 'Authorization: Bearer {access-token}' ``` `POST /start-api` Turns on the public api.

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Not authorized|None| |409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Already started|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## operator.shutdown > Code samples ```javascript const headers = { 'Authorization':'Bearer {access-token}' }; fetch('http://localhost:3335/api/v1/shutdown', { method: 'POST', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X POST http://localhost:3335/api/v1/shutdown \ -H 'Authorization: Bearer {access-token}' ``` `POST /shutdown` Shuts down the node.

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Not authorized|None| |409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Already shutting down|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## operator.setWorker > Code samples ```javascript const inputBody = '{ "workerId": 0 }'; const headers = { 'Content-Type':'application/json', 'Authorization':'Bearer {access-token}' }; fetch('http://localhost:3335/api/v1/set-worker', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X POST http://localhost:3335/api/v1/set-worker \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {access-token}' ``` `POST /set-worker` Updates the operator worker id. > Body parameter ```json { "workerId": 0 } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |body|body|[SetWorkerOperation](#schemasetworkeroperation)|false|none|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Not authorized|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| ## operator.setBuckets > Code samples ```javascript const inputBody = '{ "buckets": [ "string" ] }'; const headers = { 'Content-Type':'application/json', 'Authorization':'Bearer {access-token}' }; fetch('http://localhost:3335/api/v1/set-buckets', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); }); ``` ```shell # You can also use wget curl -X POST http://localhost:3335/api/v1/set-buckets \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {access-token}' ``` `POST /set-buckets` Updates buckets supported by the node. > Body parameter ```json { "buckets": [ "string" ] } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |body|body|[SetBucketsOperation](#schemasetbucketsoperation)|false|none|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Not authorized|None| |500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Unexpected server error|None| # Schemas

SetWorkerOperation

```json { "workerId": 0 } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |workerId|integer|true|none|none|

SetBucketsOperation

```json { "buckets": [ "string" ] } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |buckets|[string]|false|none|Set of bucket ids to be distributed by the node. If not provided - all buckets assigned to currently configured worker will be distributed.| undefined