Skip to content

Latest commit

 

History

History
375 lines (271 loc) · 7.84 KB

File metadata and controls

375 lines (271 loc) · 7.84 KB
title language_tabs language_clients toc_footers includes search highlight_theme headingLevel
Distributor node operator API v0.1.0
javascript
JavaScript
shell
Shell
javascript
shell
true
darkula
2

Distributor node operator API v0.1.0

Scroll down for code samples, example requests and responses.

Distributor node operator API

Base URLs:

Email: Support License: GPL-3.0-only

undefined

Default

operator.stopApi

Code samples

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);
});
# 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 OK None
401 Unauthorized Not authorized None
409 Conflict Already stopped None
500 Internal Server Error Unexpected server error None
To perform this operation, you must be authenticated by means of one of the following methods: OperatorAuth

operator.startApi

Code samples

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);
});
# 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 OK None
401 Unauthorized Not authorized None
409 Conflict Already started None
500 Internal Server Error Unexpected server error None
To perform this operation, you must be authenticated by means of one of the following methods: OperatorAuth

operator.shutdown

Code samples

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);
});
# 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 OK None
401 Unauthorized Not authorized None
409 Conflict Already shutting down None
500 Internal Server Error Unexpected server error None
To perform this operation, you must be authenticated by means of one of the following methods: OperatorAuth

operator.setWorker

Code samples

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);
});
# 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

{
  "workerId": 0
}

Parameters

Name In Type Required Description
body body SetWorkerOperation false none

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Not authorized None
500 Internal Server Error Unexpected server error None
To perform this operation, you must be authenticated by means of one of the following methods: OperatorAuth

operator.setBuckets

Code samples

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);
});
# 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

{
  "buckets": [
    "string"
  ]
}

Parameters

Name In Type Required Description
body body SetBucketsOperation false none

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Not authorized None
500 Internal Server Error Unexpected server error None
To perform this operation, you must be authenticated by means of one of the following methods: OperatorAuth

Schemas

SetWorkerOperation

{
  "workerId": 0
}

Properties

Name Type Required Restrictions Description
workerId integer true none none

SetBucketsOperation

{
  "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