aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/mdb/mongodb/v1/cluster_service.proto
blob: ffde28b02f5fc355847373be0013a61c8caaccd4 (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
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
syntax = "proto3";

package yandex.cloud.mdb.mongodb.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/mongodb/v1/backup.proto";
import "yandex/cloud/mdb/mongodb/v1/cluster.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb3_6.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb4_0.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb4_2.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb4_4.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb4_4_enterprise.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb5_0.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb5_0_enterprise.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb6_0.proto";
import "yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise.proto";
import "yandex/cloud/mdb/mongodb/v1/database.proto";
import "yandex/cloud/mdb/mongodb/v1/maintenance.proto";
import "yandex/cloud/mdb/mongodb/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/mongodb/v1;mongodb";
option java_package = "yandex.cloud.api.mdb.mongodb.v1";

// A set of methods for managing MongoDB Cluster resources.
service ClusterService {
  // Returns the specified MongoDB Cluster resource.
  //
  // To get the list of available MongoDB Cluster resources, make a [List] request.
  rpc Get(GetClusterRequest) returns (Cluster) {
    option (google.api.http) = {get: "/managed-mongodb/v1/clusters/{cluster_id}"};
  }

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

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

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

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

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

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

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

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

  // Creates a new MongoDB cluster using the specified backup.
  rpc Restore(RestoreClusterRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/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-mongodb/v1/clusters/{cluster_id}:rescheduleMaintenance"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "RescheduleMaintenanceMetadata"
      response: "Cluster"
    };
  }

  // Retrieves logs for the specified MongoDB cluster.
  // See the [Logs](/yandex-mdb-guide/concepts/logs.html) section in the developers guide for detailed logs description.
  rpc ListLogs(ListClusterLogsRequest) returns (ListClusterLogsResponse) {
    option (google.api.http) = {get: "/managed-mongodb/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-mongodb/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-mongodb/v1/clusters/{cluster_id}/operations"};
  }

  // Retrieves the list of available backups for the specified MongoDB cluster.
  rpc ListBackups(ListClusterBackupsRequest) returns (ListClusterBackupsResponse) {
    option (google.api.http) = {get: "/managed-mongodb/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-mongodb/v1/clusters/{cluster_id}/hosts"};
  }

  // Creates new hosts for a cluster.
  rpc AddHosts(AddClusterHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/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-mongodb/v1/clusters/{cluster_id}/hosts:batchDelete"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteClusterHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }

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

  // Enables sharding for the cluster:
  // creates 3 mongoinfra (or 3 mongocfg and 2 mongos) hosts
  // that would support adding and using shards in the cluster.
  rpc EnableSharding(EnableClusterShardingRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/v1/clusters/{cluster_id}:enableSharding"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "EnableClusterShardingMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Returns the specified shard.
  rpc GetShard(GetClusterShardRequest) returns (Shard) {
    option (google.api.http) = {get: "/managed-mongodb/v1/clusters/{cluster_id}/shards/{shard_name}"};
  }

  // Retrieves a list of shards.
  rpc ListShards(ListClusterShardsRequest) returns (ListClusterShardsResponse) {
    option (google.api.http) = {get: "/managed-mongodb/v1/clusters/{cluster_id}/shards"};
  }

  // Creates a new shard.
  rpc AddShard(AddClusterShardRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/v1/clusters/{cluster_id}/shards"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "AddClusterShardMetadata"
      response: "Shard"
    };
  }

  // Deletes the specified shard.
  rpc DeleteShard(DeleteClusterShardRequest) returns (operation.Operation) {
    option (google.api.http) = {delete: "/managed-mongodb/v1/clusters/{cluster_id}/shards/{shard_name}"};
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteClusterShardMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Resetups hosts.
  rpc ResetupHosts(ResetupHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/v1/clusters/{cluster_id}:resetupHosts"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "ResetupHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Restarts hosts.
  rpc RestartHosts(RestartHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/v1/clusters/{cluster_id}:restartHosts"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "RestartHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Stepdown hosts.
  rpc StepdownHosts(StepdownHostsRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/managed-mongodb/v1/clusters/{cluster_id}:stepdownHosts"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "StepdownHostsMetadata"
      response: "google.protobuf.Empty"
    };
  }
}

message GetClusterRequest {
  // ID of the MongoDB 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 MongoDB 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.
  // Acceptable values are 0 to 1000, inclusive. Default value: 100.
  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 MongoDB 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 MongoDB cluster in.
  string folder_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

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

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

  // Custom labels for the MongoDB 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 MongoDB cluster.
  Cluster.Environment environment = 5 [(required) = true];

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

  // Descriptions of databases to be created in the MongoDB cluster.
  repeated DatabaseSpec database_specs = 7 [(size) = ">0"];

  // Descriptions of database users to be created in the MongoDB cluster.
  repeated UserSpec user_specs = 8 [(size) = ">0"];

  // Individual configurations for hosts that should be created for the MongoDB cluster.
  repeated HostSpec host_specs = 9 [(size) = ">0"];

  // 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;
}

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

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

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

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

  // Custom labels for the MongoDB 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;
}

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

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

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

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

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

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

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

message MoveClusterRequest {
  // ID of the MongoDB 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 MongoDB 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 MongoDB cluster to back up.
  // To get the MongoDB cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message BackupClusterMetadata {
  // ID of the MongoDB cluster that is being backed up.
  string cluster_id = 1;
}

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];

  // Name of the new MongoDB cluster. The name must be unique within the folder.
  // The name can't be changed after the MongoDB cluster is created.
  string name = 2 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

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

  // Custom labels for the MongoDB 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 new MongoDB cluster.
  Cluster.Environment environment = 5 [(required) = true];

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

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

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

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

  message RecoveryTargetSpec {
    // Timestamp of the recovery target
    int64 timestamp = 1 [(value) = ">0"];
  }

  // Specification of the moment to which the MongoDB cluster should be restored.
  RecoveryTargetSpec recovery_target_spec = 10;

  // User security groups
  repeated string security_group_ids = 11;

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

message RestoreClusterMetadata {
  // ID of the new MongoDB 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 RescheduleMaintenanceRequest {
  // ID of the MongoDB 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 MongoDB 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 MongoDB cluster to request logs for.
  // To get the MongoDB 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 MongoDB activity.
    MONGOD = 1;
    MONGOS = 2;
    MONGOCFG = 3;
    // MongoDB Enterprise audit logs
    AUDIT = 4;
  }

  // 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.
  // Acceptable values are 0 to 1000, inclusive. Default value: 100.
  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"];
}

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 MongoDB 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 MongoDB activity.
    MONGOD = 1;
    MONGOS = 2;
    MONGOCFG = 3;

    // MongoDB Enterprise audit logs
    AUDIT = 4;
  }

  // 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.severity] 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.severity IN ('E', 'F')`
  string filter = 7 [(length) = "<=1000"];
}

