import { Client } from ".."; import Backups from "./Backups"; import Maintenances from "./Maintenances"; import { BackupRestoration } from "../models/regional/backups"; import { Database, DashboardDatabase, ApiDatabase, CreateParams, DatabaseUpdateParams, DatabasePlan, DatabaseMetrics, DatabaseInstanceStatus, DatabasePitrRestoreResponse, LogsArchivesResult, DatabaseType, DatabaseTypeVersion, FirewallRule, FirewallManagedRange, FirewallRuleCreateParams, FirewallRuleUpdateParams, DbOperation, DatabaseUser, DatabaseUserCreateParams, DatabaseFeature } from "../models/regional/databases"; import { OrganizationScopedParams } from "../params/regional/organization"; /** * Databases API Client */ export default class Databases { /** Scalingo API Client */ _client: Client; constructor(client: Client); /** * Get all databases for the current user * @param opts Optional query parameters * @param opts.dashboard Whether to return dashboard database information * @param opts.organization_id ID of the organization to scope the results to * @return Promise that when resolved returns a Database array. */ all(opts?: { dashboard?: boolean; } & OrganizationScopedParams): Promise; /** * Get details for a specific database * @param id ID of the database * @return Promise that when resolved returns the requested database. */ show(id: string): Promise; /** * Get detailed information for a specific database from the dbaas API * @param addonId ID of the database addon (e.g., 'ad-xxxx-xxxx-xxxx') * @return Promise that when resolved returns detailed database information. */ apiShow(addonId: string): Promise; /** * Update a database configuration via the dbaas API * @param addonId ID of the database addon (e.g., 'ad-xxxx-xxxx-xxxx') * @param params Database update parameters * @return Promise that when resolved returns the updated database. */ apiUpdate(addonId: string, params: DatabaseUpdateParams): Promise; /** * Get the plan information for a specific database from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns the database plan. */ apiPlan(addonId: string): Promise; /** * Get plan details by plan name from the dbaas API * @param planId Plan name (e.g., redis-starter-512) * @param type Database type name (e.g., redis) * @return Promise that when resolved returns the plan. */ apiShowPlan(planId: string, type: string): Promise; /** * Get current metrics for a specific database from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns database metrics. */ apiMetrics(addonId: string): Promise; /** * Get time-series metrics for a specific database from the dbaas API * @param addonId ID of the database addon * @param type Metric type (e.g., 'cpu', 'memory', 'swap', 'disk', 'diskio') * @param opts Optional parameters * @param opts.since Number of hours to look back (default: 3) * @param opts.last Whether to return only the last value * @return Promise that when resolved returns the metric data points. */ apiMetricsType(addonId: string, type: string, opts?: { since?: number; last?: boolean; }): Promise; /** * Get time-series metrics for a specific database instance from the dbaas API * @param addonId ID of the database addon * @param instanceId ID of the database instance * @param type Metric type (e.g., 'cpu', 'memory', 'swap', 'disk', 'diskio') * @param opts Optional parameters * @param opts.since Number of hours to look back (default: 3) * @param opts.last Whether to return only the last value * @return Promise that when resolved returns the metric data points. */ apiInstanceMetrics(addonId: string, instanceId: string, type: string, opts?: { since?: number; last?: boolean; }): Promise; /** * Get health status for a specific database from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns database health information. */ apiHealth(addonId: string): Promise>; /** * Get instances status for a specific database from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns instances status. */ apiInstancesStatus(addonId: string): Promise; /** * Get replication lag for a specific database from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns lag information. */ apiLag(addonId: string): Promise>; /** * Get a specific backup restoration for a database from the dbaas API * @param addonId ID of the database addon * @param restorationId ID of the backup restoration * @return Promise that when resolved returns the backup restoration. */ apiBackupRestorationShow(addonId: string, restorationId: string): Promise; /** * Get a signed URL for accessing database logs from the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns an object with the signed URL. */ apiLogs(addonId: string): Promise; /** * Get logs archives for a specific database from the dbaas API * @param addonId ID of the database addon * @param opts Optional parameters * @param opts.cursor Pagination cursor * @return Promise that when resolved returns logs archives. */ apiLogsArchives(addonId: string, opts?: { cursor?: number | string; }): Promise; /** * Get all database types from the dbaas API * @return Promise that when resolved returns an array of database types. */ listDatabaseTypes(): Promise; /** * Get information for a specific database type from the dbaas API * @param id ID of the database type * @return Promise that when resolved returns database type information. */ showDatabaseType(id: string): Promise; /** * Get information for a specific database type version from the dbaas API * @param id ID of the database type version * @return Promise that when resolved returns database type version information. */ showDatabaseTypeVersion(id: string): Promise; /** * Ping a database via the dbaas API * @param addonId ID of the database addon * @return Promise that resolves when the ping succeeds. */ apiPing(addonId: string): Promise>; /** * Upgrade a database to the next version via the dbaas API * @param addonId ID of the database addon * @return Promise that when resolved returns upgrade information including operation_id. */ apiUpgrade(addonId: string): Promise>; /** * Get the status of a database operation via the dbaas API * @param addonId ID of the database addon (e.g., 'ad-xxxx-xxxx-xxxx') * @param operationId ID of the operation * @return Promise that when resolved returns the operation details. */ apiOperationShow(addonId: string, operationId: string): Promise; /** * Restore a database to a point in time via the dbaas API * @param addonId ID of the database addon * @param restoreTime Point-in-time restore target * @return Promise that when resolved returns the restore operation payload. */ apiPitrRestore(addonId: string, restoreTime: string): Promise; /** * Run a database action via the dbaas API * @param addonId ID of the database addon * @param actionName Name of the action to perform * @param actionParams Optional parameters for the action (can be an object, string, or other JSON value) * @return Promise that when resolved returns the action result. */ apiAction(addonId: string, actionName: string, actionParams?: unknown): Promise>; apiFirewallRules(addonId: string): Promise; apiCreateFirewallRule(addonId: string, params: FirewallRuleCreateParams): Promise; apiDeleteFirewallRule(addonId: string, ruleId: string): Promise; apiUpdateFirewallRule(addonId: string, ruleId: string, params: FirewallRuleUpdateParams): Promise; apiManagedFirewallRanges(): Promise; /** * Create a new database * @param technology ID or slug of the technology (addon provider) * @param plan ID or name of the plan * @param name Name of the database * @return Promise that when resolved returns the new database. */ create(createParams: CreateParams): Promise; /** * Get the maintenances client for a database * @param databaseId ID of the database addon (e.g., 'ad-xxxx-xxxx-xxxx') * @return Maintenances client for the database */ maintenances(databaseId: string): Maintenances; /** * Get the backups client for a database * @param databaseId ID of the database addon (e.g., 'ad-xxxx-xxxx-xxxx') * @return Backups client for the database */ backups(databaseId: string): Backups; /** * List all users of a database * @param addonId ID of the database addon * @return Promise that when resolved returns the list of database users. */ apiDatabaseUsers(addonId: string): Promise; /** * Create a new database user * @param addonId ID of the database addon * @param params User creation parameters * @return Promise that when resolved returns the created user. */ apiDatabaseUserCreate(addonId: string, params: DatabaseUserCreateParams): Promise; /** * Delete a database user * @param addonId ID of the database addon * @param username Name of the user to delete * @return Promise that resolves when the user is deleted. */ apiDatabaseUserDelete(addonId: string, username: string): Promise; /** * Reset the password of a database user * @param addonId ID of the database addon * @param username Name of the user * @return Promise that when resolved returns the user with new password. */ apiDatabaseUserResetPassword(addonId: string, username: string): Promise; /** * Enable a feature on a database * @param addonId ID of the database addon * @param featureName Name of the feature to enable (e.g., 'force-ssl') * @return Promise that when resolved returns the enabled feature. */ apiDatabaseFeatureEnable(addonId: string, featureName: string): Promise; /** * Disable a feature on a database * @param addonId ID of the database addon * @param featureName Name of the feature to disable (e.g., 'force-ssl') * @return Promise that when resolved returns a message. */ apiDatabaseFeatureDisable(addonId: string, featureName: string): Promise<{ message: string; }>; /** * Get the URL for downloading the CA Certificate * @returns string: the URL to download the CA Certificate from */ caCertificateDownloadURL(): string; } //# sourceMappingURL=index.d.ts.map