aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/mdb/postgresql/v1/cluster_service.proto
blob: fccd20f9bf7d503ea806b62e9dd0679ee182ded6 (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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
syntax = "proto3";

package yandex.cloud.mdb.postgresql.v1;

import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/type/timeofday.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/mdb/postgresql/v1/backup.proto";
import "yandex/cloud/mdb/postgresql/v1/cluster.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/database.proto";
import "yandex/cloud/mdb/postgresql/v1/maintenance.proto";
import "yandex/cloud/mdb/postgresql/v1/user.proto";
import "yandex/cloud/operation/operation.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 set of methods for managing PostgreSQL Cluster resources.
service ClusterService {
  // Returns the specified PostgreSQL Cluster resource.
  //
  // To get the list of available PostgreSQL Cluster resources, make a [List] request.
  rpc Get(GetClusterRequest) returns (Cluster) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}"};
  }

  // Retrieves the list of PostgreSQL Cluster resources that belong
  // to the specified folder.
  rpc List(ListClustersRequest) returns (ListClustersResponse) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters"};
  }

  // Creates a PostgreSQL cluster in the specified folder.
  rpc Create(CreateClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "CreateClusterMetadata"
      response: "Cluster"
    };
  }

  // Updates the specified PostgreSQL cluster.
  rpc Update(UpdateClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {
      patch: "/managed-postgresql/v1/clusters/{cluster_id}"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "UpdateClusterMetadata"
      response: "Cluster"
    };
  }

  // Deletes the specified PostgreSQL cluster.
  rpc Delete(DeleteClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {delete: "/managed-postgresql/v1/clusters/{cluster_id}"};
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteClusterMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Start the specified PostgreSQL cluster.
  rpc Start(StartClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {post: "/managed-postgresql/v1/clusters/{cluster_id}:start"};
    option (yandex.cloud.api.operation) = {
      metadata: "StartClusterMetadata"
      response: "Cluster"
    };
  }

  // Stop the specified PostgreSQL cluster.
  rpc Stop(StopClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {post: "/managed-postgresql/v1/clusters/{cluster_id}:stop"};
    option (yandex.cloud.api.operation) = {
      metadata: "StopClusterMetadata"
      response: "Cluster"
    };
  }

  // Moves the specified PostgreSQL cluster to the specified folder.
  rpc Move(MoveClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}:move"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "MoveClusterMetadata"
      response: "Cluster"
    };
  }

  // Creates a backup for the specified PostgreSQL cluster.
  rpc Backup(BackupClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {post: "/managed-postgresql/v1/clusters/{cluster_id}:backup"};
    option (yandex.cloud.api.operation) = {
      metadata: "BackupClusterMetadata"
      response: "Cluster"
    };
  }

  // Creates a new PostgreSQL cluster using the specified backup.
  rpc Restore(RestoreClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters:restore"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "RestoreClusterMetadata"
      response: "Cluster"
    };
  }

  // Reschedules planned maintenance operation.
  rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}:rescheduleMaintenance"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "RescheduleMaintenanceMetadata"
      response: "Cluster"
    };
  }

  // Start a manual failover on the specified PostgreSQL cluster.
  rpc StartFailover(StartClusterFailoverRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}:startFailover"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "StartClusterFailoverMetadata"
      response: "Cluster"
    };
  }

  // Retrieves logs for the specified PostgreSQL cluster.
  rpc ListLogs(ListClusterLogsRequest) returns (ListClusterLogsResponse) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}:logs"};
  }

  // Same as ListLogs but using server-side streaming. Also allows for 'tail -f' semantics.
  rpc StreamLogs(StreamClusterLogsRequest) returns (stream StreamLogRecord) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}:stream_logs"};
  }

  // Retrieves the list of Operation resources for the specified cluster.
  rpc ListOperations(ListClusterOperationsRequest) returns (ListClusterOperationsResponse) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}/operations"};
  }

  // Retrieves the list of available backups for the specified PostgreSQL cluster.
  rpc ListBackups(ListClusterBackupsRequest) returns (ListClusterBackupsResponse) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}/backups"};
  }

  // Retrieves a list of hosts for the specified cluster.
  rpc ListHosts(ListClusterHostsRequest) returns (ListClusterHostsResponse) {
    option (google.api.http) = {get: "/managed-postgresql/v1/clusters/{cluster_id}/hosts"};
  }

  // Creates new hosts for a cluster.
  rpc AddHosts(AddClusterHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}/hosts:batchCreate"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "AddClusterHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Deletes the specified hosts for a cluster.
  rpc DeleteHosts(DeleteClusterHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}/hosts:batchDelete"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteClusterHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Updates the specified hosts.
  rpc UpdateHosts(UpdateClusterHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-postgresql/v1/clusters/{cluster_id}/hosts:batchUpdate"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "UpdateClusterHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }
}

