Skip to main content

Get

Retrieves information about the specified database.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetDatabaseRequest =
cloudApi.mdb.clickhouse_database_service.GetDatabaseRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DatabaseServiceClient);

const result = await client.get(
GetDatabaseRequest.fromPartial({
clusterId: "clusterId",
databaseName: "databaseName",
})
);
console.log(result);
})();

GetDatabaseRequest

clusterId : string

ID of the cluster that the database belongs to.

To get this ID, make a ClusterService.List request.

databaseName : string

Name of the database to return information about.

To get this name, make a DatabaseService.List request.

Database

An object that represents MySQL database.

See the documentation for details.

name : string

Name of the database.

clusterId : string

ID of the cluster that the database belongs to.