Skip to main content

Get

Returns the specified SQL Server database.

To get the list of available SQL Server databases, make a List request.

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 SQL Server cluster the database belongs to.

To get the cluster ID, use a ClusterService.List request.

databaseName : string

Name of the SQL Server database to return.

To get the name of the database use a DatabaseService.List request.

Database

An SQL Server database.

For more information, see the Concepts section of the documentation.

name : string

Name of the database.

clusterId : string

ID of the SQL Server cluster that the database belongs to.