aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/mdb/postgresql/v1/cluster.proto
blob: c5c61a3c2fb795359a95bb0a33efb20bac632d1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
syntax = "proto3";

package yandex.cloud.mdb.postgresql.v1;

import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/type/timeofday.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host10.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host10_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host11.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host11_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host12.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host12_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host13.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host13_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host14.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host14_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host15.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host15_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host16.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host16_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/host9_6.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql10.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql10_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql11.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql11_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql12.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql12_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql13.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql13_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql14.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql14_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql15.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql15_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql16.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql16_1c.proto";
import "yandex/cloud/mdb/postgresql/v1/config/postgresql9_6.proto";
import "yandex/cloud/mdb/postgresql/v1/maintenance.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/postgresql/v1;postgresql";
option java_package = "yandex.cloud.api.mdb.postgresql.v1";

// A PostgreSQL Cluster resource. For more information, see
// the [Concepts](/docs/managed-postgresql/concepts) section of the documentation.
message Cluster {
  enum Environment {
    ENVIRONMENT_UNSPECIFIED = 0;

    // Stable environment with a conservative update policy:
    // only hotfixes are applied during regular maintenance.
    PRODUCTION = 1;

    // Environment with more aggressive update policy: new versions
    // are rolled out irrespective of backward compatibility.
    PRESTABLE = 2;
  }

  enum Health {

    // State of the cluster is unknown ([Host.health] for every host in the cluster is UNKNOWN).
    HEALTH_UNKNOWN = 0;

    // Cluster is alive and well ([Host.health] for every host in the cluster is ALIVE).
    ALIVE = 1;

    // Cluster is inoperable ([Host.health] for every host in the cluster is DEAD).
    DEAD = 2;

    // Cluster is working below capacity ([Host.health] for at least one host in the cluster is not ALIVE).
    DEGRADED = 3;
  }

  enum Status {

    // Cluster state is unknown.
    STATUS_UNKNOWN = 0;

    // Cluster is being created.
    CREATING = 1;

    // Cluster is running normally.
    RUNNING = 2;

    // Cluster encountered a problem and cannot operate.
    ERROR = 3;

    // Cluster is being updated.
    UPDATING = 4;

    // Cluster is stopping.
    STOPPING = 5;

    // Cluster stopped.
    STOPPED = 6;

    // Cluster is starting.
    STARTING = 7;
  }

  // ID of the PostgreSQL cluster.
  // This ID is assigned by MDB at creation time.
  string id = 1;

  // ID of the folder that the PostgreSQL cluster belongs to.
  string folder_id = 2;

  // Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  google.protobuf.Timestamp created_at = 3;

  // Name of the PostgreSQL cluster.
  // The name is unique within the folder. 1-63 characters long.
  string name = 4;

  // Description of the PostgreSQL cluster. 0-256 characters long.
  string description = 5;

  // Custom labels for the PostgreSQL cluster as `` key:value `` pairs.
  // Maximum 64 per resource.
  map<string, string> labels = 6;

  // Deployment environment of the PostgreSQL cluster.
  Environment environment = 7;

  // Description of monitoring systems relevant to the PostgreSQL cluster.
  repeated Monitoring monitoring = 8;

  // Configuration of the PostgreSQL cluster.
  ClusterConfig config = 9;

  // ID of the network that the cluster belongs to.
  string network_id = 10;

  // Aggregated cluster health.
  Health health = 11;

  // Current state of the cluster.
  Status status = 12;

  // Maintenance window for the cluster.
  MaintenanceWindow maintenance_window = 13;

  // Planned maintenance operation to be started for the cluster within the nearest [maintenance_window].
  MaintenanceOperation planned_operation = 14;

  // User security groups
  repeated string security_group_ids = 15;

  // Deletion Protection inhibits deletion of the cluster
  bool deletion_protection = 16;

  // Host groups hosting VMs of the cluster.
  repeated string host_group_ids = 17;
}

// Monitoring system.
message Monitoring {
  // Name of the monitoring system.
  string name = 1;

  // Description of the monitoring system.
  string description = 2;

  // Link to the monitoring system charts for the PostgreSQL cluster.
  string link = 3;
}

