ydb_grpc_bindings/generated/
ydb.cms.rs

1/// A set of uniform storage units.
2/// Single storage unit can be thought of as a reserved part of a RAID.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct StorageUnits {
6    /// Required. Kind of the storage unit. Determine guarantees
7    /// for all main unit parameters: used hard disk type, capacity
8    /// throughput, IOPS etc.
9    #[prost(string, tag = "1")]
10    pub unit_kind: ::prost::alloc::string::String,
11    /// Required. The number of units in this set.
12    #[prost(uint64, tag = "2")]
13    pub count: u64,
14}
15/// A set of uniform computational units.
16#[allow(clippy::derive_partial_eq_without_eq)]
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct ComputationalUnits {
19    /// Required. Kind of the computational unit. Determine main
20    /// unit parameters like available memory, CPU, etc.
21    #[prost(string, tag = "1")]
22    pub unit_kind: ::prost::alloc::string::String,
23    /// The availability zone all unit should be located in.
24    /// By default any availability zone can be used.
25    #[prost(string, tag = "2")]
26    pub availability_zone: ::prost::alloc::string::String,
27    /// Required. The number of units in this set.
28    #[prost(uint64, tag = "3")]
29    pub count: u64,
30}
31/// Computational unit allocated for database. Used to register
32/// externally allocated computational resources in CMS.
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct AllocatedComputationalUnit {
36    /// Required. Computational unit host name.
37    #[prost(string, tag = "1")]
38    pub host: ::prost::alloc::string::String,
39    /// Required. Computational unit port.
40    #[prost(uint32, tag = "2")]
41    pub port: u32,
42    /// Required. Computational unit kind.
43    #[prost(string, tag = "3")]
44    pub unit_kind: ::prost::alloc::string::String,
45}
46/// A set of computational and storage resources.
47#[allow(clippy::derive_partial_eq_without_eq)]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct Resources {
50    /// Storage resources.
51    #[prost(message, repeated, tag = "1")]
52    pub storage_units: ::prost::alloc::vec::Vec<StorageUnits>,
53    /// Computational resources.
54    #[prost(message, repeated, tag = "2")]
55    pub computational_units: ::prost::alloc::vec::Vec<ComputationalUnits>,
56}
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct ServerlessResources {
60    /// Full path to shared database's home dir whose resources will be used.
61    #[prost(string, tag = "1")]
62    pub shared_database_path: ::prost::alloc::string::String,
63}
64#[allow(clippy::derive_partial_eq_without_eq)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct DatabaseOptions {
67    /// Do not initialize services required for transactions processing.
68    #[prost(bool, tag = "1")]
69    pub disable_tx_service: bool,
70    /// Old-style database, do not create external schemeshard for database
71    #[prost(bool, tag = "2")]
72    pub disable_external_subdomain: bool,
73    /// Transaction plan resolution in milliseconds
74    #[prost(uint32, tag = "3")]
75    pub plan_resolution: u32,
76}
77/// A set of quotas for schema operations
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct SchemaOperationQuotas {
81    /// Leaky bucket based quotas
82    #[prost(message, repeated, tag = "1")]
83    pub leaky_bucket_quotas: ::prost::alloc::vec::Vec<
84        schema_operation_quotas::LeakyBucket,
85    >,
86}
87/// Nested message and enum types in `SchemaOperationQuotas`.
88pub mod schema_operation_quotas {
89    /// A single quota based on leaky bucket
90    #[allow(clippy::derive_partial_eq_without_eq)]
91    #[derive(Clone, PartialEq, ::prost::Message)]
92    pub struct LeakyBucket {
93        /// Bucket size, e.g. <1000> per day
94        #[prost(double, tag = "1")]
95        pub bucket_size: f64,
96        /// Bucket duration in seconds, e.g. 1000 per <day>
97        #[prost(uint64, tag = "2")]
98        pub bucket_seconds: u64,
99    }
100}
101/// A set of quotas for the database
102#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct DatabaseQuotas {
105    /// A maximum data size in bytes, new data will be rejected when exceeded
106    #[prost(uint64, tag = "1")]
107    pub data_size_hard_quota: u64,
108    /// An optional size in bytes (lower than data_size_hard_quota). When data
109    /// size becomes lower than this value new data ingestion is re-enabled
110    /// again. This is useful to help avoid database from rapidly entering and
111    /// exiting from the overloaded state.
112    #[prost(uint64, tag = "2")]
113    pub data_size_soft_quota: u64,
114    /// A maximum count of shards in all data streams.
115    #[prost(uint64, tag = "3")]
116    pub data_stream_shards_quota: u64,
117    /// A maximum storage that will be reserved for all data stream shards.
118    #[prost(uint64, tag = "5")]
119    pub data_stream_reserved_storage_quota: u64,
120    /// A minimum value of `TtlSettings.run_interval_seconds` that can be specified.
121    /// Default is 1800 (15 minutes).
122    #[prost(uint32, tag = "4")]
123    pub ttl_min_run_internal_seconds: u32,
124}
125/// Request to create a new database. For successfull creation
126/// specified database shouldn't exist. At least one storage
127/// unit should be requested for the database.
128#[allow(clippy::derive_partial_eq_without_eq)]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CreateDatabaseRequest {
131    #[prost(message, optional, tag = "1")]
132    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
133    /// Required. Full path to database's home dir. Used as database ID.
134    #[prost(string, tag = "2")]
135    pub path: ::prost::alloc::string::String,
136    /// Additional database options.
137    #[prost(message, optional, tag = "4")]
138    pub options: ::core::option::Option<DatabaseOptions>,
139    /// Attach attributes to database.
140    #[prost(map = "string, string", tag = "5")]
141    pub attributes: ::std::collections::HashMap<
142        ::prost::alloc::string::String,
143        ::prost::alloc::string::String,
144    >,
145    /// Optional quotas for schema operations
146    #[prost(message, optional, tag = "8")]
147    pub schema_operation_quotas: ::core::option::Option<SchemaOperationQuotas>,
148    /// Optional idempotency key
149    #[prost(string, tag = "9")]
150    pub idempotency_key: ::prost::alloc::string::String,
151    /// Optional quotas for the database
152    #[prost(message, optional, tag = "10")]
153    pub database_quotas: ::core::option::Option<DatabaseQuotas>,
154    #[prost(oneof = "create_database_request::ResourcesKind", tags = "3, 6, 7")]
155    pub resources_kind: ::core::option::Option<create_database_request::ResourcesKind>,
156}
157/// Nested message and enum types in `CreateDatabaseRequest`.
158pub mod create_database_request {
159    #[allow(clippy::derive_partial_eq_without_eq)]
160    #[derive(Clone, PartialEq, ::prost::Oneof)]
161    pub enum ResourcesKind {
162        /// Resources to allocate for database by CMS.
163        #[prost(message, tag = "3")]
164        Resources(super::Resources),
165        /// Shared resources can be used by serverless databases.
166        #[prost(message, tag = "6")]
167        SharedResources(super::Resources),
168        /// If specified, the created database will be "serverless".
169        #[prost(message, tag = "7")]
170        ServerlessResources(super::ServerlessResources),
171    }
172}
173#[allow(clippy::derive_partial_eq_without_eq)]
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct CreateDatabaseResponse {
176    #[prost(message, optional, tag = "1")]
177    pub operation: ::core::option::Option<super::operations::Operation>,
178}
179/// Get current database status.
180#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct GetDatabaseStatusRequest {
183    /// Required. Full path to database's home dir.
184    #[prost(string, tag = "1")]
185    pub path: ::prost::alloc::string::String,
186    /// Operation parameters
187    #[prost(message, optional, tag = "2")]
188    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
189}
190#[allow(clippy::derive_partial_eq_without_eq)]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct GetDatabaseStatusResponse {
193    /// operation.result holds GetDatabaseStatusResult
194    #[prost(message, optional, tag = "1")]
195    pub operation: ::core::option::Option<super::operations::Operation>,
196}
197#[allow(clippy::derive_partial_eq_without_eq)]
198#[derive(Clone, PartialEq, ::prost::Message)]
199pub struct GetDatabaseStatusResult {
200    /// Full path to database's home dir.
201    #[prost(string, tag = "1")]
202    pub path: ::prost::alloc::string::String,
203    /// Current database state.
204    #[prost(enumeration = "get_database_status_result::State", tag = "2")]
205    pub state: i32,
206    /// Database resources allocated by CMS.
207    #[prost(message, optional, tag = "4")]
208    pub allocated_resources: ::core::option::Option<Resources>,
209    /// Externally allocated database resources registered in CMS.
210    #[prost(message, repeated, tag = "5")]
211    pub registered_resources: ::prost::alloc::vec::Vec<AllocatedComputationalUnit>,
212    /// Current database generation. Incremented at each successful
213    /// alter request.
214    #[prost(uint64, tag = "6")]
215    pub generation: u64,
216    /// Current quotas for schema operations
217    #[prost(message, optional, tag = "9")]
218    pub schema_operation_quotas: ::core::option::Option<SchemaOperationQuotas>,
219    /// Current quotas for the database
220    #[prost(message, optional, tag = "10")]
221    pub database_quotas: ::core::option::Option<DatabaseQuotas>,
222    #[prost(oneof = "get_database_status_result::ResourcesKind", tags = "3, 7, 8")]
223    pub resources_kind: ::core::option::Option<
224        get_database_status_result::ResourcesKind,
225    >,
226}
227/// Nested message and enum types in `GetDatabaseStatusResult`.
228pub mod get_database_status_result {
229    #[derive(
230        Clone,
231        Copy,
232        Debug,
233        PartialEq,
234        Eq,
235        Hash,
236        PartialOrd,
237        Ord,
238        ::prost::Enumeration
239    )]
240    #[repr(i32)]
241    pub enum State {
242        Unspecified = 0,
243        Creating = 1,
244        Running = 2,
245        Removing = 3,
246        PendingResources = 4,
247        Configuring = 5,
248    }
249    impl State {
250        /// String value of the enum field names used in the ProtoBuf definition.
251        ///
252        /// The values are not transformed in any way and thus are considered stable
253        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
254        pub fn as_str_name(&self) -> &'static str {
255            match self {
256                State::Unspecified => "STATE_UNSPECIFIED",
257                State::Creating => "CREATING",
258                State::Running => "RUNNING",
259                State::Removing => "REMOVING",
260                State::PendingResources => "PENDING_RESOURCES",
261                State::Configuring => "CONFIGURING",
262            }
263        }
264        /// Creates an enum from field names used in the ProtoBuf definition.
265        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
266            match value {
267                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
268                "CREATING" => Some(Self::Creating),
269                "RUNNING" => Some(Self::Running),
270                "REMOVING" => Some(Self::Removing),
271                "PENDING_RESOURCES" => Some(Self::PendingResources),
272                "CONFIGURING" => Some(Self::Configuring),
273                _ => None,
274            }
275        }
276    }
277    #[allow(clippy::derive_partial_eq_without_eq)]
278    #[derive(Clone, PartialEq, ::prost::Oneof)]
279    pub enum ResourcesKind {
280        /// Database resources requested for allocation.
281        #[prost(message, tag = "3")]
282        RequiredResources(super::Resources),
283        #[prost(message, tag = "7")]
284        RequiredSharedResources(super::Resources),
285        #[prost(message, tag = "8")]
286        ServerlessResources(super::ServerlessResources),
287    }
288}
289/// Change resources allocated for database.
290#[allow(clippy::derive_partial_eq_without_eq)]
291#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct AlterDatabaseRequest {
293    /// Required. Full path to database's home dir.
294    #[prost(string, tag = "1")]
295    pub path: ::prost::alloc::string::String,
296    /// Additional computational units to allocate for database.
297    #[prost(message, repeated, tag = "2")]
298    pub computational_units_to_add: ::prost::alloc::vec::Vec<ComputationalUnits>,
299    /// Computational units to deallocate.
300    #[prost(message, repeated, tag = "3")]
301    pub computational_units_to_remove: ::prost::alloc::vec::Vec<ComputationalUnits>,
302    /// Additional storage units to allocate for database.
303    #[prost(message, repeated, tag = "4")]
304    pub storage_units_to_add: ::prost::alloc::vec::Vec<StorageUnits>,
305    /// Externally allocated computational units to register for database.
306    #[prost(message, repeated, tag = "5")]
307    pub computational_units_to_register: ::prost::alloc::vec::Vec<
308        AllocatedComputationalUnit,
309    >,
310    /// Externally allocated computational units to deregister.
311    #[prost(message, repeated, tag = "6")]
312    pub computational_units_to_deregister: ::prost::alloc::vec::Vec<
313        AllocatedComputationalUnit,
314    >,
315    /// Operation parameters.
316    #[prost(message, optional, tag = "7")]
317    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
318    /// Current generation of altered database.
319    #[prost(uint64, tag = "8")]
320    pub generation: u64,
321    /// Change quotas for schema operations
322    #[prost(message, optional, tag = "9")]
323    pub schema_operation_quotas: ::core::option::Option<SchemaOperationQuotas>,
324    /// Optional idempotency key
325    #[prost(string, tag = "10")]
326    pub idempotency_key: ::prost::alloc::string::String,
327    /// Change quotas for the database
328    #[prost(message, optional, tag = "11")]
329    pub database_quotas: ::core::option::Option<DatabaseQuotas>,
330    /// Alter attributes. Leave the value blank to drop an attribute.
331    #[prost(map = "string, string", tag = "12")]
332    pub alter_attributes: ::std::collections::HashMap<
333        ::prost::alloc::string::String,
334        ::prost::alloc::string::String,
335    >,
336}
337#[allow(clippy::derive_partial_eq_without_eq)]
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct AlterDatabaseResponse {
340    #[prost(message, optional, tag = "1")]
341    pub operation: ::core::option::Option<super::operations::Operation>,
342}
343/// List all databases known by CMS.
344#[allow(clippy::derive_partial_eq_without_eq)]
345#[derive(Clone, PartialEq, ::prost::Message)]
346pub struct ListDatabasesRequest {
347    /// Operation parameters
348    #[prost(message, optional, tag = "1")]
349    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
350}
351#[allow(clippy::derive_partial_eq_without_eq)]
352#[derive(Clone, PartialEq, ::prost::Message)]
353pub struct ListDatabasesResponse {
354    /// operation.result holds ListDatabasesResult
355    #[prost(message, optional, tag = "1")]
356    pub operation: ::core::option::Option<super::operations::Operation>,
357}
358#[allow(clippy::derive_partial_eq_without_eq)]
359#[derive(Clone, PartialEq, ::prost::Message)]
360pub struct ListDatabasesResult {
361    #[prost(string, repeated, tag = "1")]
362    pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
363}
364/// Completely remove database and all his data.
365#[allow(clippy::derive_partial_eq_without_eq)]
366#[derive(Clone, PartialEq, ::prost::Message)]
367pub struct RemoveDatabaseRequest {
368    /// Required. Full path to database's home dir.
369    #[prost(string, tag = "1")]
370    pub path: ::prost::alloc::string::String,
371    #[prost(message, optional, tag = "2")]
372    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
373}
374#[allow(clippy::derive_partial_eq_without_eq)]
375#[derive(Clone, PartialEq, ::prost::Message)]
376pub struct RemoveDatabaseResponse {
377    #[prost(message, optional, tag = "1")]
378    pub operation: ::core::option::Option<super::operations::Operation>,
379}
380#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct StorageUnitDescription {
383    #[prost(string, tag = "1")]
384    pub kind: ::prost::alloc::string::String,
385    #[prost(map = "string, string", tag = "2")]
386    pub labels: ::std::collections::HashMap<
387        ::prost::alloc::string::String,
388        ::prost::alloc::string::String,
389    >,
390}
391#[allow(clippy::derive_partial_eq_without_eq)]
392#[derive(Clone, PartialEq, ::prost::Message)]
393pub struct AvailabilityZoneDescription {
394    #[prost(string, tag = "1")]
395    pub name: ::prost::alloc::string::String,
396    #[prost(map = "string, string", tag = "2")]
397    pub labels: ::std::collections::HashMap<
398        ::prost::alloc::string::String,
399        ::prost::alloc::string::String,
400    >,
401}
402#[allow(clippy::derive_partial_eq_without_eq)]
403#[derive(Clone, PartialEq, ::prost::Message)]
404pub struct ComputationalUnitDescription {
405    #[prost(string, tag = "1")]
406    pub kind: ::prost::alloc::string::String,
407    #[prost(map = "string, string", tag = "2")]
408    pub labels: ::std::collections::HashMap<
409        ::prost::alloc::string::String,
410        ::prost::alloc::string::String,
411    >,
412    #[prost(string, repeated, tag = "3")]
413    pub allowed_availability_zones: ::prost::alloc::vec::Vec<
414        ::prost::alloc::string::String,
415    >,
416}
417#[allow(clippy::derive_partial_eq_without_eq)]
418#[derive(Clone, PartialEq, ::prost::Message)]
419pub struct DescribeDatabaseOptionsRequest {
420    /// Operation parameters
421    #[prost(message, optional, tag = "1")]
422    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
423}
424#[allow(clippy::derive_partial_eq_without_eq)]
425#[derive(Clone, PartialEq, ::prost::Message)]
426pub struct DescribeDatabaseOptionsResponse {
427    /// operation.result holds DescribeDatabaseOptionsResult
428    #[prost(message, optional, tag = "1")]
429    pub operation: ::core::option::Option<super::operations::Operation>,
430}
431#[allow(clippy::derive_partial_eq_without_eq)]
432#[derive(Clone, PartialEq, ::prost::Message)]
433pub struct DescribeDatabaseOptionsResult {
434    #[prost(message, repeated, tag = "1")]
435    pub storage_units: ::prost::alloc::vec::Vec<StorageUnitDescription>,
436    #[prost(message, repeated, tag = "2")]
437    pub availability_zones: ::prost::alloc::vec::Vec<AvailabilityZoneDescription>,
438    #[prost(message, repeated, tag = "3")]
439    pub computational_units: ::prost::alloc::vec::Vec<ComputationalUnitDescription>,
440}