mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
34 KiB
34 KiB
Destination
(destination)
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.destination.create({
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationCreate } from "dokploy/funcs/destinationCreate.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 destinationCreate(dokploy, {
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationCreate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DestinationCreateRequest | ✔️ | 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 | */* |
testConnection
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.destination.testConnection({
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationTestConnection } from "dokploy/funcs/destinationTestConnection.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 destinationTestConnection(dokploy, {
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationTestConnection failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DestinationTestConnectionRequest | ✔️ | 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 | */* |
getOne
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.destination.getOne({
destinationId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationGetOne } from "dokploy/funcs/destinationGetOne.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 destinationGetOne(dokploy, {
destinationId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationGetOne failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DestinationOneRequest | ✔️ | 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.destination.get();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationGet } from "dokploy/funcs/destinationGet.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 destinationGet(dokploy);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationGet 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 | */* |
remove
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.destination.remove({
destinationId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationRemove } from "dokploy/funcs/destinationRemove.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 destinationRemove(dokploy, {
destinationId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationRemove failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DestinationRemoveRequest | ✔️ | 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.destination.update({
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
destinationId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { destinationUpdate } from "dokploy/funcs/destinationUpdate.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 destinationUpdate(dokploy, {
name: "<value>",
accessKey: "<value>",
bucket: "<value>",
region: "<value>",
endpoint: "<value>",
secretAccessKey: "<value>",
destinationId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("destinationUpdate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DestinationUpdateRequest | ✔️ | 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 | */* |