mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-07 04:19:39 +00:00
initial commit
This commit is contained in:
815
docs/sdks/postgres/README.md
Normal file
815
docs/sdks/postgres/README.md
Normal file
@@ -0,0 +1,815 @@
|
||||
# Postgres
|
||||
(*postgres*)
|
||||
|
||||
## Overview
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [create](#create)
|
||||
* [get](#get)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
* [saveExternalPort](#saveexternalport)
|
||||
* [deploy](#deploy)
|
||||
* [changeStatus](#changestatus)
|
||||
* [remove](#remove)
|
||||
* [saveEnvironment](#saveenvironment)
|
||||
* [reload](#reload)
|
||||
* [update](#update)
|
||||
|
||||
## create
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="postgres-create" method="post" path="/postgres.create" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.create({
|
||||
name: "<value>",
|
||||
appName: "<value>",
|
||||
databaseName: "<value>",
|
||||
databaseUser: "<value>",
|
||||
databasePassword: "<value>",
|
||||
projectId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresCreate } from "dokploy/funcs/postgresCreate.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 postgresCreate(dokploy, {
|
||||
name: "<value>",
|
||||
appName: "<value>",
|
||||
databaseName: "<value>",
|
||||
databaseUser: "<value>",
|
||||
databasePassword: "<value>",
|
||||
projectId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresCreate failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresCreateRequest](../../models/operations/postgrescreaterequest.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="postgres-one" method="get" path="/postgres.one" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.get({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresGet } from "dokploy/funcs/postgresGet.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 postgresGet(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresGet failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresOneRequest](../../models/operations/postgresonerequest.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="postgres-start" method="post" path="/postgres.start" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.start({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresStart } from "dokploy/funcs/postgresStart.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 postgresStart(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresStart failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresStartRequest](../../models/operations/postgresstartrequest.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="postgres-stop" method="post" path="/postgres.stop" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.stop({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresStop } from "dokploy/funcs/postgresStop.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 postgresStop(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresStop failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresStopRequest](../../models/operations/postgresstoprequest.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="postgres-saveExternalPort" method="post" path="/postgres.saveExternalPort" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.saveExternalPort({
|
||||
postgresId: "<id>",
|
||||
externalPort: 3135.23,
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresSaveExternalPort } from "dokploy/funcs/postgresSaveExternalPort.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 postgresSaveExternalPort(dokploy, {
|
||||
postgresId: "<id>",
|
||||
externalPort: 3135.23,
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresSaveExternalPort failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresSaveExternalPortRequest](../../models/operations/postgressaveexternalportrequest.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="postgres-deploy" method="post" path="/postgres.deploy" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.deploy({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresDeploy } from "dokploy/funcs/postgresDeploy.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 postgresDeploy(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresDeploy failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresDeployRequest](../../models/operations/postgresdeployrequest.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="postgres-changeStatus" method="post" path="/postgres.changeStatus" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.changeStatus({
|
||||
postgresId: "<id>",
|
||||
applicationStatus: "idle",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresChangeStatus } from "dokploy/funcs/postgresChangeStatus.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 postgresChangeStatus(dokploy, {
|
||||
postgresId: "<id>",
|
||||
applicationStatus: "idle",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresChangeStatus failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresChangeStatusRequest](../../models/operations/postgreschangestatusrequest.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="postgres-remove" method="post" path="/postgres.remove" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.remove({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresRemove } from "dokploy/funcs/postgresRemove.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 postgresRemove(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresRemove failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresRemoveRequest](../../models/operations/postgresremoverequest.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="postgres-saveEnvironment" method="post" path="/postgres.saveEnvironment" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.saveEnvironment({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresSaveEnvironment } from "dokploy/funcs/postgresSaveEnvironment.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 postgresSaveEnvironment(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresSaveEnvironment failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresSaveEnvironmentRequest](../../models/operations/postgressaveenvironmentrequest.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="postgres-reload" method="post" path="/postgres.reload" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.reload({
|
||||
postgresId: "<id>",
|
||||
appName: "<value>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresReload } from "dokploy/funcs/postgresReload.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 postgresReload(dokploy, {
|
||||
postgresId: "<id>",
|
||||
appName: "<value>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresReload failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresReloadRequest](../../models/operations/postgresreloadrequest.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="postgres-update" method="post" path="/postgres.update" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.postgres.update({
|
||||
postgresId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { postgresUpdate } from "dokploy/funcs/postgresUpdate.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 postgresUpdate(dokploy, {
|
||||
postgresId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("postgresUpdate failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.PostgresUpdateRequest](../../models/operations/postgresupdaterequest.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 | \*/\* |
|
||||
Reference in New Issue
Block a user