Search the docs
Menu
Updated Edit on GitHub

Console: scaling

Copy as Markdown

These routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.

Relay servers and scaling rules.

GET /api/panel/scaling/capacity

Sum up what the relay inventory is set up for.

max_sessions and max_bandwidth_bps are the sums over the entries, 50 and 100000000 (100 Mbit/s) when they sum to nothing. max_devices is 500 plus 200 for each entry.

Needs server.config. neodesk scaling capacity calls it.

200: Done (application/json)

Field Type Required
data object yes
data.relay_count integer yes
data.max_devices integer yes
data.max_sessions number yes
data.max_bandwidth_bps number yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

GET /api/panel/scaling/relays

List the relay inventory.

Needs server.config. neodesk scaling relays calls it.

200: Done (application/json)

Field Type Required
data array of ScalingRelay yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

POST /api/panel/scaling/relays

Add a relay to the inventory.

The inventory holds 100 relays, and an address can be in it once.

Needs server.config. neodesk scaling relay-create calls it.

Request body, application/json:

Field Type Required What it is
name string yes Letters, digits, white space and . _ - # / ( ); at most 80 characters
address string yes host:port, like relay.example.com:21117
location string at most 80 characters
max_sessions integer or string default 50, at least 1, at most 100000
max_bandwidth_bps integer or string default 100, at least 1, at most 1000000

201: The entry as stored (application/json)

Field Type Required
data ScalingRelay yes
Error When
400 A field is not valid, or the inventory is full
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
409 A relay with this address already exists

GET /api/panel/scaling/relays/{nodeId}

Show a relay entry.

Needs server.config. neodesk scaling relay calls it.

Parameter In Type Required What it is
nodeId path string yes The relay entry's ID

200: Done (application/json)

Field Type Required
data ScalingRelay yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such relay entry

PUT /api/panel/scaling/relays/{nodeId}

Replace a relay entry.

Replaces the fields of the create; a field left out takes its default.

Needs server.config. neodesk scaling relay-set calls it.

Parameter In Type Required What it is
nodeId path string yes The relay entry's ID

Request body, application/json:

Field Type Required What it is
name string yes Letters, digits, white space and . _ - # / ( ); at most 80 characters
address string yes host:port, like relay.example.com:21117
location string at most 80 characters
max_sessions integer or string default 50, at least 1, at most 100000
max_bandwidth_bps integer or string default 100, at least 1, at most 1000000

200: The entry as stored (application/json)

Field Type Required
data ScalingRelay yes
Error When
400 A field is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such relay entry
409 Another relay already uses this address

DELETE /api/panel/scaling/relays/{nodeId}

Remove a relay from the inventory.

Needs server.config. neodesk scaling relay-delete calls it. It cannot be undone.

Parameter In Type Required What it is
nodeId path string yes The relay entry's ID

200: Done (application/json)

Field Type Required
ok true yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such relay entry

GET /api/panel/scaling/relays/{nodeId}/health

Show the health of a relay entry.

The console has no live data of relays: data is null for every relay, with a note.

Needs server.config. neodesk scaling relay-health calls it.

Parameter In Type Required What it is
nodeId path string yes The relay entry's ID

200: Done (application/json)

Field Type Required
data null yes
note string
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such relay entry

GET /api/panel/scaling/relays/{nodeId}/metrics

Show the metrics of a relay entry.

The console has no live data of relays: data is an empty list for every relay, with a note.

Needs server.config. neodesk scaling relay-metrics calls it.

Parameter In Type Required What it is
nodeId path string yes The relay entry's ID

200: Done (application/json)

Field Type Required What it is
data array yes at most 0 items
note string
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such relay entry

GET /api/panel/scaling/rules

List the relay assignment rules.

Needs server.config. neodesk scaling rules calls it.

200: Done (application/json)

Field Type Required
data array of ScalingRule yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

POST /api/panel/scaling/rules

Add a relay assignment rule.

The list holds 200 rules.

Needs server.config. neodesk scaling rule-create calls it.

Request body, application/json:

Field Type Required What it is
name string yes at most 80 characters
match_type string, one of subnet, group, tag, country, device_id yes
match_value string yes at most 200 characters
target_relay string at most 80 characters
fallback string default "master", at most 80 characters
priority integer or string default 10, at least 0, at most 1000
enabled boolean Only false turns the rule off; on a change, a body without it keeps the state

201: The rule as stored (application/json)

Field Type Required
data ScalingRule yes
Error When
400 A field is not valid, or the list is full
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

PUT /api/panel/scaling/rules/{ruleId}

Replace a relay assignment rule.

Replaces the fields of the create; a field left out takes its default.

Needs server.config. neodesk scaling rule-set calls it.

Parameter In Type Required What it is
ruleId path string yes The rule's ID

Request body, application/json:

Field Type Required What it is
name string yes at most 80 characters
match_type string, one of subnet, group, tag, country, device_id yes
match_value string yes at most 200 characters
target_relay string at most 80 characters
fallback string default "master", at most 80 characters
priority integer or string default 10, at least 0, at most 1000
enabled boolean Only false turns the rule off; on a change, a body without it keeps the state

200: The rule as stored (application/json)

Field Type Required
data ScalingRule yes
Error When
400 A field is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such rule

DELETE /api/panel/scaling/rules/{ruleId}

Delete a relay assignment rule.

Needs server.config. neodesk scaling rule-delete calls it. It cannot be undone.

Parameter In Type Required What it is
ruleId path string yes The rule's ID

200: Done (application/json)

Field Type Required
ok true yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such rule

Type to search pages, sections, commands and settings.