Skip to main content

Get

Returns 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

databaseId : string

Required. ID of the YDB cluster.

Database

YDB database.

Status

  • STATUS_UNSPECIFIED

  • PROVISIONING

  • RUNNING

  • UPDATING

  • ERROR

  • DELETING

  • STARTING

  • STOPPED

id : string
folderId : string
createdAt : google.protobuf.Timestamp
name : string
description : string
status : Status
endpoint : string
resourcePresetId : string
storageConfig : StorageConfig
scalePolicy : ScalePolicy
networkId : string
subnetIds : string

One of databaseType

  • zonalDatabase : ZonalDatabase

    deprecated field

  • regionalDatabase : RegionalDatabase

    deprecated field

  • dedicatedDatabase : DedicatedDatabase
  • serverlessDatabase : ServerlessDatabase
assignPublicIps : bool
locationId : string
labels : string
backupConfig : BackupConfig
documentApiEndpoint : string
kinesisApiEndpoint : string
kafkaApiEndpoint : string
monitoringConfig : MonitoringConfig
deletionProtection : bool

StorageConfig

storageOptions : StorageOption
storageSizeLimit : int64

output only field: storage size limit of dedicated database.

ScalePolicy

FixedScale
size : int64

One of scaleType

  • fixedScale : FixedScale

ZonalDatabase

zoneId : string

RegionalDatabase

regionId : string

DedicatedDatabase

resourcePresetId : string
storageConfig : StorageConfig
scalePolicy : ScalePolicy
networkId : string
subnetIds : string
assignPublicIps : bool

ServerlessDatabase

throttlingRcuLimit : int64

Let's define 1 RU - 1 request unit Let's define 1 RCU - 1 request capacity unit, which is 1 RU per second. If enable_throttling_rcu_limit flag is true, the database will be throttled using throttling_rcu_limit value. Otherwise, the database is throttled using the cloud quotas. If zero, all requests will be blocked until non zero value is set.

storageSizeLimit : int64

Specify serverless database storage size limit. If zero, default value is applied.

enableThrottlingRcuLimit : bool

If false, the database is throttled by cloud value.

provisionedRcuLimit : int64

Specify the number of provisioned RCUs to pay less if the database has predictable load. You will be charged for the provisioned capacity regularly even if this capacity is not fully consumed. You will be charged for the on-demand consumption only if provisioned capacity is consumed.

topicWriteQuota : int64

write quota for topic service, defined in bytes per second.

BackupConfig

backupSettings : BackupSettings

MonitoringConfig

alerts : Alert

StorageOption

storageTypeId : string
groupCount : int64

FixedScale

size : int64

BackupSettings

Type
  • TYPE_UNSPECIFIED

  • SYSTEM

  • USER

StorageClass
  • STORAGE_CLASS_UNSPECIFIED

  • STANDARD

  • REDUCED_REDUNDANCY

  • STANDARD_IA

  • ONEZONE_IA

  • INTELLIGENT_TIERING

  • GLACIER

  • DEEP_ARCHIVE

  • OUTPOSTS

name : string

name of backup settings

description : string

human readable description.

backupSchedule : BackupSchedule

provide schedule. if empty, backup will be disabled.

backupTimeToLive : google.protobuf.Duration

provide time to live of backup.

sourcePaths : string

provide a list of source paths. Each path can be directory, table or even database itself. Each directory (or database) will be traversed recursively and all childs of directory will be included to backup. By default, backup will be created for full database.

sourcePathsToExclude : string

provide a list of paths to exclude from backup. Each path is a directory, table, or database. Each directory (or database) will be traversed recursively and all childs of directory will be excluded.

type : Type
storageClass : StorageClass

Alert

alertId : string

output only field.

alertTemplateId : string

template of the alert.

name : string

name of the alert.

description : string

human readable description of the alert.

notificationChannels : NotificationChannel

the notification channels of the alert.

alertParameters : AlertParameter

alert parameters to override.

alertThresholds : AlertParameter

alert paratemers to override.

BackupSchedule

One of policy

  • dailyBackupSchedule : DailyBackupSchedule
  • weeklyBackupSchedule : WeeklyBackupSchedule
  • recurringBackupSchedule : RecurringBackupSchedule
nextExecuteTime : google.protobuf.Timestamp

output only field: when next backup will be executed using provided schedule.

NotificationChannel

notificationChannelId : string
notifyAboutStatuses : AlertEvaluationStatus
repeateNotifyDelayMs : int64

AlertParameter

DoubleParameterValue
name : string

Required. Parameter name

value : double

Required. Parameter value

IntegerParameterValue
name : string

Required. Parameter name

value : int64

Required. Parameter value

TextParameterValue
name : string

Required. Parameter name

value : string

Required. Parameter value

TextListParameterValue
name : string

Required. Parameter name

values : string

Required. Parameter value

LabelListParameterValue
name : string

Required. Parameter name

values : string

Required. Parameter value

One of parameter

  • doubleParameterValue : DoubleParameterValue
  • integerParameterValue : IntegerParameterValue
  • textParameterValue : TextParameterValue
  • textListParameterValue : TextListParameterValue
  • labelListParameterValue : LabelListParameterValue

DailyBackupSchedule

executeTime : google.type.TimeOfDay

WeeklyBackupSchedule

daysOfWeek : DaysOfWeekBackupSchedule

RecurringBackupSchedule

startTime : google.protobuf.Timestamp

Timestamp of the first recurrence.

recurrence : string

An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how this backup reccurs. The FREQ values of MINUTELY, and SECONDLY are not supported.

DoubleParameterValue

name : string

Required. Parameter name

value : double

Required. Parameter value

IntegerParameterValue

name : string

Required. Parameter name

value : int64

Required. Parameter value

TextParameterValue

name : string

Required. Parameter name

value : string

Required. Parameter value

TextListParameterValue

name : string

Required. Parameter name

values : string

Required. Parameter value

LabelListParameterValue

name : string

Required. Parameter name

values : string

Required. Parameter value

DaysOfWeekBackupSchedule

days : google.type.DayOfWeek
executeTime : google.type.TimeOfDay