message GetClusterRequest {
  // ID of the PostgreSQL Cluster resource to return.
  // To get the cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message ListClustersRequest {
  // ID of the folder to list PostgreSQL clusters in.
  // To get the folder ID, use a [yandex.cloud.resourcemanager.v1.FolderService.List] request.
  string folder_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListClustersResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 2 [(value) = "<=1000"];

  // Page token. To get the next page of results, set [page_token] to the [ListClustersResponse.next_page_token]
  // returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];

  // A filter expression that filters resources listed in the response.
  // The expression must specify:
  // 1. The field name. Currently you can only use filtering with the [Cluster.name] field.
  // 2. An `=` operator.
  // 3. The value in double quotes (`"`). Must be 1-63 characters long and match the regular expression `[a-zA-Z0-9_-]+`.
  string filter = 4 [(length) = "<=1000"];
}

message ListClustersResponse {
  // List of PostgreSQL Cluster resources.
  repeated Cluster clusters = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClustersRequest.page_size], use the [next_page_token] as the value
  // for the [ListClustersRequest.page_token] parameter in the next list request. Each subsequent
  // list request will have its own [next_page_token] to continue paging through the results.
  string next_page_token = 2;
}

message CreateClusterRequest {
  // ID of the folder to create the PostgreSQL cluster in.
  string folder_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Name of the PostgreSQL cluster. The name must be unique within the folder.
  string name = 2 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

  // Description of the PostgreSQL cluster.
  string description = 3 [(length) = "<=256"];

  // Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
  // For example, "project": "mvp" or "source": "dictionary".
  map<string, string> labels = 4 [
    (yandex.cloud.size) = "<=64",
    (length) = "<=63",
    (pattern) = "[-_0-9a-z]*",
    (map_key).length = "<=63",
    (map_key).pattern = "[a-z][-_0-9a-z]*"
  ];

  // Deployment environment of the PostgreSQL cluster.
  Cluster.Environment environment = 5 [(required) = true];

  // Configuration and resources for hosts that should be created for the PostgreSQL cluster.
  ConfigSpec config_spec = 6 [(required) = true];

  // Descriptions of databases to be created in the PostgreSQL cluster.
  repeated DatabaseSpec database_specs = 7 [(required) = true];

  // Descriptions of database users to be created in the PostgreSQL cluster.
  repeated UserSpec user_specs = 8 [(required) = true];

  // Individual configurations for hosts that should be created for the PostgreSQL cluster.
  repeated HostSpec host_specs = 9 [(required) = true];

  // ID of the network to create the cluster in.
  string network_id = 10 [
    (required) = true,
    (length) = "<=50"
  ];

  // User security groups
  repeated string security_group_ids = 11;

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

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

message CreateClusterMetadata {
  // ID of the PostgreSQL cluster that is being created.
  string cluster_id = 1;
}

message UpdateClusterRequest {
  // ID of the PostgreSQL Cluster resource to update.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Field mask that specifies which fields of the PostgreSQL Cluster resource should be updated.
  google.protobuf.FieldMask update_mask = 2;

  // New description of the PostgreSQL cluster.
  string description = 3 [(length) = "<=256"];

  // Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
  // For example, "project": "mvp" or "source": "dictionary".
  //
  // The new set of labels will completely replace the old ones. To add a label, request the current
  // set with the [ClusterService.Get] method, then send an [ClusterService.Update] request with the new label added to the set.
  map<string, string> labels = 4 [
    (yandex.cloud.size) = "<=64",
    (length) = "<=63",
    (pattern) = "[-_0-9a-z]*",
    (map_key).length = "<=63",
    (map_key).pattern = "[a-z][-_0-9a-z]*"
  ];

  // New configuration and resources for hosts in the cluster.
  ConfigSpec config_spec = 5;

  // New name for the cluster.
  string name = 6 [
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

  // New maintenance window settings for the cluster.
  MaintenanceWindow maintenance_window = 7;

  // User security groups
  repeated string security_group_ids = 8;

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

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

message UpdateClusterMetadata {
  // ID of the PostgreSQL Cluster resource that is being updated.
  string cluster_id = 1;
}

message DeleteClusterRequest {
  // ID of the PostgreSQL cluster to delete.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message DeleteClusterMetadata {
  // ID of the PostgreSQL cluster that is being deleted.
  string cluster_id = 1;
}

message StartClusterRequest {
  // ID of the PostgreSQL cluster to start.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message StartClusterMetadata {
  // ID of the PostgreSQL cluster.
  string cluster_id = 1;
}

message StopClusterRequest {
  // ID of the PostgreSQL cluster to stop.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message StopClusterMetadata {
  // ID of the PostgreSQL cluster.
  string cluster_id = 1;
}

message MoveClusterRequest {
  // ID of the PostgreSQL cluster to move.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
  // ID of the destination folder.
  string destination_folder_id = 2 [
    (required) = true,
    (length) = "<=50"
  ];
}

message MoveClusterMetadata {
  // ID of the PostgreSQL cluster being moved.
  string cluster_id = 1;
  // ID of the source folder.
  string source_folder_id = 2;
  // ID of the destnation folder.
  string destination_folder_id = 3;
}

message BackupClusterRequest {
  // ID of the PostgreSQL cluster to back up.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message BackupClusterMetadata {
  // ID of the PostgreSQL cluster that is being backed up.
  string cluster_id = 1;
  // ID of the PostgreSQL backup that is being created.
  string backup_id = 2;
}

message RestoreClusterRequest {
  // ID of the backup to create a cluster from.
  // To get the backup ID, use a [ClusterService.ListBackups] request.
  string backup_id = 1 [(required) = true];

  // Timestamp of the moment to which the PostgreSQL cluster should be restored.
  google.protobuf.Timestamp time = 2;

  // Flag that indicates whether a database should be restored to the first backup point
  // available just after the timestamp specified in the [time] field instead of just before.
  //
  // Possible values:
  // * false (default) - the restore point refers to the first backup moment before [time].
  // * true - the restore point refers to the first backup point after [time].
  bool time_inclusive = 3;

  // Name of the new PostgreSQL cluster. The name must be unique within the folder.
  string name = 4 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

  // Description of the new PostgreSQL cluster.
  string description = 5 [(length) = "<=256"];

  // Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
  // For example, "project": "mvp" or "source": "dictionary".
  map<string, string> labels = 6 [
    (yandex.cloud.size) = "<=64",
    (length) = "<=63",
    (pattern) = "[-_0-9a-z]*",
    (map_key).length = "<=63",
    (map_key).pattern = "[a-z][-_0-9a-z]*"
  ];

  // Deployment environment of the new PostgreSQL cluster.
  Cluster.Environment environment = 7 [(required) = true];

  // Configuration for the PostgreSQL cluster to be created.
  ConfigSpec config_spec = 8 [(required) = true];

  // Configurations for PostgreSQL hosts that should be created for
  // the cluster that is being created from the backup.
  repeated HostSpec host_specs = 9 [(size) = ">0"];

  // ID of the network to create the PostgreSQL cluster in.
  string network_id = 10 [
    (required) = true,
    (length) = "<=50"
  ];

  // ID of the folder to create the PostgreSQL cluster in.
  string folder_id = 11 [(length) = "<=50"];

  // User security groups
  repeated string security_group_ids = 12;

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

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

message RestoreClusterMetadata {
  // ID of the new PostgreSQL cluster that is being created from a backup.
  string cluster_id = 1;

  // ID of the backup that is being used for creating a cluster.
  string backup_id = 2;
}

message StartClusterFailoverRequest {
  // ID of PostgreSQL cluster.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // New master host. Switch to the most up-to-date replica if not provided.
  string host_name = 2 [(length) = "<=253"];
}

message StartClusterFailoverMetadata {
  // ID of the PostgreSQL cluster being failovered.
  string cluster_id = 1;
}
message RescheduleMaintenanceRequest {
  // ID of the PostgreSQL cluster to reschedule the maintenance operation for.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  enum RescheduleType {
    RESCHEDULE_TYPE_UNSPECIFIED = 0;

    // Start the maintenance operation immediately.
    IMMEDIATE = 1;

    // Start the maintenance operation within the next available maintenance window.
    NEXT_AVAILABLE_WINDOW = 2;

    // Start the maintenance operation at the specific time.
    SPECIFIC_TIME = 3;
  }

  // The type of reschedule request.
  RescheduleType reschedule_type = 2 [(required) = true];

  // The time until which this maintenance operation should be delayed. The value should be ahead of the first time when the maintenance operation has been scheduled for no more than two weeks. The value can also point to the past moment of time if [reschedule_type.IMMEDIATE] reschedule type is chosen.
  google.protobuf.Timestamp delayed_until = 3;
}

// Rescheduled maintenance operation metadata.
message RescheduleMaintenanceMetadata {
  reserved 2 to 3;
  // Required. ID of the PostgreSQL cluster.
  string cluster_id = 1;

  // Required. The time until which this maintenance operation is to be delayed.
  google.protobuf.Timestamp delayed_until = 4;
}

message LogRecord {
  // Log record timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  google.protobuf.Timestamp timestamp = 1;

  // Contents of the log record.
  map<string, string> message = 2;
}

message ListClusterLogsRequest {
  // ID of the PostgreSQL cluster to request logs for.
  // To get the PostgreSQL cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Columns from the logs table to request.
  // If no columns are specified, entire log records are returned.
  repeated string column_filter = 2;

  // Type of the service to request logs about.
  ServiceType service_type = 3;

  enum ServiceType {
    SERVICE_TYPE_UNSPECIFIED = 0;

    // Logs of PostgreSQL activity.
    POSTGRESQL = 1;

    // Logs of connection pooler activity.
    POOLER = 2;
  }

  // Start timestamp for the logs request, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  google.protobuf.Timestamp from_time = 4;

  // End timestamp for the logs request, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  google.protobuf.Timestamp to_time = 5;

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListClusterLogsResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 6 [(value) = "<=1000"];

  // Page token. To get the next page of results, set [page_token] to the
  // [ListClusterLogsResponse.next_page_token] returned by the previous list request.
  string page_token = 7 [(length) = "<=100"];

  // Always return `next_page_token`, even if current page is empty.
  bool always_next_page_token = 8;
}

message ListClusterLogsResponse {
  // Requested log records.
  repeated LogRecord logs = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClusterLogsRequest.page_size], use the [next_page_token] as the value
  // for the [ListClusterLogsRequest.page_token] query parameter in the next list request.
  // Each subsequent list request will have its own [next_page_token] to continue paging through the results.
  // This value is interchangeable with `next_record_token` from StreamLogs method.
  string next_page_token = 2;
}

message StreamLogRecord {
  // One of the requested log records.
  LogRecord record = 1;

  // This token allows you to continue streaming logs starting from the exact
  // same record. To continue streaming, specify value of `next_record_token`
  // as value for `record_token` parameter in the next StreamLogs request.
  // This value is interchangeable with `next_page_token` from ListLogs method.
  string next_record_token = 2;
}

message StreamClusterLogsRequest {
  // Required. ID of the PostgreSQL cluster.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Columns from logs table to get in the response.
  repeated string column_filter = 2;

  ServiceType service_type = 3;

  enum ServiceType {
    SERVICE_TYPE_UNSPECIFIED = 0;

    // Logs of PostgreSQL activity.
    POSTGRESQL = 1;

    // Logs of connection pooler activity.
    POOLER = 2;
  }

  // Start timestamp for the logs request.
  google.protobuf.Timestamp from_time = 4;

  // End timestamp for the logs request.
  // If this field is not set, all existing logs will be sent and then the new ones as
  // they appear. In essence it has 'tail -f' semantics.
  google.protobuf.Timestamp to_time = 5;

  // Record token. Set `record_token` to the `next_record_token` returned by a previous StreamLogs
  // request to start streaming from next log record.
  string record_token = 6 [(length) = "<=100"];

  // A filter expression that filters resources listed in the response.
  // The expression must specify:
  // 1. The field name. Currently filtering can be applied to the [LogRecord.logs.message.hostname],
  // [LogRecord.logs.message.error_severity] (for POSTGRESQL service), [LogRecord.logs.message.level] (for POOLER service) fields.
  // 2. An `=` operator.
  // 3. The value in double quotes (`"`). Must be 1-63 characters long and match the regular expression `[a-z0-9.-]{1,61}`.
  // Examples of a filter:
  // `message.hostname='node1.db.cloud.yandex.net'`
  // `message.error_severity IN ("ERROR", "FATAL", "PANIC") AND message.hostname = "node1.db.cloud.yandex.net"`
  string filter = 7 [(length) = "<=1000"];
}

message ListClusterOperationsRequest {
  // ID of the PostgreSQL Cluster resource to list operations for.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListClusterOperationsResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 2 [(value) = "<=1000"];

  // Page token.  To get the next page of results, set [page_token] to the [ListClusterOperationsResponse.next_page_token]
  // returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];
}

message ListClusterOperationsResponse {
  // List of Operation resources for the specified PostgreSQL cluster.
  repeated operation.Operation operations = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClusterOperationsRequest.page_size], use the [next_page_token] as the value
  // for the [ListClusterOperationsRequest.page_token] query parameter in the next list request.
  // Each subsequent list request will have its own [next_page_token] to continue paging through the results.
  string next_page_token = 2;
}

message ListClusterBackupsRequest {
  // ID of the PostgreSQL cluster.
  // To get the PostgreSQL cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListClusterBackupsResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 2 [(value) = "<=1000"];

  // Page token.  To get the next page of results, set [page_token] to the [ListClusterBackupsResponse.next_page_token]
  // returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];
}

message ListClusterBackupsResponse {
  // List of PostgreSQL Backup resources.
  repeated Backup backups = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClusterBackupsRequest.page_size], use the [next_page_token] as the value
  // for the [ListClusterBackupsRequest.page_token] query parameter in the next list request.
  // Each subsequent list request will have its own [next_page_token] to continue paging through the results.
  string next_page_token = 2;
}