message ListClusterOperationsRequest {
  // ID of the MongoDB 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.
  // Acceptable values are 0 to 1000, inclusive. Default value: 100.
  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 MongoDB 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 MongoDB cluster.
  // To get the MongoDB 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.
  // Acceptable values are 0 to 1000, inclusive. Default value: 100.
  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 MongoDB 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 MongoDB cluster.
  // To get the MongoDB 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.
  // Acceptable values are 0 to 1000, inclusive. Default value: 100.
  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 MongoDB cluster to add hosts to.
  // To get the MongoDB cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

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

message AddClusterHostsMetadata {
  // ID of the MongoDB 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 MongoDB cluster to remove hosts from.
  // To get the MongoDB 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 MongoDB 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 MongoDB cluster to update hosts from.
  // To get the MongoDB 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 MongoDB cluster to update host from.
  string cluster_id = 1;

  // Name of host that are being updated.
  repeated string host_names = 2;
}

message UpdateHostSpec {
  // Names of hosts to update.
  string host_name = 1 [
    (required) = true,
    (length) = "<=253"
  ];

  // Is host hidden in replSet
  google.protobuf.BoolValue hidden = 2;

  // The number of seconds "behind" the primary that this replica set member should "lag"
  google.protobuf.Int64Value secondary_delay_secs = 3;

  // Priority of host for the election in replSet
  google.protobuf.DoubleValue priority = 4;

  // Whether the host should get a public IP address on update.
  bool assign_public_ip = 5;

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

  // Host tags
  map<string, string> tags = 7;
}

message EnableClusterShardingRequest {
  message MongoCfg {
    // Resources for mongocfg hosts.
    Resources resources = 1 [(required) = true];
  }

  message Mongos {
    // Resources for mongos hosts.
    Resources resources = 1 [(required) = true];
  }

  message MongoInfra {
    // Resources for mongoinfra (mongos+mongocfg) hosts.
    Resources resources = 1 [(required) = true];
  }

  // ID of the MongoDB cluster to enable sharding for.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // mongocfg specification for sharding.
  MongoCfg mongocfg = 2;

  // mongos specification for sharding.
  Mongos mongos = 3;

  // Configurations for mongos and mongocfg hosts.
  repeated HostSpec host_specs = 4 [(size) = ">0"];

  // mongos specification for sharding.
  MongoInfra mongoinfra = 5;
}

message EnableClusterShardingMetadata {
  // ID of the MongoDB cluster that sharding is being enabled for.
  string cluster_id = 1;
}

message GetClusterShardRequest {
  // ID of the MongoDB cluster that the shard belongs to.
  // To get the cluster ID use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Name of the MongoDB shard to return.
  // To get the name of the shard use a [ClusterService.ListShards] request.
  string shard_name = 2 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];
}

