title: Distributor node operator API v0.1.0 language_tabs:
Scroll down for code samples, example requests and responses.
Distributor node operator API
Base URLs:
Email: Support License: GPL-3.0-only
undefined
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.
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 |
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.
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 |
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.
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 |
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
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SetWorkerOperation | false | none |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Not authorized | None |
500 | Internal Server Error | Unexpected server error | None |
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"
]
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SetBucketsOperation | false | none |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Not authorized | None |
500 | Internal Server Error | Unexpected server error | None |
{
"workerId": 0
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
workerId | integer | true | none | none |
{
"buckets": [
"string"
]
}
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