message ListClusterHostsRequest {
  // ID of the PostgreSQL cluster.
  // To get the PostgreSQL cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListClusterHostsResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 2 [(value) = "<=1000"];

  // Page token.  To get the next page of results, set [page_token] to the [ListClusterHostsResponse.next_page_token]
  // returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];
}

message ListClusterHostsResponse {
  // List of Host resources.
  repeated Host hosts = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClusterHostsRequest.page_size], use the [next_page_token] as the value
  // for the [ListClusterHostsRequest.page_token] query parameter in the next list request.
  // Each subsequent list request will have its own [next_page_token] to continue paging through the results.
  string next_page_token = 2;
}

message AddClusterHostsRequest {
  // ID of the PostgreSQL cluster to add hosts to.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Configurations for PostgreSQL hosts that should be added to the cluster.
  repeated HostSpec host_specs = 2 [(size) = ">0"];
}

message AddClusterHostsMetadata {
  // ID of the PostgreSQL cluster to which the hosts are being added.
  string cluster_id = 1;

  // Names of hosts that are being added to the cluster.
  repeated string host_names = 2;
}

message DeleteClusterHostsRequest {
  // ID of the PostgreSQL cluster to remove hosts from.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Names of hosts to delete.
  repeated string host_names = 2 [
    (size) = ">0",
    (length) = "<=253"
  ];
}

