mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
813 lines
62 KiB
Markdown
813 lines
62 KiB
Markdown
# Mongo
|
|
(*mongo*)
|
|
|
|
## Overview
|
|
|
|
### Available Operations
|
|
|
|
* [create](#create)
|
|
* [get](#get)
|
|
* [start](#start)
|
|
* [stop](#stop)
|
|
* [saveExternalPort](#saveexternalport)
|
|
* [deploy](#deploy)
|
|
* [changeStatus](#changestatus)
|
|
* [reload](#reload)
|
|
* [remove](#remove)
|
|
* [saveEnvironment](#saveenvironment)
|
|
* [update](#update)
|
|
|
|
## create
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-create" method="post" path="/mongo.create" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.create({
|
|
name: "<value>",
|
|
appName: "<value>",
|
|
projectId: "<id>",
|
|
databaseUser: "<value>",
|
|
databasePassword: "<value>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoCreate } from "dokploy/funcs/mongoCreate.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 mongoCreate(dokploy, {
|
|
name: "<value>",
|
|
appName: "<value>",
|
|
projectId: "<id>",
|
|
databaseUser: "<value>",
|
|
databasePassword: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoCreate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoCreateRequest](../../models/operations/mongocreaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## get
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-one" method="get" path="/mongo.one" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.get({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoGet } from "dokploy/funcs/mongoGet.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 mongoGet(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoGet failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoOneRequest](../../models/operations/mongoonerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## start
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-start" method="post" path="/mongo.start" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.start({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoStart } from "dokploy/funcs/mongoStart.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 mongoStart(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoStart failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoStartRequest](../../models/operations/mongostartrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## stop
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-stop" method="post" path="/mongo.stop" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.stop({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoStop } from "dokploy/funcs/mongoStop.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 mongoStop(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoStop failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoStopRequest](../../models/operations/mongostoprequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## saveExternalPort
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-saveExternalPort" method="post" path="/mongo.saveExternalPort" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.saveExternalPort({
|
|
mongoId: "<id>",
|
|
externalPort: null,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoSaveExternalPort } from "dokploy/funcs/mongoSaveExternalPort.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 mongoSaveExternalPort(dokploy, {
|
|
mongoId: "<id>",
|
|
externalPort: null,
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoSaveExternalPort failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoSaveExternalPortRequest](../../models/operations/mongosaveexternalportrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## deploy
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-deploy" method="post" path="/mongo.deploy" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.deploy({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoDeploy } from "dokploy/funcs/mongoDeploy.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 mongoDeploy(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoDeploy failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoDeployRequest](../../models/operations/mongodeployrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## changeStatus
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-changeStatus" method="post" path="/mongo.changeStatus" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.changeStatus({
|
|
mongoId: "<id>",
|
|
applicationStatus: "error",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoChangeStatus } from "dokploy/funcs/mongoChangeStatus.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 mongoChangeStatus(dokploy, {
|
|
mongoId: "<id>",
|
|
applicationStatus: "error",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoChangeStatus failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoChangeStatusRequest](../../models/operations/mongochangestatusrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## reload
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-reload" method="post" path="/mongo.reload" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.reload({
|
|
mongoId: "<id>",
|
|
appName: "<value>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoReload } from "dokploy/funcs/mongoReload.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 mongoReload(dokploy, {
|
|
mongoId: "<id>",
|
|
appName: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoReload failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoReloadRequest](../../models/operations/mongoreloadrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## remove
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-remove" method="post" path="/mongo.remove" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.remove({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoRemove } from "dokploy/funcs/mongoRemove.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 mongoRemove(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoRemove failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoRemoveRequest](../../models/operations/mongoremoverequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## saveEnvironment
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-saveEnvironment" method="post" path="/mongo.saveEnvironment" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.saveEnvironment({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoSaveEnvironment } from "dokploy/funcs/mongoSaveEnvironment.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 mongoSaveEnvironment(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoSaveEnvironment failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoSaveEnvironmentRequest](../../models/operations/mongosaveenvironmentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
|
|
|
## update
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="mongo-update" method="post" path="/mongo.update" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.mongo.update({
|
|
mongoId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { mongoUpdate } from "dokploy/funcs/mongoUpdate.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 mongoUpdate(dokploy, {
|
|
mongoId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("mongoUpdate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.MongoUpdateRequest](../../models/operations/mongoupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
|
|
### Response
|
|
|
|
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
|
|
|
### Errors
|
|
|
|
| Error Type | Status Code | Content Type |
|
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
| errors.DokployDefaultError | 4XX, 5XX | \*/\* | |