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

62 KiB
Raw Blame History

Mysql

(mysql)

Overview

Available Operations

create

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.create({
    name: "<value>",
    appName: "<value>",
    projectId: "<id>",
    databaseName: "<value>",
    databaseUser: "<value>",
    databasePassword: "<value>",
    databaseRootPassword: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlCreate } from "dokploy/funcs/mysqlCreate.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 mysqlCreate(dokploy, {
    name: "<value>",
    appName: "<value>",
    projectId: "<id>",
    databaseName: "<value>",
    databaseUser: "<value>",
    databasePassword: "<value>",
    databaseRootPassword: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlCreate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlCreateRequest ✔️ 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 */*

get

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.get({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlGet } from "dokploy/funcs/mysqlGet.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 mysqlGet(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlGet failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlOneRequest ✔️ 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 */*

start

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.start({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlStart } from "dokploy/funcs/mysqlStart.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 mysqlStart(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlStart failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlStartRequest ✔️ 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 */*

stop

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.stop({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlStop } from "dokploy/funcs/mysqlStop.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 mysqlStop(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlStop failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlStopRequest ✔️ 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 */*

saveExternalPort

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.saveExternalPort({
    mysqlId: "<id>",
    externalPort: 6359.48,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlSaveExternalPort } from "dokploy/funcs/mysqlSaveExternalPort.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 mysqlSaveExternalPort(dokploy, {
    mysqlId: "<id>",
    externalPort: 6359.48,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlSaveExternalPort failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlSaveExternalPortRequest ✔️ 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 */*

deploy

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.deploy({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlDeploy } from "dokploy/funcs/mysqlDeploy.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 mysqlDeploy(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlDeploy failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlDeployRequest ✔️ 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 */*

changeStatus

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.changeStatus({
    mysqlId: "<id>",
    applicationStatus: "error",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlChangeStatus } from "dokploy/funcs/mysqlChangeStatus.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 mysqlChangeStatus(dokploy, {
    mysqlId: "<id>",
    applicationStatus: "error",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlChangeStatus failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlChangeStatusRequest ✔️ 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 */*

reload

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.reload({
    mysqlId: "<id>",
    appName: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlReload } from "dokploy/funcs/mysqlReload.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 mysqlReload(dokploy, {
    mysqlId: "<id>",
    appName: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlReload failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlReloadRequest ✔️ 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 */*

remove

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.remove({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlRemove } from "dokploy/funcs/mysqlRemove.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 mysqlRemove(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlRemove failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlRemoveRequest ✔️ 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 */*

saveEnvironment

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.saveEnvironment({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlSaveEnvironment } from "dokploy/funcs/mysqlSaveEnvironment.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 mysqlSaveEnvironment(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlSaveEnvironment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlSaveEnvironmentRequest ✔️ 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 */*

update

Example Usage

import { Dokploy } from "dokploy";

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

async function run() {
  const result = await dokploy.mysql.update({
    mysqlId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { mysqlUpdate } from "dokploy/funcs/mysqlUpdate.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 mysqlUpdate(dokploy, {
    mysqlId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("mysqlUpdate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.MysqlUpdateRequest ✔️ 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 */*