message ListClusterShardsRequest {
  // ID of the MongoDB cluster to list databases in.
  // To get the 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 [ListClusterShardsResponse.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
  // [ListClusterShardsResponse.next_page_token] returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];
}

message ListClusterShardsResponse {
  // List of MongoDB shards.
  repeated Shard shards = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListClusterShardsRequest.page_size], use the [next_page_token] as the value
  // for the [ListClusterShardsRequest.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 AddClusterShardRequest {
  // ID of the MongoDB cluster to add a shard to.
  // To get the cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

  // Name of the MongoDB shard to create.
  string shard_name = 2 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

  // Configurations for mongod hosts to be created with the shard.
  repeated HostSpec host_specs = 3 [(size) = ">0"];
}

message AddClusterShardMetadata {
  // ID of the MongoDB cluster that a shard is being added to.
  string cluster_id = 1;

  // Name of the shard being added.
  string shard_name = 2;
}

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

  // Name of the MongoDB shard to delete.
  // To get the name of the shard use a [ClusterService.ListShards] request.
  string shard_name = 2 [
    (required) = true,
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];
}

message DeleteClusterShardMetadata {
  // ID of the MongoDB cluster that a shard is being deleted in.
  string cluster_id = 1;

  // Name of the shard being deleted.
  string shard_name = 2;
}

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

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

message ResetupHostsMetadata {
  // Required. ID of the MongoDB cluster.
  string cluster_id = 1;

  // Required. The name of hosts to resetup.
  repeated string host_names = 2;
}

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

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

message RestartHostsMetadata {
  // Required. ID of the MongoDB cluster.
  string cluster_id = 1;

  // Required. The name of hosts to restart.
  repeated string host_names = 2;
}

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

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

message StepdownHostsMetadata {
  // Required. ID of the MongoDB cluster.
  string cluster_id = 1;

  // Required. The name of hosts to resetup.
  repeated string host_names = 2;
}

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 network ID is set in the [Cluster.network_id] field.
  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;

  // Type of the host to be deployed.
  Host.Type type = 4;

  // Name of the shard that the host belongs to.
  string shard_name = 5 [
    (length) = "<=63",
    (pattern) = "[a-zA-Z0-9_-]*"
  ];

  // Is host hidden in replSet
  google.protobuf.BoolValue hidden = 6;

  // The number of seconds "behind" the primary that this replica set member should "lag"
  google.protobuf.Int64Value secondary_delay_secs = 7;

  // Priority of host for the election in replSet
  google.protobuf.DoubleValue priority = 8;

  // Host tags
  map<string, string> tags = 9;
}