message DeleteClusterHostsMetadata {
  // ID of the PostgreSQL cluster to remove hosts from.
  string cluster_id = 1;

  // Names of hosts that are being deleted.
  repeated string host_names = 2;
}

message UpdateClusterHostsRequest {
  // ID of the PostgreSQL cluster to update hosts in.
  // To get the PostgreSQL cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // New configurations to apply to hosts.
  repeated UpdateHostSpec update_host_specs = 2 [(size) = ">0"];
}

message UpdateClusterHostsMetadata {
  // ID of the PostgreSQL cluster to update hosts in.
  string cluster_id = 1;

  // Names of hosts that are being updated.
  repeated string host_names = 2;
}

message UpdateHostSpec {
  // Name of the host to update.
  // To get the PostgreSQL host name, use a [ClusterService.ListHosts] request.
  string host_name = 1 [(required) = true];

  // [Host.name] of the host to be used as the replication source (for cascading replication).
  // To get the PostgreSQL host name, use a [ClusterService.ListHosts] request.
  string replication_source = 2;

  // 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 = 3;

  // Configuration of a PostgreSQL server for the host.
  ConfigHostSpec config_spec = 4;

  // Field mask that specifies which fields of the PostgreSQL host should be updated.
  google.protobuf.FieldMask update_mask = 5;

  // Whether the host should get a public IP address on creation.
  bool assign_public_ip = 6;
}