message ClusterConfig {
  reserved 20;
  // Version of PostgreSQL server software.
  string version = 1;

  // Configuration for PostgreSQL servers in the cluster.
  oneof postgresql_config {
    // Configuration of a PostgreSQL 9.6 server.
    config.PostgresqlConfigSet9_6 postgresql_config_9_6 = 2 [json_name = "postgresqlConfig_9_6"];

    // Configuration of a PostgreSQL 10 1C server.
    config.PostgresqlConfigSet10_1C postgresql_config_10_1c = 10 [json_name = "postgresqlConfig_10_1c"];

    // Configuration of a PostgreSQL 10 server.
    config.PostgresqlConfigSet10 postgresql_config_10 = 3 [json_name = "postgresqlConfig_10"];

    // Configuration of a PostgreSQL 11 server.
    config.PostgresqlConfigSet11 postgresql_config_11 = 8 [json_name = "postgresqlConfig_11"];

    // Configuration of a PostgreSQL 11 1C server.
    config.PostgresqlConfigSet11_1C postgresql_config_11_1c = 13 [json_name = "postgresqlConfig_11_1c"];

    // Configuration of a PostgreSQL 12 server.
    config.PostgresqlConfigSet12 postgresql_config_12 = 11 [json_name = "postgresqlConfig_12"];

    // Configuration of a PostgreSQL 12 1C server.
    config.PostgresqlConfigSet12_1C postgresql_config_12_1c = 14 [json_name = "postgresqlConfig_12_1c"];

    // Configuration of a PostgreSQL 13 server.
    config.PostgresqlConfigSet13 postgresql_config_13 = 15 [json_name = "postgresqlConfig_13"];

    // Configuration of a PostgreSQL 13 1C server.
    config.PostgresqlConfigSet13_1C postgresql_config_13_1c = 18 [json_name = "postgresqlConfig_13_1c"];

    // Configuration of a PostgreSQL 14 server.
    config.PostgresqlConfigSet14 postgresql_config_14 = 16 [json_name = "postgresqlConfig_14"];

    // Configuration of a PostgreSQL 14 1C server.
    config.PostgresqlConfigSet14_1C postgresql_config_14_1c = 19 [json_name = "postgresqlConfig_14_1c"];

    // Configuration of a PostgreSQL 15 server.
    config.PostgresqlConfigSet15 postgresql_config_15 = 21 [json_name = "postgresqlConfig_15"];

    // Configuration of a PostgreSQL 15 1C server.
    config.PostgresqlConfigSet15_1C postgresql_config_15_1c = 22 [json_name = "postgresqlConfig_15_1c"];

    // Configuration of a PostgreSQL 16 server.
    config.PostgresqlConfigSet16 postgresql_config_16 = 24 [json_name = "postgresqlConfig_16"];

    // Configuration of a PostgreSQL 16 1C server.
    config.PostgresqlConfigSet16_1C postgresql_config_16_1c = 25 [json_name = "postgresqlConfig_16_1c"];
  }

  // Configuration of the connection pooler.
  ConnectionPoolerConfig pooler_config = 4;

  // Resources allocated to PostgreSQL hosts.
  Resources resources = 5;

  // Configuration setting which enables/disables autofailover in cluster.
  google.protobuf.BoolValue autofailover = 6;

  // Time to start the daily backup, in the UTC timezone.
  google.type.TimeOfDay backup_window_start = 7;

  // Retention policy of automated backups.
  google.protobuf.Int64Value backup_retain_period_days = 17 [(value) = "7-60"];

  // Access policy to DB
  Access access = 9;

  // Configuration of the performance diagnostics service.
  PerformanceDiagnostics performance_diagnostics = 12;

  // Disk size autoscaling
  DiskSizeAutoscaling disk_size_autoscaling = 23;
}

message ConnectionPoolerConfig {
  enum PoolingMode {
    POOLING_MODE_UNSPECIFIED = 0;

    // Session pooling mode.
    SESSION = 1;

    // Transaction pooling mode.
    TRANSACTION = 2;

    // Statement pooling mode.
    STATEMENT = 3;
  }

  // Mode that the connection pooler is working in.
  // See descriptions of all modes in the [documentation for PgBouncer](https://pgbouncer.github.io/usage).
  PoolingMode pooling_mode = 1;

  // Setting `server_reset_query_always` parameter in PgBouncer.
  google.protobuf.BoolValue pool_discard = 2;
}