message MongodbSpec3_6 {
  message Mongod {
    // Configuration for mongod 3.6 hosts.
    config.MongodConfig3_6 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 3.6 hosts.
    config.MongoCfgConfig3_6 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 3.6 hosts.
    config.MongosConfig3_6 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 3.6 hosts.
    config.MongosConfig3_6 config_mongos = 1;
    config.MongoCfgConfig3_6 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 3.6 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 3.6 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 3.6 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 3.6 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec4_0 {
  message Mongod {
    // Configuration for mongod 4.0 hosts.
    config.MongodConfig4_0 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 4.0 hosts.
    config.MongoCfgConfig4_0 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 4.0 hosts.
    config.MongosConfig4_0 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 4.0 hosts.
    config.MongosConfig4_0 config_mongos = 1;
    config.MongoCfgConfig4_0 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 4.0 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 4.0 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 4.0 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 4.0 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec4_2 {
  message Mongod {
    // Configuration for mongod 4.2 hosts.
    config.MongodConfig4_2 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 4.2 hosts.
    config.MongoCfgConfig4_2 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 4.2 hosts.
    config.MongosConfig4_2 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 4.2 hosts.
    config.MongosConfig4_2 config_mongos = 1;
    config.MongoCfgConfig4_2 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 4.2 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 4.2 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 4.2 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 4.2 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec4_4 {
  message Mongod {
    // Configuration for mongod 4.4 hosts.
    config.MongodConfig4_4 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 4.4 hosts.
    config.MongoCfgConfig4_4 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 4.4 hosts.
    config.MongosConfig4_4 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 4.4 hosts.
    config.MongosConfig4_4 config_mongos = 1;
    config.MongoCfgConfig4_4 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 4.4 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 4.4 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 4.4 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 4.4 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec4_4_enterprise {
  message Mongod {
    // Configuration for mongod 4.4 hosts.
    config.MongodConfig4_4_enterprise config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 4.4 hosts.
    config.MongoCfgConfig4_4_enterprise config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 4.4 hosts.
    config.MongosConfig4_4_enterprise config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 4.4 hosts.
    config.MongosConfig4_4_enterprise config_mongos = 1;
    config.MongoCfgConfig4_4_enterprise config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 4.4 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 4.4 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 4.4 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 4.4 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec5_0 {
  message Mongod {
    // Configuration for mongod 5.0 hosts.
    config.MongodConfig5_0 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 5.0 hosts.
    config.MongoCfgConfig5_0 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 5.0 hosts.
    config.MongosConfig5_0 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 5.0 hosts.
    config.MongosConfig5_0 config_mongos = 1;
    config.MongoCfgConfig5_0 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 5.0 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 5.0 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 5.0 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 5.0 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec5_0_enterprise {
  message Mongod {
    // Configuration for mongod 5.0 hosts.
    config.MongodConfig5_0_enterprise config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 5.0 hosts.
    config.MongoCfgConfig5_0_enterprise config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 5.0 hosts.
    config.MongosConfig5_0_enterprise config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 5.0 hosts.
    config.MongosConfig5_0_enterprise config_mongos = 1;
    config.MongoCfgConfig5_0_enterprise config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 5.0 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 5.0 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 5.0 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 5.0 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec6_0 {
  message Mongod {
    // Configuration for mongod 6.0 hosts.
    config.MongodConfig6_0 config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 6.0 hosts.
    config.MongoCfgConfig6_0 config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 6.0 hosts.
    config.MongosConfig6_0 config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 6.0 hosts.
    config.MongosConfig6_0 config_mongos = 1;
    config.MongoCfgConfig6_0 config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 6.0 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 6.0 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 6.0 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 6.0 hosts.
  MongoInfra mongoinfra = 4;
}

message MongodbSpec6_0_enterprise {
  message Mongod {
    // Configuration for mongod 6.0 hosts.
    config.MongodConfig6_0_enterprise config = 1;

    // Resources allocated to each mongod host.
    Resources resources = 2;
  }

  message MongoCfg {
    // Configuration for mongocfg 6.0 hosts.
    config.MongoCfgConfig6_0_enterprise config = 1;

    // Resources allocated to each mongocfg host.
    Resources resources = 2;
  }

  message Mongos {
    // Configuration for mongos 6.0 hosts.
    config.MongosConfig6_0_enterprise config = 1;

    // Resources allocated to each mongos host.
    Resources resources = 2;
  }

  message MongoInfra {
    // Configuration for mongoinfra 6.0 hosts.
    config.MongosConfig6_0_enterprise config_mongos = 1;
    config.MongoCfgConfig6_0_enterprise config_mongocfg = 2;

    // Resources allocated to each mongoinfra (mongos+mongocfg) host.
    Resources resources = 3;
  }

  // Configuration and resource allocation for mongod 6.0 hosts.
  Mongod mongod = 1;

  // Configuration and resource allocation for mongocfg 6.0 hosts.
  MongoCfg mongocfg = 2;

  // Configuration and resource allocation for mongos 6.0 hosts.
  Mongos mongos = 3;

  // Configuration and resource allocation for mongoinfra (mongos+mongocfg) 6.0 hosts.
  MongoInfra mongoinfra = 4;
}

message ConfigSpec {
  // Version of MongoDB used in the cluster. Possible values: `3.6`, `4.0`, `4.2`, `4.4`, `4.4-enterprise`, `5.0`, `5.0-enterprise`, `6.0`, `6.0-enterprise`.
  string version = 1;

  // MongoDB feature compatibility version. See usage details in [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/).
  //
  // Possible values:
  // * `3.6` - persist data compatibility for version 3.6. After setting this option the data will not be compatible with 3.4 or older.
  // * `4.0` - persist data compatibility for version 4.0. After setting this option the data will not be compatible with 3.6 or older.
  // * `4.2` - persist data compatibility for version 4.2. After setting this option the data will not be compatible with 4.0 or older.
  // * `4.4` - persist data compatibility for version 4.4. After setting this option the data will not be compatible with 4.2 or older.
  // * `5.0` - persist data compatibility for version 5.0. After setting this option the data will not be compatible with 4.4 or older.
  // * `6.0` - persist data compatibility for version 6.0. After setting this option the data will not be compatible with 5.0 or older.
  string feature_compatibility_version = 5;

  oneof mongodb_spec {
    // Configuration and resource allocation for a MongoDB 3.6 cluster.
    MongodbSpec3_6 mongodb_spec_3_6 = 2 [json_name = "mongodbSpec_3_6"];

    // Configuration and resource allocation for a MongoDB 4.0 cluster.
    MongodbSpec4_0 mongodb_spec_4_0 = 4 [json_name = "mongodbSpec_4_0"];

    // Configuration and resource allocation for a MongoDB 4.2 cluster.
    MongodbSpec4_2 mongodb_spec_4_2 = 7 [json_name = "mongodbSpec_4_2"];

    // Configuration and resource allocation for a MongoDB 4.4 cluster.
    MongodbSpec4_4 mongodb_spec_4_4 = 8 [json_name = "mongodbSpec_4_4"];

    // Configuration and resource allocation for a MongoDB 5.0 cluster.
    MongodbSpec5_0 mongodb_spec_5_0 = 10 [json_name = "mongodbSpec_5_0"];

    // Configuration and resource allocation for a MongoDB 6.0 cluster.
    MongodbSpec6_0 mongodb_spec_6_0 = 14 [json_name = "mongodbSpec_6_0"];

    // Configuration and resource allocation for a MongoDB 4.4 Enterprise cluster.
    MongodbSpec4_4_enterprise mongodb_spec_4_4_enterprise = 11 [json_name = "mongodbSpec_4_4_enterprise"];

    // Configuration and resource allocation for a MongoDB 5.0 Enterprise cluster.
    MongodbSpec5_0_enterprise mongodb_spec_5_0_enterprise = 12 [json_name = "mongodbSpec_5_0_enterprise"];

    // Configuration and resource allocation for a MongoDB 6.0 Enterprise cluster.
    MongodbSpec6_0_enterprise mongodb_spec_6_0_enterprise = 15 [json_name = "mongodbSpec_6_0_enterprise"];
  }

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

  // Retain period of automatically created backup in days
  google.protobuf.Int64Value backup_retain_period_days = 9 [(value) = "7-35"];

  // Performance Diagnosics configuration
  PerformanceDiagnosticsConfig performance_diagnostics = 13;

  // Access policy to DB
  Access access = 6;
}