Files
Dokploy-ts-sdk/docs/sdks/cluster/README.md
2025-09-26 02:33:10 +00:00

20 KiB
Raw Blame History

Cluster

(cluster)

Overview

Available Operations

getNodes

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.cluster.getNodes();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { clusterGetNodes } from "dokploy/funcs/clusterGetNodes.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await clusterGetNodes(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clusterGetNodes failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

removeWorker

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.cluster.removeWorker({
    nodeId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { clusterRemoveWorker } from "dokploy/funcs/clusterRemoveWorker.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await clusterRemoveWorker(dokploy, {
    nodeId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clusterRemoveWorker failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ClusterRemoveWorkerRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

addWorker

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.cluster.addWorker();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { clusterAddWorker } from "dokploy/funcs/clusterAddWorker.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await clusterAddWorker(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clusterAddWorker failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

addManager

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.cluster.addManager();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { clusterAddManager } from "dokploy/funcs/clusterAddManager.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await clusterAddManager(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clusterAddManager failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*