mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 12:27:48 +00:00
452 lines
34 KiB
Markdown
452 lines
34 KiB
Markdown
# Registry
|
|
(*registry*)
|
|
|
|
## Overview
|
|
|
|
### Available Operations
|
|
|
|
* [create](#create)
|
|
* [remove](#remove)
|
|
* [update](#update)
|
|
* [getAll](#getall)
|
|
* [get](#get)
|
|
* [testRegistry](#testregistry)
|
|
|
|
## create
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="registry-create" method="post" path="/registry.create" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.create({
|
|
registryName: "<value>",
|
|
username: "Edward97",
|
|
password: "Dgmo4uBNDUDA9K5",
|
|
registryUrl: "https://cute-declaration.name",
|
|
registryType: "cloud",
|
|
imagePrefix: "<value>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryCreate } from "dokploy/funcs/registryCreate.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 registryCreate(dokploy, {
|
|
registryName: "<value>",
|
|
username: "Edward97",
|
|
password: "Dgmo4uBNDUDA9K5",
|
|
registryUrl: "https://cute-declaration.name",
|
|
registryType: "cloud",
|
|
imagePrefix: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryCreate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RegistryCreateRequest](../../models/operations/registrycreaterequest.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="registry-remove" method="post" path="/registry.remove" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.remove({
|
|
registryId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryRemove } from "dokploy/funcs/registryRemove.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 registryRemove(dokploy, {
|
|
registryId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryRemove failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RegistryRemoveRequest](../../models/operations/registryremoverequest.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="registry-update" method="post" path="/registry.update" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.update({
|
|
registryId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryUpdate } from "dokploy/funcs/registryUpdate.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 registryUpdate(dokploy, {
|
|
registryId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryUpdate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RegistryUpdateRequest](../../models/operations/registryupdaterequest.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 | \*/\* |
|
|
|
|
## getAll
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="registry-all" method="get" path="/registry.all" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.getAll();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryGetAll } from "dokploy/funcs/registryGetAll.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 registryGetAll(dokploy);
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryGetAll failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `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="registry-one" method="get" path="/registry.one" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.get({
|
|
registryId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryGet } from "dokploy/funcs/registryGet.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 registryGet(dokploy, {
|
|
registryId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryGet failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RegistryOneRequest](../../models/operations/registryonerequest.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 | \*/\* |
|
|
|
|
## testRegistry
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="registry-testRegistry" method="post" path="/registry.testRegistry" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.registry.testRegistry({
|
|
registryName: "<value>",
|
|
username: "Amani_Kohler",
|
|
password: "HbHSp2hcDiXugz1",
|
|
registryUrl: "https://biodegradable-priesthood.info/",
|
|
registryType: "cloud",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { registryTestRegistry } from "dokploy/funcs/registryTestRegistry.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 registryTestRegistry(dokploy, {
|
|
registryName: "<value>",
|
|
username: "Amani_Kohler",
|
|
password: "HbHSp2hcDiXugz1",
|
|
registryUrl: "https://biodegradable-priesthood.info/",
|
|
registryType: "cloud",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("registryTestRegistry failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.RegistryTestRegistryRequest](../../models/operations/registrytestregistryrequest.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 | \*/\* | |