Get
Retrieves information about the specified database.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.mdb.clickhouse.v1.database_service_pb2_grpc import DatabaseServiceStub
from yandex.cloud.mdb.clickhouse.v1.database_service_pb2 import GetDatabaseRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DatabaseServiceStub)
response = service.Get(GetDatabaseRequest(cluster_id="clusterId", database_name="databaseName"))
print(response)
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.