message Host {
  enum Role {

    // Role of the host in the cluster is unknown. Default value.
    ROLE_UNKNOWN = 0;

    // Host is the master PostgreSQL server in the cluster.
    MASTER = 1;

    // Host is a replica (standby) PostgreSQL server in the cluster.
    REPLICA = 2;
  }

  enum ReplicaType {
    REPLICA_TYPE_UNKNOWN = 0; // Replica type is unknown (we have no data) or it's master
    ASYNC = 1;
    SYNC = 2;
    QUORUM = 3;
  }

  enum Health {

    // Health of the host is unknown. Default value.
    HEALTH_UNKNOWN = 0;

    // The host is performing all its functions normally.
    ALIVE = 1;

    // The host is inoperable, and cannot perform any of its essential functions.
    DEAD = 2;

    // The host is degraded, and can perform only some of its essential functions.
    DEGRADED = 3;

    // The host is alive, but in read-only mode.
    READONLY = 4;
  }

  // Name of the PostgreSQL host. The host name is assigned by MDB at creation time, and cannot be changed.
  // 1-63 characters long.
  //
  // The name is unique across all MDB hosts that exist on the platform, as it defines the FQDN of the host.
  string name = 1;

  // ID of the PostgreSQL host. The ID is assigned by MDB at creation time.
  string cluster_id = 2;

  // ID of the availability zone where the PostgreSQL host resides.
  string zone_id = 3;

  // Resources allocated to the PostgreSQL host.
  Resources resources = 4;

  // Role of the host in the cluster. If the field has default value, it is not returned in the response.
  Role role = 5;

  // Aggregated health of the host. If the field has default value, it is not returned in the response.
  Health health = 6;

  // Services provided by the host.
  repeated Service services = 7;

  // ID of the subnet that the host belongs to.
  string subnet_id = 8;

  // Name of the host to be used as the replication source for cascading replication.
  string replication_source = 9;

  // Priority of the host as a replica. Higher value means higher priority.
  //
  // The host with the highest priority is the synchronous replica. All others are asynchronous.
  // The synchronous replica replaces the master when needed.
  //
  // When a replica becomes the master, its priority is ignored.
  google.protobuf.Int64Value priority = 10;

  // Configuration of a PostgreSQL server for the host.
  HostConfig config = 11;

  // Flag showing public IP assignment status to this host.
  bool assign_public_ip = 12;

  ReplicaType replica_type = 13;
}

