mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
46 KiB
46 KiB
Backup
(backup)
Overview
Available Operations
- create
- get
- update
- remove
- manualBackupPostgres
- manualBackupMysql
- manualBackupMariadb
- manualBackupMongo
create
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.backup.create({
schedule: "<value>",
prefix: "<value>",
destinationId: "<id>",
database: "<value>",
databaseType: "mysql",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupCreate } from "dokploy/funcs/backupCreate.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 backupCreate(dokploy, {
schedule: "<value>",
prefix: "<value>",
destinationId: "<id>",
database: "<value>",
databaseType: "mysql",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupCreate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupCreateRequest | ✔️ | 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.backup.get({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupGet } from "dokploy/funcs/backupGet.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 backupGet(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupGet failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupOneRequest | ✔️ | 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.backup.update({
schedule: "<value>",
prefix: "<value>",
backupId: "<id>",
destinationId: "<id>",
database: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupUpdate } from "dokploy/funcs/backupUpdate.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 backupUpdate(dokploy, {
schedule: "<value>",
prefix: "<value>",
backupId: "<id>",
destinationId: "<id>",
database: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupUpdate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupUpdateRequest | ✔️ | 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.backup.remove({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupRemove } from "dokploy/funcs/backupRemove.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 backupRemove(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupRemove failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupRemoveRequest | ✔️ | 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 | */* |
manualBackupPostgres
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.backup.manualBackupPostgres({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupManualBackupPostgres } from "dokploy/funcs/backupManualBackupPostgres.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 backupManualBackupPostgres(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupManualBackupPostgres failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupManualBackupPostgresRequest | ✔️ | 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 | */* |
manualBackupMysql
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.backup.manualBackupMysql({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupManualBackupMysql } from "dokploy/funcs/backupManualBackupMysql.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 backupManualBackupMysql(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupManualBackupMysql failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupManualBackupMySqlRequest | ✔️ | 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 | */* |
manualBackupMariadb
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.backup.manualBackupMariadb({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupManualBackupMariadb } from "dokploy/funcs/backupManualBackupMariadb.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 backupManualBackupMariadb(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupManualBackupMariadb failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupManualBackupMariadbRequest | ✔️ | 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 | */* |
manualBackupMongo
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.backup.manualBackupMongo({
backupId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { backupManualBackupMongo } from "dokploy/funcs/backupManualBackupMongo.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 backupManualBackupMongo(dokploy, {
backupId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("backupManualBackupMongo failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.BackupManualBackupMongoRequest | ✔️ | 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 | */* |