Get
Returns the specified PostgreSQL Database resource.
To get the list of available PostgreSQL Database resources, make a List request.
- 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 PostgreSQL cluster that the database belongs to. To get the cluster ID use a ClusterService.List request.
databaseName
: string
Name of the PostgreSQL Database resource to return. To get the name of the database use a DatabaseService.List request.
Database
A PostgreSQL Database resource. For more information, see the Developer's Guide.
name
: string
Name of the database.
clusterId
: string
ID of the PostgreSQL cluster that the database belongs to.
owner
: string
Name of the user assigned as the owner of the database.
lcCollate
: string
POSIX locale for string sorting order. Can only be set at creation time.
lcCtype
: string
POSIX locale for character classification. Can only be set at creation time.
extensions
: Extension
PostgreSQL extensions enabled for the database.
templateDb
: string
Name of the database template.
deletionProtection
: google.protobuf.BoolValue
Deletion Protection inhibits deletion of the database
Default value: unspecified
(inherits cluster's deletion_protection)
Extension
name
: string
Name of the extension, e.g. pg_trgm
or pg_btree
.
Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version
: string
Version of the extension.