message HostConfig {
  // Configuration of a PostgreSQL server for the host.
  oneof postgresql_config {
    // Configuration for a host with PostgreSQL 9.6 server deployed.
    config.PostgresqlHostConfig9_6 postgresql_config_9_6 = 1 [json_name = "postgresqlHostConfig_9_6"];

    // Configuration for a host with PostgreSQL 10 1C server deployed.
    config.PostgresqlHostConfig10_1C postgresql_config_10_1c = 4 [json_name = "postgresqlHostConfig_10_1c"];

    // Configuration for a host with PostgreSQL 10 server deployed.
    config.PostgresqlHostConfig10 postgresql_config_10 = 2 [json_name = "postgresqlHostConfig_10"];

    // Configuration for a host with PostgreSQL 11 server deployed.
    config.PostgresqlHostConfig11 postgresql_config_11 = 3 [json_name = "postgresqlHostConfig_11"];

    // Configuration for a host with PostgreSQL 11 1C server deployed.
    config.PostgresqlHostConfig11_1C postgresql_config_11_1c = 6 [json_name = "postgresqlHostConfig_11_1c"];

    // Configuration for a host with PostgreSQL 12 server deployed.
    config.PostgresqlHostConfig12 postgresql_config_12 = 5 [json_name = "postgresqlHostConfig_12"];

    // Configuration for a host with PostgreSQL 12 1C server deployed.
    config.PostgresqlHostConfig12_1C postgresql_config_12_1c = 7 [json_name = "postgresqlHostConfig_12_1c"];

    // Configuration for a host with PostgreSQL 13 server deployed.
    config.PostgresqlHostConfig13 postgresql_config_13 = 8 [json_name = "postgresqlHostConfig_13"];

    // Configuration for a host with PostgreSQL 13 1C server deployed.
    config.PostgresqlHostConfig13_1C postgresql_config_13_1c = 10 [json_name = "postgresqlHostConfig_13_1c"];

    // Configuration for a host with PostgreSQL 14 server deployed.
    config.PostgresqlHostConfig14 postgresql_config_14 = 9 [json_name = "postgresqlHostConfig_14"];

    // Configuration for a host with PostgreSQL 14 1C server deployed.
    config.PostgresqlHostConfig14_1C postgresql_config_14_1c = 11 [json_name = "postgresqlHostConfig_14_1c"];

    // Configuration for a host with PostgreSQL 15 server deployed.
    config.PostgresqlHostConfig15 postgresql_config_15 = 12 [json_name = "postgresqlHostConfig_15"];

    // Configuration for a host with PostgreSQL 15 1C server deployed.
    config.PostgresqlHostConfig15_1C postgresql_config_15_1c = 13 [json_name = "postgresqlHostConfig_15_1c"];

    // Configuration for a host with PostgreSQL 16 server deployed.
    config.PostgresqlHostConfig16 postgresql_config_16 = 14 [json_name = "postgresqlHostConfig_16"];

    // Configuration for a host with PostgreSQL 16 1C server deployed.
    config.PostgresqlHostConfig16_1C postgresql_config_16_1c = 15 [json_name = "postgresqlHostConfig_16_1c"];
  }
}

message Service {
  enum Type {
    // Service type of the host is unspecified. Default value.
    TYPE_UNSPECIFIED = 0;

    // The host is a PostgreSQL server.
    POSTGRESQL = 1;

    // The host is a PgBouncer server.
    POOLER = 2;
  }

  enum Health {

    // Health of the server is unknown. Default value.
    HEALTH_UNKNOWN = 0;

    // The server is working normally.
    ALIVE = 1;

    // The server is dead or unresponsive.
    DEAD = 2;

    // The server is in read-only mode.
    READONLY = 3;
  }

  // Type of the service provided by the host. If the field has default value, it is not returned in the response.
  Type type = 1;

  // Aggregated health of the service. If the field has default value, it is not returned in the response.
  Health health = 2;
}

message Resources {
  // ID of the preset for computational resources available to a host (CPU, memory etc.).
  // All available presets are listed in the [documentation](/docs/managed-postgresql/concepts/instance-types).
  string resource_preset_id = 1;

  // Volume of the storage available to a host, in bytes.
  int64 disk_size = 2;

  // Type of the storage environment for the host.
  // Possible values:
  // * network-hdd - network HDD drive,
  // * network-ssd - network SSD drive,
  // * local-ssd - local SSD storage.
  string disk_type_id = 3;
}

message Access {
  // Allow access for DataLens
  bool data_lens = 1;

  // Allow SQL queries to the cluster databases from the management console.
  //
  // See [SQL queries in the management console](/docs/managed-postgresql/operations/web-sql-query) for more details.
  bool web_sql = 2;

  // Allow access for Serverless
  bool serverless = 3;

  // Allow access for DataTransfer.
  bool data_transfer = 4;

  // Allow access for YandexQuery.
  bool yandex_query = 5;
}

message PerformanceDiagnostics {
  // Configuration setting which enables/disables performance diagnostics service in cluster.
  bool enabled = 1;
  // Interval (in seconds) for pg_stat_activity sampling
  int64 sessions_sampling_interval = 2 [(value) = "1-86400"];
  // Interval (in seconds) for pg_stat_statements sampling
  int64 statements_sampling_interval = 3 [(value) = "1-86400"];
}

message DiskSizeAutoscaling {
  // Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
  int64 planned_usage_threshold = 1 [
    (required) = false,
    (value) = "0-100"
  ];

  // Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.
  int64 emergency_usage_threshold = 2 [
    (required) = false,
    (value) = "0-100"
  ];

  // New storage size (in bytes) that is set when one of the thresholds is achieved.
  int64 disk_size_limit = 3;
}