Skip to main content

Config

Settings stored in the configuration of a node. Use this service to read and change them on any node, such as the carriers a node uses by default when it joins a network.

Get default network carriers​

Get the default network carriers of a node. These are the carriers the node receives every time it joins a new network. Returns an empty list when none are configured.

GET/v1/nodes/{node_id}/default-network-carriers
Path parameters
  • node_idstring

    Id of the node to read the default network carriers from.

Example
import { NanopingClient } from "@nanoping/api";

const client = new NanopingClient({ baseUrl: "http://127.0.0.1:10565" });

const response = await client.config.getDefaultNetworkCarriers({
nodeId: "3f2b1c9e-8d4a-4f6b-9c2e-1a7d5e8b0c4f"
});
Response
  • carriersDefaultNetworkCarrier[]

    The default network carriers of the node. Empty when none are configured.

Set default network carriers​

Replace the default network carriers of a node. The new carriers apply to networks the node joins afterwards.

PUT/v1/nodes/{node_id}/default-network-carriers
Path parameters
  • node_idstring

    Id of the node to set the default network carriers on.

Request body
  • carriersDefaultNetworkCarrier[]

    The default network carriers.

Example
import { NanopingClient } from "@nanoping/api";

const client = new NanopingClient({ baseUrl: "http://127.0.0.1:10565" });

await client.config.setDefaultNetworkCarriers({
nodeId: "3f2b1c9e-8d4a-4f6b-9c2e-1a7d5e8b0c4f",
carriers: {
carriers: [
{
address: {
ip: "192.168.1.20",
port: 3425,
externalIp: "203.0.113.10"
},
interface: "eth0",
bandwidthPriority: 100
}
]
}
});
Response

No fields.