Skip to main content

Blueprints

A blueprint is a template that generates the pipeline configuration a node runs in a network. It uses Go template syntax, and placeholders such as the node's IP address and carriers are filled in for each node. Every network uses three blueprints: one for the relay node, one the relay runs for every client, and one for every client node. The built-in blueprints are read-only; create your own to change how networks carry traffic. Blueprints are stored on the connected node that has networks enabled, and calls wait until that node is connected.

Get blueprint​

Get a single blueprint.

GET/v1/blueprints/{id}
Path parameters
  • idstring

    The ID of the blueprint to fetch.

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

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

const response = await client.blueprints.getBlueprint({
id: "3f2b1c9e-8d4a-4f6b-9c2e-1a7d5e8b0c4f"
});
Response
  • idstring

    The ID of the blueprint.

  • blueprintBlueprint

    The blueprint.

Get blueprints​

Get all blueprints, including the built-in read-only ones.

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

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

const response = await client.blueprints.getBlueprints();
Response
  • blueprintsGetBlueprintResponse[]

    The blueprints with their IDs.

Create blueprint​

Create a blueprint and return it.

POST/v1/blueprints
Request body
  • namestring

    The name of the blueprint. Example: UDP relay

  • templatestring

    The template that renders a pipeline configuration. Placeholders such as {{ .node.ip }} are filled in with network and node parameters.

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

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

const response = await client.blueprints.createBlueprint({
blueprint: {
name: "UDP relay",
template: "<blueprint template>"
}
});
Response
  • idstring

    The generated ID of the blueprint.

  • blueprintBlueprint

    The created blueprint.

Update blueprint​

Replace a blueprint and return the updated blueprint. Networks using the blueprint have their pipelines regenerated. Fails with a permission error for read-only blueprints.

PUT/v1/blueprints/{id}
Path parameters
  • idstring

    The ID of the blueprint to update.

Request body
  • namestring

    The name of the blueprint. Example: UDP relay

  • templatestring

    The template that renders a pipeline configuration. Placeholders such as {{ .node.ip }} are filled in with network and node parameters.

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

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

const response = await client.blueprints.updateBlueprint({
id: "3f2b1c9e-8d4a-4f6b-9c2e-1a7d5e8b0c4f",
blueprint: {
name: "UDP relay",
template: "<blueprint template>"
}
});
Response
  • idstring

    The ID of the blueprint.

  • blueprintBlueprint

    The blueprint after the update.

Delete blueprint​

Delete a blueprint. Fails with a permission error for read-only blueprints.

DELETE/v1/blueprints/{id}
Path parameters
  • idstring

    The ID of the blueprint to delete.

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

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

await client.blueprints.deleteBlueprint({
id: "3f2b1c9e-8d4a-4f6b-9c2e-1a7d5e8b0c4f"
});
Response

No fields.