message HostSpec {
  // ID of the availability zone where the host resides.
  // To get a list of available zones, use the [yandex.cloud.compute.v1.ZoneService.List] request.
  string zone_id = 1 [(length) = "<=50"];

  // ID of the subnet that the host should belong to. This subnet should be a part
  // of the network that the cluster belongs to.
  // The ID of the network is set in the field [Cluster.network_id].
  string subnet_id = 2 [(length) = "<=50"];

  // Whether the host should get a public IP address on creation.
  //
  // After a host has been created, this setting cannot be changed. To remove an assigned public IP, or to assign
  // a public IP to a host without one, recreate the host with [assign_public_ip] set as needed.
  //
  // Possible values:
  // * false - don't assign a public IP to the host.
  // * true - the host should have a public IP address.
  bool assign_public_ip = 3;

  // [Host.name] of the host to be used as the replication source (for cascading replication).
  string replication_source = 4;

  // Priority of the host as a replica. A higher value corresponds to 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 = 5;

  // Configuration of a PostgreSQL server for the host.
  ConfigHostSpec config_spec = 6;
}

message ConfigSpec {
  reserved 20;
  // Version of PostgreSQL used in the cluster.
  // Possible values: `9.6`, `10`, `10_1c`, `11`, `12`, `13`, `14`, `15`
  string version = 1;

  // Configuration of a PostgreSQL cluster.
  oneof postgresql_config {
    // Configuration for a PostgreSQL 9.6 cluster.
    config.PostgresqlConfig9_6 postgresql_config_9_6 = 2 [json_name = "postgresqlConfig_9_6"];

    // Configuration for a PostgreSQL 10 1C cluster.
    config.PostgresqlConfig10_1C postgresql_config_10_1c = 10 [json_name = "postgresqlConfig_10_1c"];

    // Configuration for a PostgreSQL 10 cluster.
    config.PostgresqlConfig10 postgresql_config_10 = 3 [json_name = "postgresqlConfig_10"];

    // Configuration for a PostgreSQL 11 cluster.
    config.PostgresqlConfig11 postgresql_config_11 = 7 [json_name = "postgresqlConfig_11"];

    // Configuration for a PostgreSQL 11 1C cluster.
    config.PostgresqlConfig11_1C postgresql_config_11_1c = 13 [json_name = "postgresqlConfig_11_1c"];

    // Configuration for a PostgreSQL 12 cluster.
    config.PostgresqlConfig12 postgresql_config_12 = 11 [json_name = "postgresqlConfig_12"];

    // Configuration for a PostgreSQL 12 1C cluster.
    config.PostgresqlConfig12_1C postgresql_config_12_1c = 14 [json_name = "postgresqlConfig_12_1c"];

    // Configuration for a PostgreSQL 13 cluster.
    config.PostgresqlConfig13 postgresql_config_13 = 15 [json_name = "postgresqlConfig_13"];

    // Configuration for a PostgreSQL 13 1C cluster.
    config.PostgresqlConfig13_1C postgresql_config_13_1c = 18 [json_name = "postgresqlConfig_13_1c"];

    // Configuration for a PostgreSQL 14 cluster.
    config.PostgresqlConfig14 postgresql_config_14 = 16 [json_name = "postgresqlConfig_14"];

    // Configuration for a PostgreSQL 14 1C cluster.
    config.PostgresqlConfig14_1C postgresql_config_14_1c = 19 [json_name = "postgresqlConfig_14_1c"];

    // Configuration for a PostgreSQL 15 cluster.
    config.PostgresqlConfig15 postgresql_config_15 = 21 [json_name = "postgresqlConfig_15"];

    // Configuration for a PostgreSQL 15 1C cluster.
    config.PostgresqlConfig15_1C postgresql_config_15_1c = 22 [json_name = "postgresqlConfig_15_1c"];

    // Configuration for a PostgreSQL 16 cluster.
    config.PostgresqlConfig16 postgresql_config_16 = 24 [json_name = "postgresqlConfig_16"];

    // Configuration for a PostgreSQL 16 1C cluster.
    config.PostgresqlConfig16_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 = 8;

  // 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 ConfigHostSpec {
  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"];
  }
}