redis-cloud-api-sdk
Version:
This is a client for the Redislabs Cloud API
86 lines (85 loc) • 3.79 kB
TypeScript
import { DatabaseCreationParameters, DatabaseImportParameters, DatabaseUpdateParameters } from '../types/parameters/database';
import { DatabaseResponse, DatabaseStatus } from '../types/responses/database';
import { TaskResponse } from '../types/task';
import { Client } from './api.base';
export declare class Database {
protected client: Client;
private task;
constructor(client: Client);
/**
* Returning a lookup list of databases owned by the account
* @param subscriptionId The id of the subscription
*/
getDatabases(subscriptionId: number): Promise<DatabaseResponse[] & {
[key: string]: any;
}>;
/**
* Creating a database
* @param subscriptionId The id of the subscription
* @param createParameters The create parameters to create the database
*/
createDatabase(subscriptionId: number, createParameters: DatabaseCreationParameters): Promise<TaskResponse & {
[key: string]: any;
}>;
/**
* Returning a database
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
*/
getDatabase(subscriptionId: number, databaseId: number): Promise<DatabaseResponse & {
[key: string]: any;
}>;
/**
* Updating a database
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
* @param updateParameters The update parameters to update the database
*/
updateDatabase(subscriptionId: number, databaseId: number, updateParameters: DatabaseUpdateParameters): Promise<TaskResponse & {
[key: string]: any;
}>;
/**
* Deleting a database
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
*/
deleteDatabase(subscriptionId: number, databaseId: number): Promise<TaskResponse & {
[key: string]: any;
}>;
/**
* Backing up a database
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
*/
backupDatabase(subscriptionId: number, databaseId: number): Promise<TaskResponse & {
[key: string]: any;
}>;
/**
* Importing a dataset into a database
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
* @param importParameters The import parameters to import into a database
*/
importIntoDatabase(subscriptionId: number, databaseId: number, importParameters: DatabaseImportParameters): Promise<TaskResponse & {
[key: string]: any;
}>;
/**
* Waiting for database status to change to a given status
* @param subscriptionId The id of the subscription
* @param databaseId The id of the database
* @param expectedStatus The expected status
* @param timeoutInSeconds The timeout of waiting for the status. Default: 5 minutes
* @param sleepTimeInSeconds The sleep time between requests. Default: 5 seconds
*/
waitForDatabaseStatus(subscriptionId: number, databaseId: number, expectedStatus: DatabaseStatus, timeoutInSeconds?: number, sleepTimeInSeconds?: number): Promise<DatabaseResponse & {
[key: string]: any;
}>;
/**
* Waiting for all databases status under subscription to change to the expected status
* @param subscriptionId The id of the subscription
* @param expectedStatus The expected status
* @param timeoutInSeconds The timeout of waiting for the status. Default: 5 minutes
* @param sleepTimeInSeconds The sleep time between requests. Default: 5 seconds
*/
waitForSubscriptionDatabasesStatus(subscriptionId: number, expectedStatus?: DatabaseStatus, timeoutInSeconds?: number, sleepTimeInSeconds?: number): Promise<void>;
}