Files
Coolify-TypeScript-SDK/docs/sdks/databases
2024-11-19 21:24:42 -06:00
..
2024-11-19 21:24:42 -06:00

Databases

(databases)

Overview

Databases

Available Operations

list

List all databases.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.list();

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesList } from "coolify/funcs/databasesList.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesList(coolify);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<string>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

get

Get database by UUID.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.get({
    uuid: "74d5589b-49ac-48d8-81bc-d384b1e22591",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesGet } from "coolify/funcs/databasesGet.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesGet(coolify, {
    uuid: "74d5589b-49ac-48d8-81bc-d384b1e22591",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<string>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

delete

Delete database by UUID.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.delete({
    uuid: "97d3b16d-4e3e-43de-90da-8825514f9704",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesDelete } from "coolify/funcs/databasesDelete.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesDelete(coolify, {
    uuid: "97d3b16d-4e3e-43de-90da-8825514f9704",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.DeleteDatabaseByUuidResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

update

Update database by UUID.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.update({
    uuid: "8ce069c2-b9ca-4606-a156-f18931ac7716",
    requestBody: {},
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesUpdate } from "coolify/funcs/databasesUpdate.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesUpdate(coolify, {
    uuid: "8ce069c2-b9ca-4606-a156-f18931ac7716",
    requestBody: {},
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.UpdateDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createPostgresql

Create a new PostgreSQL database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createPostgresql({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreatePostgresql } from "coolify/funcs/databasesCreatePostgresql.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreatePostgresql(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabasePostgresqlRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createClickhouse

Create a new Clickhouse database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createClickhouse({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateClickhouse } from "coolify/funcs/databasesCreateClickhouse.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateClickhouse(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseClickhouseRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createDragonfly

Create a new DragonFly database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createDragonfly({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateDragonfly } from "coolify/funcs/databasesCreateDragonfly.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateDragonfly(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseDragonflyRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createRedis

Create a new Redis database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createRedis({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateRedis } from "coolify/funcs/databasesCreateRedis.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateRedis(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseRedisRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createKeydb

Create a new KeyDB database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createKeydb({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateKeydb } from "coolify/funcs/databasesCreateKeydb.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateKeydb(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseKeydbRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createMariadb

Create a new MariaDB database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createMariadb({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateMariadb } from "coolify/funcs/databasesCreateMariadb.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateMariadb(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseMariadbRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createMysql

Create a new MySQL database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createMysql({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateMysql } from "coolify/funcs/databasesCreateMysql.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateMysql(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseMysqlRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

createMongodb

Create a new MongoDB database.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  await coolify.databases.createMongodb({
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesCreateMongodb } from "coolify/funcs/databasesCreateMongodb.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesCreateMongodb(coolify, {
    serverUuid: "<id>",
    projectUuid: "<id>",
    environmentName: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.CreateDatabaseMongodbRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

start

Start database. Post request is also accepted.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.start({
    uuid: "f40511cd-7fe9-4acb-ba62-b4ed38ad7597",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesStart } from "coolify/funcs/databasesStart.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesStart(coolify, {
    uuid: "f40511cd-7fe9-4acb-ba62-b4ed38ad7597",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.StartDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.StartDatabaseByUuidResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

stop

Stop database. Post request is also accepted.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.stop({
    uuid: "3833eaa9-ac55-4488-907b-122d1dc43961",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesStop } from "coolify/funcs/databasesStop.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesStop(coolify, {
    uuid: "3833eaa9-ac55-4488-907b-122d1dc43961",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.StopDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.StopDatabaseByUuidResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

restart

Restart database. Post request is also accepted.

Example Usage

import { Coolify } from "coolify";

const coolify = new Coolify({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await coolify.databases.restart({
    uuid: "87eeb84f-bfe7-4d69-be6c-c4602521ac1a",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { CoolifyCore } from "coolify/core.js";
import { databasesRestart } from "coolify/funcs/databasesRestart.js";

// Use `CoolifyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const coolify = new CoolifyCore({
  bearerAuth: process.env["COOLIFY_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await databasesRestart(coolify, {
    uuid: "87eeb84f-bfe7-4d69-be6c-c4602521ac1a",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RestartDatabaseByUuidRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.RestartDatabaseByUuidResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
errors.Unauthenticated 401, 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*