googleapis_tonic_google_cloud_redis_v1/vec_u8_hash_map/google.cloud.redis.v1.rs
1// This file is @generated by prost-build.
2/// Node specific properties.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct NodeInfo {
5 /// Output only. Node identifying string. e.g. 'node-0', 'node-1'
6 #[prost(string, tag = "1")]
7 pub id: ::prost::alloc::string::String,
8 /// Output only. Location of the node.
9 #[prost(string, tag = "2")]
10 pub zone: ::prost::alloc::string::String,
11}
12/// A Memorystore for Redis instance.
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct Instance {
15 /// Required. Unique name of the resource in this scope including project and
16 /// location using the form:
17 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
18 ///
19 /// Note: Redis instances are managed and addressed at regional level so
20 /// location_id here refers to a GCP region; however, users may choose which
21 /// specific zone (or collection of zones for cross-zone instances) an instance
22 /// should be provisioned in. Refer to
23 /// \[location_id\]\[google.cloud.redis.v1.Instance.location_id\] and
24 /// \[alternative_location_id\]\[google.cloud.redis.v1.Instance.alternative_location_id\]
25 /// fields for more details.
26 #[prost(string, tag = "1")]
27 pub name: ::prost::alloc::string::String,
28 /// An arbitrary and optional user-provided name for the instance.
29 #[prost(string, tag = "2")]
30 pub display_name: ::prost::alloc::string::String,
31 /// Resource labels to represent user provided metadata
32 #[prost(map = "string, string", tag = "3")]
33 pub labels: ::std::collections::HashMap<
34 ::prost::alloc::string::String,
35 ::prost::alloc::string::String,
36 >,
37 /// Optional. The zone where the instance will be provisioned. If not provided,
38 /// the service will choose a zone from the specified region for the instance.
39 /// For standard tier, additional nodes will be added across multiple zones for
40 /// protection against zonal failures. If specified, at least one node will be
41 /// provisioned in this zone.
42 #[prost(string, tag = "4")]
43 pub location_id: ::prost::alloc::string::String,
44 /// Optional. If specified, at least one node will be provisioned in this zone
45 /// in addition to the zone specified in location_id. Only applicable to
46 /// standard tier. If provided, it must be a different zone from the one
47 /// provided in \[location_id\]. Additional nodes beyond the first 2 will be
48 /// placed in zones selected by the service.
49 #[prost(string, tag = "5")]
50 pub alternative_location_id: ::prost::alloc::string::String,
51 /// Optional. The version of Redis software.
52 /// If not provided, latest supported version will be used. Currently, the
53 /// supported values are:
54 ///
55 /// * `REDIS_3_2` for Redis 3.2 compatibility
56 /// * `REDIS_4_0` for Redis 4.0 compatibility (default)
57 /// * `REDIS_5_0` for Redis 5.0 compatibility
58 /// * `REDIS_6_X` for Redis 6.x compatibility
59 #[prost(string, tag = "7")]
60 pub redis_version: ::prost::alloc::string::String,
61 /// Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses
62 /// that are reserved for this instance. Range must
63 /// be unique and non-overlapping with existing subnets in an authorized
64 /// network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP
65 /// address ranges associated with this private service access connection.
66 /// If not provided, the service will choose an unused /29 block, for
67 /// example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED
68 /// the default block size is /28.
69 #[prost(string, tag = "9")]
70 pub reserved_ip_range: ::prost::alloc::string::String,
71 /// Optional. Additional IP range for node placement. Required when enabling
72 /// read replicas on an existing instance. For DIRECT_PEERING mode value must
73 /// be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode
74 /// value must be the name of an allocated address range associated with the
75 /// private service access connection, or "auto".
76 #[prost(string, tag = "30")]
77 pub secondary_ip_range: ::prost::alloc::string::String,
78 /// Output only. Hostname or IP address of the exposed Redis endpoint used by
79 /// clients to connect to the service.
80 #[prost(string, tag = "10")]
81 pub host: ::prost::alloc::string::String,
82 /// Output only. The port number of the exposed Redis endpoint.
83 #[prost(int32, tag = "11")]
84 pub port: i32,
85 /// Output only. The current zone where the Redis primary node is located. In
86 /// basic tier, this will always be the same as \[location_id\]. In
87 /// standard tier, this can be the zone of any node in the instance.
88 #[prost(string, tag = "12")]
89 pub current_location_id: ::prost::alloc::string::String,
90 /// Output only. The time the instance was created.
91 #[prost(message, optional, tag = "13")]
92 pub create_time: ::core::option::Option<::prost_types::Timestamp>,
93 /// Output only. The current state of this instance.
94 #[prost(enumeration = "instance::State", tag = "14")]
95 pub state: i32,
96 /// Output only. Additional information about the current status of this
97 /// instance, if available.
98 #[prost(string, tag = "15")]
99 pub status_message: ::prost::alloc::string::String,
100 /// Optional. Redis configuration parameters, according to
101 /// <http://redis.io/topics/config.> Currently, the only supported parameters
102 /// are:
103 ///
104 /// Redis version 3.2 and newer:
105 ///
106 /// * maxmemory-policy
107 /// * notify-keyspace-events
108 ///
109 /// Redis version 4.0 and newer:
110 ///
111 /// * activedefrag
112 /// * lfu-decay-time
113 /// * lfu-log-factor
114 /// * maxmemory-gb
115 ///
116 /// Redis version 5.0 and newer:
117 ///
118 /// * stream-node-max-bytes
119 /// * stream-node-max-entries
120 #[prost(map = "string, string", tag = "16")]
121 pub redis_configs: ::std::collections::HashMap<
122 ::prost::alloc::string::String,
123 ::prost::alloc::string::String,
124 >,
125 /// Required. The service tier of the instance.
126 #[prost(enumeration = "instance::Tier", tag = "17")]
127 pub tier: i32,
128 /// Required. Redis memory size in GiB.
129 #[prost(int32, tag = "18")]
130 pub memory_size_gb: i32,
131 /// Optional. The full name of the Google Compute Engine
132 /// [network](<https://cloud.google.com/vpc/docs/vpc>) to which the
133 /// instance is connected. If left unspecified, the `default` network
134 /// will be used.
135 #[prost(string, tag = "20")]
136 pub authorized_network: ::prost::alloc::string::String,
137 /// Output only. Cloud IAM identity used by import / export operations to
138 /// transfer data to/from Cloud Storage. Format is
139 /// "serviceAccount:\<service_account_email>". The value may change over time
140 /// for a given instance so should be checked before each import/export
141 /// operation.
142 #[prost(string, tag = "21")]
143 pub persistence_iam_identity: ::prost::alloc::string::String,
144 /// Optional. The network connect mode of the Redis instance.
145 /// If not provided, the connect mode defaults to DIRECT_PEERING.
146 #[prost(enumeration = "instance::ConnectMode", tag = "22")]
147 pub connect_mode: i32,
148 /// Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If
149 /// set to "true" AUTH is enabled on the instance. Default value is "false"
150 /// meaning AUTH is disabled.
151 #[prost(bool, tag = "23")]
152 pub auth_enabled: bool,
153 /// Output only. List of server CA certificates for the instance.
154 #[prost(message, repeated, tag = "25")]
155 pub server_ca_certs: ::prost::alloc::vec::Vec<TlsCertificate>,
156 /// Optional. The TLS mode of the Redis instance.
157 /// If not provided, TLS is disabled for the instance.
158 #[prost(enumeration = "instance::TransitEncryptionMode", tag = "26")]
159 pub transit_encryption_mode: i32,
160 /// Optional. The maintenance policy for the instance. If not provided,
161 /// maintenance events can be performed at any time.
162 #[prost(message, optional, tag = "27")]
163 pub maintenance_policy: ::core::option::Option<MaintenancePolicy>,
164 /// Output only. Date and time of upcoming maintenance events which have been
165 /// scheduled.
166 #[prost(message, optional, tag = "28")]
167 pub maintenance_schedule: ::core::option::Option<MaintenanceSchedule>,
168 /// Optional. The number of replica nodes. The valid range for the Standard
169 /// Tier with read replicas enabled is \[1-5\] and defaults to 2. If read
170 /// replicas are not enabled for a Standard Tier instance, the only valid value
171 /// is 1 and the default is 1. The valid value for basic tier is 0 and the
172 /// default is also 0.
173 #[prost(int32, tag = "31")]
174 pub replica_count: i32,
175 /// Output only. Info per node.
176 #[prost(message, repeated, tag = "32")]
177 pub nodes: ::prost::alloc::vec::Vec<NodeInfo>,
178 /// Output only. Hostname or IP address of the exposed readonly Redis
179 /// endpoint. Standard tier only. Targets all healthy replica nodes in
180 /// instance. Replication is asynchronous and replica nodes will exhibit some
181 /// lag behind the primary. Write requests must target 'host'.
182 #[prost(string, tag = "33")]
183 pub read_endpoint: ::prost::alloc::string::String,
184 /// Output only. The port number of the exposed readonly redis
185 /// endpoint. Standard tier only. Write requests should target 'port'.
186 #[prost(int32, tag = "34")]
187 pub read_endpoint_port: i32,
188 /// Optional. Read replicas mode for the instance. Defaults to
189 /// READ_REPLICAS_DISABLED.
190 #[prost(enumeration = "instance::ReadReplicasMode", tag = "35")]
191 pub read_replicas_mode: i32,
192 /// Optional. The KMS key reference that the customer provides when trying to
193 /// create the instance.
194 #[prost(string, tag = "36")]
195 pub customer_managed_key: ::prost::alloc::string::String,
196 /// Optional. Persistence configuration parameters
197 #[prost(message, optional, tag = "37")]
198 pub persistence_config: ::core::option::Option<PersistenceConfig>,
199 /// Optional. reasons that causes instance in "SUSPENDED" state.
200 #[prost(
201 enumeration = "instance::SuspensionReason",
202 repeated,
203 packed = "false",
204 tag = "38"
205 )]
206 pub suspension_reasons: ::prost::alloc::vec::Vec<i32>,
207 /// Optional. The self service update maintenance version.
208 /// The version is date based such as "20210712_00_00".
209 #[prost(string, tag = "39")]
210 pub maintenance_version: ::prost::alloc::string::String,
211 /// Optional. The available maintenance versions that an instance could update
212 /// to.
213 #[prost(string, repeated, tag = "40")]
214 pub available_maintenance_versions: ::prost::alloc::vec::Vec<
215 ::prost::alloc::string::String,
216 >,
217}
218/// Nested message and enum types in `Instance`.
219pub mod instance {
220 /// Represents the different states of a Redis instance.
221 #[derive(
222 Clone,
223 Copy,
224 Debug,
225 PartialEq,
226 Eq,
227 Hash,
228 PartialOrd,
229 Ord,
230 ::prost::Enumeration
231 )]
232 #[repr(i32)]
233 pub enum State {
234 /// Not set.
235 Unspecified = 0,
236 /// Redis instance is being created.
237 Creating = 1,
238 /// Redis instance has been created and is fully usable.
239 Ready = 2,
240 /// Redis instance configuration is being updated. Certain kinds of updates
241 /// may cause the instance to become unusable while the update is in
242 /// progress.
243 Updating = 3,
244 /// Redis instance is being deleted.
245 Deleting = 4,
246 /// Redis instance is being repaired and may be unusable.
247 Repairing = 5,
248 /// Maintenance is being performed on this Redis instance.
249 Maintenance = 6,
250 /// Redis instance is importing data (availability may be affected).
251 Importing = 8,
252 /// Redis instance is failing over (availability may be affected).
253 FailingOver = 9,
254 }
255 impl State {
256 /// String value of the enum field names used in the ProtoBuf definition.
257 ///
258 /// The values are not transformed in any way and thus are considered stable
259 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
260 pub fn as_str_name(&self) -> &'static str {
261 match self {
262 Self::Unspecified => "STATE_UNSPECIFIED",
263 Self::Creating => "CREATING",
264 Self::Ready => "READY",
265 Self::Updating => "UPDATING",
266 Self::Deleting => "DELETING",
267 Self::Repairing => "REPAIRING",
268 Self::Maintenance => "MAINTENANCE",
269 Self::Importing => "IMPORTING",
270 Self::FailingOver => "FAILING_OVER",
271 }
272 }
273 /// Creates an enum from field names used in the ProtoBuf definition.
274 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
275 match value {
276 "STATE_UNSPECIFIED" => Some(Self::Unspecified),
277 "CREATING" => Some(Self::Creating),
278 "READY" => Some(Self::Ready),
279 "UPDATING" => Some(Self::Updating),
280 "DELETING" => Some(Self::Deleting),
281 "REPAIRING" => Some(Self::Repairing),
282 "MAINTENANCE" => Some(Self::Maintenance),
283 "IMPORTING" => Some(Self::Importing),
284 "FAILING_OVER" => Some(Self::FailingOver),
285 _ => None,
286 }
287 }
288 }
289 /// Available service tiers to choose from
290 #[derive(
291 Clone,
292 Copy,
293 Debug,
294 PartialEq,
295 Eq,
296 Hash,
297 PartialOrd,
298 Ord,
299 ::prost::Enumeration
300 )]
301 #[repr(i32)]
302 pub enum Tier {
303 /// Not set.
304 Unspecified = 0,
305 /// BASIC tier: standalone instance
306 Basic = 1,
307 /// STANDARD_HA tier: highly available primary/replica instances
308 StandardHa = 3,
309 }
310 impl Tier {
311 /// String value of the enum field names used in the ProtoBuf definition.
312 ///
313 /// The values are not transformed in any way and thus are considered stable
314 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
315 pub fn as_str_name(&self) -> &'static str {
316 match self {
317 Self::Unspecified => "TIER_UNSPECIFIED",
318 Self::Basic => "BASIC",
319 Self::StandardHa => "STANDARD_HA",
320 }
321 }
322 /// Creates an enum from field names used in the ProtoBuf definition.
323 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
324 match value {
325 "TIER_UNSPECIFIED" => Some(Self::Unspecified),
326 "BASIC" => Some(Self::Basic),
327 "STANDARD_HA" => Some(Self::StandardHa),
328 _ => None,
329 }
330 }
331 }
332 /// Available connection modes.
333 #[derive(
334 Clone,
335 Copy,
336 Debug,
337 PartialEq,
338 Eq,
339 Hash,
340 PartialOrd,
341 Ord,
342 ::prost::Enumeration
343 )]
344 #[repr(i32)]
345 pub enum ConnectMode {
346 /// Not set.
347 Unspecified = 0,
348 /// Connect via direct peering to the Memorystore for Redis hosted service.
349 DirectPeering = 1,
350 /// Connect your Memorystore for Redis instance using Private Service
351 /// Access. Private services access provides an IP address range for multiple
352 /// Google Cloud services, including Memorystore.
353 PrivateServiceAccess = 2,
354 }
355 impl ConnectMode {
356 /// String value of the enum field names used in the ProtoBuf definition.
357 ///
358 /// The values are not transformed in any way and thus are considered stable
359 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
360 pub fn as_str_name(&self) -> &'static str {
361 match self {
362 Self::Unspecified => "CONNECT_MODE_UNSPECIFIED",
363 Self::DirectPeering => "DIRECT_PEERING",
364 Self::PrivateServiceAccess => "PRIVATE_SERVICE_ACCESS",
365 }
366 }
367 /// Creates an enum from field names used in the ProtoBuf definition.
368 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
369 match value {
370 "CONNECT_MODE_UNSPECIFIED" => Some(Self::Unspecified),
371 "DIRECT_PEERING" => Some(Self::DirectPeering),
372 "PRIVATE_SERVICE_ACCESS" => Some(Self::PrivateServiceAccess),
373 _ => None,
374 }
375 }
376 }
377 /// Available TLS modes.
378 #[derive(
379 Clone,
380 Copy,
381 Debug,
382 PartialEq,
383 Eq,
384 Hash,
385 PartialOrd,
386 Ord,
387 ::prost::Enumeration
388 )]
389 #[repr(i32)]
390 pub enum TransitEncryptionMode {
391 /// Not set.
392 Unspecified = 0,
393 /// Client to Server traffic encryption enabled with server authentication.
394 ServerAuthentication = 1,
395 /// TLS is disabled for the instance.
396 Disabled = 2,
397 }
398 impl TransitEncryptionMode {
399 /// String value of the enum field names used in the ProtoBuf definition.
400 ///
401 /// The values are not transformed in any way and thus are considered stable
402 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
403 pub fn as_str_name(&self) -> &'static str {
404 match self {
405 Self::Unspecified => "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED",
406 Self::ServerAuthentication => "SERVER_AUTHENTICATION",
407 Self::Disabled => "DISABLED",
408 }
409 }
410 /// Creates an enum from field names used in the ProtoBuf definition.
411 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
412 match value {
413 "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
414 "SERVER_AUTHENTICATION" => Some(Self::ServerAuthentication),
415 "DISABLED" => Some(Self::Disabled),
416 _ => None,
417 }
418 }
419 }
420 /// Read replicas mode.
421 #[derive(
422 Clone,
423 Copy,
424 Debug,
425 PartialEq,
426 Eq,
427 Hash,
428 PartialOrd,
429 Ord,
430 ::prost::Enumeration
431 )]
432 #[repr(i32)]
433 pub enum ReadReplicasMode {
434 /// If not set, Memorystore Redis backend will default to
435 /// READ_REPLICAS_DISABLED.
436 Unspecified = 0,
437 /// If disabled, read endpoint will not be provided and the instance cannot
438 /// scale up or down the number of replicas.
439 ReadReplicasDisabled = 1,
440 /// If enabled, read endpoint will be provided and the instance can scale
441 /// up and down the number of replicas. Not valid for basic tier.
442 ReadReplicasEnabled = 2,
443 }
444 impl ReadReplicasMode {
445 /// String value of the enum field names used in the ProtoBuf definition.
446 ///
447 /// The values are not transformed in any way and thus are considered stable
448 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
449 pub fn as_str_name(&self) -> &'static str {
450 match self {
451 Self::Unspecified => "READ_REPLICAS_MODE_UNSPECIFIED",
452 Self::ReadReplicasDisabled => "READ_REPLICAS_DISABLED",
453 Self::ReadReplicasEnabled => "READ_REPLICAS_ENABLED",
454 }
455 }
456 /// Creates an enum from field names used in the ProtoBuf definition.
457 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
458 match value {
459 "READ_REPLICAS_MODE_UNSPECIFIED" => Some(Self::Unspecified),
460 "READ_REPLICAS_DISABLED" => Some(Self::ReadReplicasDisabled),
461 "READ_REPLICAS_ENABLED" => Some(Self::ReadReplicasEnabled),
462 _ => None,
463 }
464 }
465 }
466 /// Possible reasons for the instance to be in a "SUSPENDED" state.
467 #[derive(
468 Clone,
469 Copy,
470 Debug,
471 PartialEq,
472 Eq,
473 Hash,
474 PartialOrd,
475 Ord,
476 ::prost::Enumeration
477 )]
478 #[repr(i32)]
479 pub enum SuspensionReason {
480 /// Not set.
481 Unspecified = 0,
482 /// Something wrong with the CMEK key provided by customer.
483 CustomerManagedKeyIssue = 1,
484 }
485 impl SuspensionReason {
486 /// String value of the enum field names used in the ProtoBuf definition.
487 ///
488 /// The values are not transformed in any way and thus are considered stable
489 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
490 pub fn as_str_name(&self) -> &'static str {
491 match self {
492 Self::Unspecified => "SUSPENSION_REASON_UNSPECIFIED",
493 Self::CustomerManagedKeyIssue => "CUSTOMER_MANAGED_KEY_ISSUE",
494 }
495 }
496 /// Creates an enum from field names used in the ProtoBuf definition.
497 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
498 match value {
499 "SUSPENSION_REASON_UNSPECIFIED" => Some(Self::Unspecified),
500 "CUSTOMER_MANAGED_KEY_ISSUE" => Some(Self::CustomerManagedKeyIssue),
501 _ => None,
502 }
503 }
504 }
505}
506/// Configuration of the persistence functionality.
507#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
508pub struct PersistenceConfig {
509 /// Optional. Controls whether Persistence features are enabled.
510 /// If not provided, the existing value will be used.
511 #[prost(enumeration = "persistence_config::PersistenceMode", tag = "1")]
512 pub persistence_mode: i32,
513 /// Optional. Period between RDB snapshots. Snapshots will be attempted every
514 /// period starting from the provided snapshot start time. For example, a start
515 /// time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing
516 /// until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45,
517 /// 18:45, and 00:45 the next day, and so on. If not provided,
518 /// TWENTY_FOUR_HOURS will be used as default.
519 #[prost(enumeration = "persistence_config::SnapshotPeriod", tag = "2")]
520 pub rdb_snapshot_period: i32,
521 /// Output only. The next time that a snapshot attempt is scheduled to occur.
522 #[prost(message, optional, tag = "4")]
523 pub rdb_next_snapshot_time: ::core::option::Option<::prost_types::Timestamp>,
524 /// Optional. Date and time that the first snapshot was/will be attempted, and
525 /// to which future snapshots will be aligned. If not provided, the current
526 /// time will be used.
527 #[prost(message, optional, tag = "5")]
528 pub rdb_snapshot_start_time: ::core::option::Option<::prost_types::Timestamp>,
529}
530/// Nested message and enum types in `PersistenceConfig`.
531pub mod persistence_config {
532 /// Available Persistence modes.
533 #[derive(
534 Clone,
535 Copy,
536 Debug,
537 PartialEq,
538 Eq,
539 Hash,
540 PartialOrd,
541 Ord,
542 ::prost::Enumeration
543 )]
544 #[repr(i32)]
545 pub enum PersistenceMode {
546 /// Not set.
547 Unspecified = 0,
548 /// Persistence is disabled for the instance,
549 /// and any existing snapshots are deleted.
550 Disabled = 1,
551 /// RDB based Persistence is enabled.
552 Rdb = 2,
553 }
554 impl PersistenceMode {
555 /// String value of the enum field names used in the ProtoBuf definition.
556 ///
557 /// The values are not transformed in any way and thus are considered stable
558 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
559 pub fn as_str_name(&self) -> &'static str {
560 match self {
561 Self::Unspecified => "PERSISTENCE_MODE_UNSPECIFIED",
562 Self::Disabled => "DISABLED",
563 Self::Rdb => "RDB",
564 }
565 }
566 /// Creates an enum from field names used in the ProtoBuf definition.
567 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
568 match value {
569 "PERSISTENCE_MODE_UNSPECIFIED" => Some(Self::Unspecified),
570 "DISABLED" => Some(Self::Disabled),
571 "RDB" => Some(Self::Rdb),
572 _ => None,
573 }
574 }
575 }
576 /// Available snapshot periods for scheduling.
577 #[derive(
578 Clone,
579 Copy,
580 Debug,
581 PartialEq,
582 Eq,
583 Hash,
584 PartialOrd,
585 Ord,
586 ::prost::Enumeration
587 )]
588 #[repr(i32)]
589 pub enum SnapshotPeriod {
590 /// Not set.
591 Unspecified = 0,
592 /// Snapshot every 1 hour.
593 OneHour = 3,
594 /// Snapshot every 6 hours.
595 SixHours = 4,
596 /// Snapshot every 12 hours.
597 TwelveHours = 5,
598 /// Snapshot every 24 hours.
599 TwentyFourHours = 6,
600 }
601 impl SnapshotPeriod {
602 /// String value of the enum field names used in the ProtoBuf definition.
603 ///
604 /// The values are not transformed in any way and thus are considered stable
605 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
606 pub fn as_str_name(&self) -> &'static str {
607 match self {
608 Self::Unspecified => "SNAPSHOT_PERIOD_UNSPECIFIED",
609 Self::OneHour => "ONE_HOUR",
610 Self::SixHours => "SIX_HOURS",
611 Self::TwelveHours => "TWELVE_HOURS",
612 Self::TwentyFourHours => "TWENTY_FOUR_HOURS",
613 }
614 }
615 /// Creates an enum from field names used in the ProtoBuf definition.
616 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
617 match value {
618 "SNAPSHOT_PERIOD_UNSPECIFIED" => Some(Self::Unspecified),
619 "ONE_HOUR" => Some(Self::OneHour),
620 "SIX_HOURS" => Some(Self::SixHours),
621 "TWELVE_HOURS" => Some(Self::TwelveHours),
622 "TWENTY_FOUR_HOURS" => Some(Self::TwentyFourHours),
623 _ => None,
624 }
625 }
626 }
627}
628/// Request for
629/// \[RescheduleMaintenance\]\[google.cloud.redis.v1.CloudRedis.RescheduleMaintenance\].
630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
631pub struct RescheduleMaintenanceRequest {
632 /// Required. Redis instance resource name using the form:
633 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
634 /// where `location_id` refers to a GCP region.
635 #[prost(string, tag = "1")]
636 pub name: ::prost::alloc::string::String,
637 /// Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as
638 /// well.
639 #[prost(enumeration = "reschedule_maintenance_request::RescheduleType", tag = "2")]
640 pub reschedule_type: i32,
641 /// Optional. Timestamp when the maintenance shall be rescheduled to if
642 /// reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
643 /// example `2012-11-15T16:19:00.094Z`.
644 #[prost(message, optional, tag = "3")]
645 pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
646}
647/// Nested message and enum types in `RescheduleMaintenanceRequest`.
648pub mod reschedule_maintenance_request {
649 /// Reschedule options.
650 #[derive(
651 Clone,
652 Copy,
653 Debug,
654 PartialEq,
655 Eq,
656 Hash,
657 PartialOrd,
658 Ord,
659 ::prost::Enumeration
660 )]
661 #[repr(i32)]
662 pub enum RescheduleType {
663 /// Not set.
664 Unspecified = 0,
665 /// If the user wants to schedule the maintenance to happen now.
666 Immediate = 1,
667 /// If the user wants to use the existing maintenance policy to find the
668 /// next available window.
669 NextAvailableWindow = 2,
670 /// If the user wants to reschedule the maintenance to a specific time.
671 SpecificTime = 3,
672 }
673 impl RescheduleType {
674 /// String value of the enum field names used in the ProtoBuf definition.
675 ///
676 /// The values are not transformed in any way and thus are considered stable
677 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
678 pub fn as_str_name(&self) -> &'static str {
679 match self {
680 Self::Unspecified => "RESCHEDULE_TYPE_UNSPECIFIED",
681 Self::Immediate => "IMMEDIATE",
682 Self::NextAvailableWindow => "NEXT_AVAILABLE_WINDOW",
683 Self::SpecificTime => "SPECIFIC_TIME",
684 }
685 }
686 /// Creates an enum from field names used in the ProtoBuf definition.
687 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
688 match value {
689 "RESCHEDULE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
690 "IMMEDIATE" => Some(Self::Immediate),
691 "NEXT_AVAILABLE_WINDOW" => Some(Self::NextAvailableWindow),
692 "SPECIFIC_TIME" => Some(Self::SpecificTime),
693 _ => None,
694 }
695 }
696 }
697}
698/// Maintenance policy for an instance.
699#[derive(Clone, PartialEq, ::prost::Message)]
700pub struct MaintenancePolicy {
701 /// Output only. The time when the policy was created.
702 #[prost(message, optional, tag = "1")]
703 pub create_time: ::core::option::Option<::prost_types::Timestamp>,
704 /// Output only. The time when the policy was last updated.
705 #[prost(message, optional, tag = "2")]
706 pub update_time: ::core::option::Option<::prost_types::Timestamp>,
707 /// Optional. Description of what this policy is for. Create/Update methods
708 /// return INVALID_ARGUMENT if the length is greater than 512.
709 #[prost(string, tag = "3")]
710 pub description: ::prost::alloc::string::String,
711 /// Optional. Maintenance window that is applied to resources covered by this
712 /// policy. Minimum 1. For the current version, the maximum number of
713 /// weekly_window is expected to be one.
714 #[prost(message, repeated, tag = "4")]
715 pub weekly_maintenance_window: ::prost::alloc::vec::Vec<WeeklyMaintenanceWindow>,
716}
717/// Time window in which disruptive maintenance updates occur. Non-disruptive
718/// updates can occur inside or outside this window.
719#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
720pub struct WeeklyMaintenanceWindow {
721 /// Required. The day of week that maintenance updates occur.
722 #[prost(enumeration = "super::super::super::r#type::DayOfWeek", tag = "1")]
723 pub day: i32,
724 /// Required. Start time of the window in UTC time.
725 #[prost(message, optional, tag = "2")]
726 pub start_time: ::core::option::Option<super::super::super::r#type::TimeOfDay>,
727 /// Output only. Duration of the maintenance window. The current window is
728 /// fixed at 1 hour.
729 #[prost(message, optional, tag = "3")]
730 pub duration: ::core::option::Option<::prost_types::Duration>,
731}
732/// Upcoming maintenance schedule. If no maintenance is scheduled, fields are not
733/// populated.
734#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
735pub struct MaintenanceSchedule {
736 /// Output only. The start time of any upcoming scheduled maintenance for this
737 /// instance.
738 #[prost(message, optional, tag = "1")]
739 pub start_time: ::core::option::Option<::prost_types::Timestamp>,
740 /// Output only. The end time of any upcoming scheduled maintenance for this
741 /// instance.
742 #[prost(message, optional, tag = "2")]
743 pub end_time: ::core::option::Option<::prost_types::Timestamp>,
744 /// If the scheduled maintenance can be rescheduled, default is true.
745 #[deprecated]
746 #[prost(bool, tag = "3")]
747 pub can_reschedule: bool,
748 /// Output only. The deadline that the maintenance schedule start time can not
749 /// go beyond, including reschedule.
750 #[prost(message, optional, tag = "5")]
751 pub schedule_deadline_time: ::core::option::Option<::prost_types::Timestamp>,
752}
753/// Request for \[ListInstances\]\[google.cloud.redis.v1.CloudRedis.ListInstances\].
754#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
755pub struct ListInstancesRequest {
756 /// Required. The resource name of the instance location using the form:
757 /// `projects/{project_id}/locations/{location_id}`
758 /// where `location_id` refers to a GCP region.
759 #[prost(string, tag = "1")]
760 pub parent: ::prost::alloc::string::String,
761 /// The maximum number of items to return.
762 ///
763 /// If not specified, a default value of 1000 will be used by the service.
764 /// Regardless of the page_size value, the response may include a partial list
765 /// and a caller should only rely on response's
766 /// \[`next_page_token`\]\[google.cloud.redis.v1.ListInstancesResponse.next_page_token\]
767 /// to determine if there are more instances left to be queried.
768 #[prost(int32, tag = "2")]
769 pub page_size: i32,
770 /// The `next_page_token` value returned from a previous
771 /// \[ListInstances\]\[google.cloud.redis.v1.CloudRedis.ListInstances\] request, if
772 /// any.
773 #[prost(string, tag = "3")]
774 pub page_token: ::prost::alloc::string::String,
775}
776/// Response for \[ListInstances\]\[google.cloud.redis.v1.CloudRedis.ListInstances\].
777#[derive(Clone, PartialEq, ::prost::Message)]
778pub struct ListInstancesResponse {
779 /// A list of Redis instances in the project in the specified location,
780 /// or across all locations.
781 ///
782 /// If the `location_id` in the parent field of the request is "-", all regions
783 /// available to the project are queried, and the results aggregated.
784 /// If in such an aggregated query a location is unavailable, a placeholder
785 /// Redis entry is included in the response with the `name` field set to a
786 /// value of the form
787 /// `projects/{project_id}/locations/{location_id}/instances/`- and the
788 /// `status` field set to ERROR and `status_message` field set to "location not
789 /// available for ListInstances".
790 #[prost(message, repeated, tag = "1")]
791 pub instances: ::prost::alloc::vec::Vec<Instance>,
792 /// Token to retrieve the next page of results, or empty if there are no more
793 /// results in the list.
794 #[prost(string, tag = "2")]
795 pub next_page_token: ::prost::alloc::string::String,
796 /// Locations that could not be reached.
797 #[prost(string, repeated, tag = "3")]
798 pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
799}
800/// Request for \[GetInstance\]\[google.cloud.redis.v1.CloudRedis.GetInstance\].
801#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
802pub struct GetInstanceRequest {
803 /// Required. Redis instance resource name using the form:
804 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
805 /// where `location_id` refers to a GCP region.
806 #[prost(string, tag = "1")]
807 pub name: ::prost::alloc::string::String,
808}
809/// Request for
810/// \[GetInstanceAuthString\]\[google.cloud.redis.v1.CloudRedis.GetInstanceAuthString\].
811#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
812pub struct GetInstanceAuthStringRequest {
813 /// Required. Redis instance resource name using the form:
814 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
815 /// where `location_id` refers to a GCP region.
816 #[prost(string, tag = "1")]
817 pub name: ::prost::alloc::string::String,
818}
819/// Instance AUTH string details.
820#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
821pub struct InstanceAuthString {
822 /// AUTH string set on the instance.
823 #[prost(string, tag = "1")]
824 pub auth_string: ::prost::alloc::string::String,
825}
826/// Request for
827/// \[CreateInstance\]\[google.cloud.redis.v1.CloudRedis.CreateInstance\].
828#[derive(Clone, PartialEq, ::prost::Message)]
829pub struct CreateInstanceRequest {
830 /// Required. The resource name of the instance location using the form:
831 /// `projects/{project_id}/locations/{location_id}`
832 /// where `location_id` refers to a GCP region.
833 #[prost(string, tag = "1")]
834 pub parent: ::prost::alloc::string::String,
835 /// Required. The logical name of the Redis instance in the customer project
836 /// with the following restrictions:
837 ///
838 /// * Must contain only lowercase letters, numbers, and hyphens.
839 /// * Must start with a letter.
840 /// * Must be between 1-40 characters.
841 /// * Must end with a number or a letter.
842 /// * Must be unique within the customer project / location
843 #[prost(string, tag = "2")]
844 pub instance_id: ::prost::alloc::string::String,
845 /// Required. A Redis \[Instance\] resource
846 #[prost(message, optional, tag = "3")]
847 pub instance: ::core::option::Option<Instance>,
848}
849/// Request for
850/// \[UpdateInstance\]\[google.cloud.redis.v1.CloudRedis.UpdateInstance\].
851#[derive(Clone, PartialEq, ::prost::Message)]
852pub struct UpdateInstanceRequest {
853 /// Required. Mask of fields to update. At least one path must be supplied in
854 /// this field. The elements of the repeated paths field may only include these
855 /// fields from \[Instance\]\[google.cloud.redis.v1.Instance\]:
856 ///
857 /// * `displayName`
858 /// * `labels`
859 /// * `memorySizeGb`
860 /// * `redisConfig`
861 /// * `replica_count`
862 #[prost(message, optional, tag = "1")]
863 pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
864 /// Required. Update description.
865 /// Only fields specified in update_mask are updated.
866 #[prost(message, optional, tag = "2")]
867 pub instance: ::core::option::Option<Instance>,
868}
869/// Request for
870/// \[UpgradeInstance\]\[google.cloud.redis.v1.CloudRedis.UpgradeInstance\].
871#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
872pub struct UpgradeInstanceRequest {
873 /// Required. Redis instance resource name using the form:
874 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
875 /// where `location_id` refers to a GCP region.
876 #[prost(string, tag = "1")]
877 pub name: ::prost::alloc::string::String,
878 /// Required. Specifies the target version of Redis software to upgrade to.
879 #[prost(string, tag = "2")]
880 pub redis_version: ::prost::alloc::string::String,
881}
882/// Request for
883/// \[DeleteInstance\]\[google.cloud.redis.v1.CloudRedis.DeleteInstance\].
884#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
885pub struct DeleteInstanceRequest {
886 /// Required. Redis instance resource name using the form:
887 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
888 /// where `location_id` refers to a GCP region.
889 #[prost(string, tag = "1")]
890 pub name: ::prost::alloc::string::String,
891}
892/// The Cloud Storage location for the input content
893#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
894pub struct GcsSource {
895 /// Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
896 #[prost(string, tag = "1")]
897 pub uri: ::prost::alloc::string::String,
898}
899/// The input content
900#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
901pub struct InputConfig {
902 /// Required. Specify source location of input data
903 #[prost(oneof = "input_config::Source", tags = "1")]
904 pub source: ::core::option::Option<input_config::Source>,
905}
906/// Nested message and enum types in `InputConfig`.
907pub mod input_config {
908 /// Required. Specify source location of input data
909 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
910 pub enum Source {
911 /// Google Cloud Storage location where input content is located.
912 #[prost(message, tag = "1")]
913 GcsSource(super::GcsSource),
914 }
915}
916/// Request for \[Import\]\[google.cloud.redis.v1.CloudRedis.ImportInstance\].
917#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
918pub struct ImportInstanceRequest {
919 /// Required. Redis instance resource name using the form:
920 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
921 /// where `location_id` refers to a GCP region.
922 #[prost(string, tag = "1")]
923 pub name: ::prost::alloc::string::String,
924 /// Required. Specify data to be imported.
925 #[prost(message, optional, tag = "3")]
926 pub input_config: ::core::option::Option<InputConfig>,
927}
928/// The Cloud Storage location for the output content
929#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
930pub struct GcsDestination {
931 /// Required. Data destination URI (e.g.
932 /// 'gs://my_bucket/my_object'). Existing files will be overwritten.
933 #[prost(string, tag = "1")]
934 pub uri: ::prost::alloc::string::String,
935}
936/// The output content
937#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
938pub struct OutputConfig {
939 /// Required. Specify destination location of output data
940 #[prost(oneof = "output_config::Destination", tags = "1")]
941 pub destination: ::core::option::Option<output_config::Destination>,
942}
943/// Nested message and enum types in `OutputConfig`.
944pub mod output_config {
945 /// Required. Specify destination location of output data
946 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
947 pub enum Destination {
948 /// Google Cloud Storage destination for output content.
949 #[prost(message, tag = "1")]
950 GcsDestination(super::GcsDestination),
951 }
952}
953/// Request for \[Export\]\[google.cloud.redis.v1.CloudRedis.ExportInstance\].
954#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
955pub struct ExportInstanceRequest {
956 /// Required. Redis instance resource name using the form:
957 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
958 /// where `location_id` refers to a GCP region.
959 #[prost(string, tag = "1")]
960 pub name: ::prost::alloc::string::String,
961 /// Required. Specify data to be exported.
962 #[prost(message, optional, tag = "3")]
963 pub output_config: ::core::option::Option<OutputConfig>,
964}
965/// Request for \[Failover\]\[google.cloud.redis.v1.CloudRedis.FailoverInstance\].
966#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
967pub struct FailoverInstanceRequest {
968 /// Required. Redis instance resource name using the form:
969 /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
970 /// where `location_id` refers to a GCP region.
971 #[prost(string, tag = "1")]
972 pub name: ::prost::alloc::string::String,
973 /// Optional. Available data protection modes that the user can choose. If it's
974 /// unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
975 #[prost(enumeration = "failover_instance_request::DataProtectionMode", tag = "2")]
976 pub data_protection_mode: i32,
977}
978/// Nested message and enum types in `FailoverInstanceRequest`.
979pub mod failover_instance_request {
980 /// Specifies different modes of operation in relation to the data retention.
981 #[derive(
982 Clone,
983 Copy,
984 Debug,
985 PartialEq,
986 Eq,
987 Hash,
988 PartialOrd,
989 Ord,
990 ::prost::Enumeration
991 )]
992 #[repr(i32)]
993 pub enum DataProtectionMode {
994 /// Defaults to LIMITED_DATA_LOSS if a data protection mode is not
995 /// specified.
996 Unspecified = 0,
997 /// Instance failover will be protected with data loss control. More
998 /// specifically, the failover will only be performed if the current
999 /// replication offset diff between primary and replica is under a certain
1000 /// threshold.
1001 LimitedDataLoss = 1,
1002 /// Instance failover will be performed without data loss control.
1003 ForceDataLoss = 2,
1004 }
1005 impl DataProtectionMode {
1006 /// String value of the enum field names used in the ProtoBuf definition.
1007 ///
1008 /// The values are not transformed in any way and thus are considered stable
1009 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1010 pub fn as_str_name(&self) -> &'static str {
1011 match self {
1012 Self::Unspecified => "DATA_PROTECTION_MODE_UNSPECIFIED",
1013 Self::LimitedDataLoss => "LIMITED_DATA_LOSS",
1014 Self::ForceDataLoss => "FORCE_DATA_LOSS",
1015 }
1016 }
1017 /// Creates an enum from field names used in the ProtoBuf definition.
1018 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1019 match value {
1020 "DATA_PROTECTION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
1021 "LIMITED_DATA_LOSS" => Some(Self::LimitedDataLoss),
1022 "FORCE_DATA_LOSS" => Some(Self::ForceDataLoss),
1023 _ => None,
1024 }
1025 }
1026 }
1027}
1028/// Represents the v1 metadata of the long-running operation.
1029#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1030pub struct OperationMetadata {
1031 /// Creation timestamp.
1032 #[prost(message, optional, tag = "1")]
1033 pub create_time: ::core::option::Option<::prost_types::Timestamp>,
1034 /// End timestamp.
1035 #[prost(message, optional, tag = "2")]
1036 pub end_time: ::core::option::Option<::prost_types::Timestamp>,
1037 /// Operation target.
1038 #[prost(string, tag = "3")]
1039 pub target: ::prost::alloc::string::String,
1040 /// Operation verb.
1041 #[prost(string, tag = "4")]
1042 pub verb: ::prost::alloc::string::String,
1043 /// Operation status details.
1044 #[prost(string, tag = "5")]
1045 pub status_detail: ::prost::alloc::string::String,
1046 /// Specifies if cancellation was requested for the operation.
1047 #[prost(bool, tag = "6")]
1048 pub cancel_requested: bool,
1049 /// API version.
1050 #[prost(string, tag = "7")]
1051 pub api_version: ::prost::alloc::string::String,
1052}
1053/// This location metadata represents additional configuration options for a
1054/// given location where a Redis instance may be created. All fields are output
1055/// only. It is returned as content of the
1056/// `google.cloud.location.Location.metadata` field.
1057#[derive(Clone, PartialEq, ::prost::Message)]
1058pub struct LocationMetadata {
1059 /// Output only. The set of available zones in the location. The map is keyed
1060 /// by the lowercase ID of each zone, as defined by GCE. These keys can be
1061 /// specified in `location_id` or `alternative_location_id` fields when
1062 /// creating a Redis instance.
1063 #[prost(map = "string, message", tag = "1")]
1064 pub available_zones: ::std::collections::HashMap<
1065 ::prost::alloc::string::String,
1066 ZoneMetadata,
1067 >,
1068}
1069/// Defines specific information for a particular zone. Currently empty and
1070/// reserved for future use only.
1071#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1072pub struct ZoneMetadata {}
1073/// TlsCertificate Resource
1074#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1075pub struct TlsCertificate {
1076 /// Serial number, as extracted from the certificate.
1077 #[prost(string, tag = "1")]
1078 pub serial_number: ::prost::alloc::string::String,
1079 /// PEM representation.
1080 #[prost(string, tag = "2")]
1081 pub cert: ::prost::alloc::string::String,
1082 /// Output only. The time when the certificate was created in [RFC
1083 /// 3339](<https://tools.ietf.org/html/rfc3339>) format, for example
1084 /// `2020-05-18T00:00:00.094Z`.
1085 #[prost(message, optional, tag = "3")]
1086 pub create_time: ::core::option::Option<::prost_types::Timestamp>,
1087 /// Output only. The time when the certificate expires in [RFC
1088 /// 3339](<https://tools.ietf.org/html/rfc3339>) format, for example
1089 /// `2020-05-18T00:00:00.094Z`.
1090 #[prost(message, optional, tag = "4")]
1091 pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
1092 /// Sha1 Fingerprint of the certificate.
1093 #[prost(string, tag = "5")]
1094 pub sha1_fingerprint: ::prost::alloc::string::String,
1095}
1096/// Generated client implementations.
1097pub mod cloud_redis_client {
1098 #![allow(
1099 unused_variables,
1100 dead_code,
1101 missing_docs,
1102 clippy::wildcard_imports,
1103 clippy::let_unit_value,
1104 )]
1105 use tonic::codegen::*;
1106 use tonic::codegen::http::Uri;
1107 /// Configures and manages Cloud Memorystore for Redis instances
1108 ///
1109 /// Google Cloud Memorystore for Redis v1
1110 ///
1111 /// The `redis.googleapis.com` service implements the Google Cloud Memorystore
1112 /// for Redis API and defines the following resource model for managing Redis
1113 /// instances:
1114 ///
1115 /// * The service works with a collection of cloud projects, named: `/projects/*`
1116 /// * Each project has a collection of available locations, named: `/locations/*`
1117 /// * Each location has a collection of Redis instances, named: `/instances/*`
1118 /// * As such, Redis instances are resources of the form:
1119 /// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
1120 ///
1121 /// Note that location_id must be referring to a GCP `region`; for example:
1122 ///
1123 /// * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
1124 #[derive(Debug, Clone)]
1125 pub struct CloudRedisClient<T> {
1126 inner: tonic::client::Grpc<T>,
1127 }
1128 impl<T> CloudRedisClient<T>
1129 where
1130 T: tonic::client::GrpcService<tonic::body::Body>,
1131 T::Error: Into<StdError>,
1132 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1133 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1134 {
1135 pub fn new(inner: T) -> Self {
1136 let inner = tonic::client::Grpc::new(inner);
1137 Self { inner }
1138 }
1139 pub fn with_origin(inner: T, origin: Uri) -> Self {
1140 let inner = tonic::client::Grpc::with_origin(inner, origin);
1141 Self { inner }
1142 }
1143 pub fn with_interceptor<F>(
1144 inner: T,
1145 interceptor: F,
1146 ) -> CloudRedisClient<InterceptedService<T, F>>
1147 where
1148 F: tonic::service::Interceptor,
1149 T::ResponseBody: Default,
1150 T: tonic::codegen::Service<
1151 http::Request<tonic::body::Body>,
1152 Response = http::Response<
1153 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1154 >,
1155 >,
1156 <T as tonic::codegen::Service<
1157 http::Request<tonic::body::Body>,
1158 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1159 {
1160 CloudRedisClient::new(InterceptedService::new(inner, interceptor))
1161 }
1162 /// Compress requests with the given encoding.
1163 ///
1164 /// This requires the server to support it otherwise it might respond with an
1165 /// error.
1166 #[must_use]
1167 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1168 self.inner = self.inner.send_compressed(encoding);
1169 self
1170 }
1171 /// Enable decompressing responses.
1172 #[must_use]
1173 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1174 self.inner = self.inner.accept_compressed(encoding);
1175 self
1176 }
1177 /// Limits the maximum size of a decoded message.
1178 ///
1179 /// Default: `4MB`
1180 #[must_use]
1181 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1182 self.inner = self.inner.max_decoding_message_size(limit);
1183 self
1184 }
1185 /// Limits the maximum size of an encoded message.
1186 ///
1187 /// Default: `usize::MAX`
1188 #[must_use]
1189 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1190 self.inner = self.inner.max_encoding_message_size(limit);
1191 self
1192 }
1193 /// Lists all Redis instances owned by a project in either the specified
1194 /// location (region) or all locations.
1195 ///
1196 /// The location should have the following format:
1197 ///
1198 /// * `projects/{project_id}/locations/{location_id}`
1199 ///
1200 /// If `location_id` is specified as `-` (wildcard), then all regions
1201 /// available to the project are queried, and the results are aggregated.
1202 pub async fn list_instances(
1203 &mut self,
1204 request: impl tonic::IntoRequest<super::ListInstancesRequest>,
1205 ) -> std::result::Result<
1206 tonic::Response<super::ListInstancesResponse>,
1207 tonic::Status,
1208 > {
1209 self.inner
1210 .ready()
1211 .await
1212 .map_err(|e| {
1213 tonic::Status::unknown(
1214 format!("Service was not ready: {}", e.into()),
1215 )
1216 })?;
1217 let codec = tonic_prost::ProstCodec::default();
1218 let path = http::uri::PathAndQuery::from_static(
1219 "/google.cloud.redis.v1.CloudRedis/ListInstances",
1220 );
1221 let mut req = request.into_request();
1222 req.extensions_mut()
1223 .insert(
1224 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "ListInstances"),
1225 );
1226 self.inner.unary(req, path, codec).await
1227 }
1228 /// Gets the details of a specific Redis instance.
1229 pub async fn get_instance(
1230 &mut self,
1231 request: impl tonic::IntoRequest<super::GetInstanceRequest>,
1232 ) -> std::result::Result<tonic::Response<super::Instance>, tonic::Status> {
1233 self.inner
1234 .ready()
1235 .await
1236 .map_err(|e| {
1237 tonic::Status::unknown(
1238 format!("Service was not ready: {}", e.into()),
1239 )
1240 })?;
1241 let codec = tonic_prost::ProstCodec::default();
1242 let path = http::uri::PathAndQuery::from_static(
1243 "/google.cloud.redis.v1.CloudRedis/GetInstance",
1244 );
1245 let mut req = request.into_request();
1246 req.extensions_mut()
1247 .insert(
1248 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "GetInstance"),
1249 );
1250 self.inner.unary(req, path, codec).await
1251 }
1252 /// Gets the AUTH string for a Redis instance. If AUTH is not enabled for the
1253 /// instance the response will be empty. This information is not included in
1254 /// the details returned to GetInstance.
1255 pub async fn get_instance_auth_string(
1256 &mut self,
1257 request: impl tonic::IntoRequest<super::GetInstanceAuthStringRequest>,
1258 ) -> std::result::Result<
1259 tonic::Response<super::InstanceAuthString>,
1260 tonic::Status,
1261 > {
1262 self.inner
1263 .ready()
1264 .await
1265 .map_err(|e| {
1266 tonic::Status::unknown(
1267 format!("Service was not ready: {}", e.into()),
1268 )
1269 })?;
1270 let codec = tonic_prost::ProstCodec::default();
1271 let path = http::uri::PathAndQuery::from_static(
1272 "/google.cloud.redis.v1.CloudRedis/GetInstanceAuthString",
1273 );
1274 let mut req = request.into_request();
1275 req.extensions_mut()
1276 .insert(
1277 GrpcMethod::new(
1278 "google.cloud.redis.v1.CloudRedis",
1279 "GetInstanceAuthString",
1280 ),
1281 );
1282 self.inner.unary(req, path, codec).await
1283 }
1284 /// Creates a Redis instance based on the specified tier and memory size.
1285 ///
1286 /// By default, the instance is accessible from the project's
1287 /// [default network](https://cloud.google.com/vpc/docs/vpc).
1288 ///
1289 /// The creation is executed asynchronously and callers may check the returned
1290 /// operation to track its progress. Once the operation is completed the Redis
1291 /// instance will be fully functional. Completed longrunning.Operation will
1292 /// contain the new instance object in the response field.
1293 ///
1294 /// The returned operation is automatically deleted after a few hours, so there
1295 /// is no need to call DeleteOperation.
1296 pub async fn create_instance(
1297 &mut self,
1298 request: impl tonic::IntoRequest<super::CreateInstanceRequest>,
1299 ) -> std::result::Result<
1300 tonic::Response<super::super::super::super::longrunning::Operation>,
1301 tonic::Status,
1302 > {
1303 self.inner
1304 .ready()
1305 .await
1306 .map_err(|e| {
1307 tonic::Status::unknown(
1308 format!("Service was not ready: {}", e.into()),
1309 )
1310 })?;
1311 let codec = tonic_prost::ProstCodec::default();
1312 let path = http::uri::PathAndQuery::from_static(
1313 "/google.cloud.redis.v1.CloudRedis/CreateInstance",
1314 );
1315 let mut req = request.into_request();
1316 req.extensions_mut()
1317 .insert(
1318 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "CreateInstance"),
1319 );
1320 self.inner.unary(req, path, codec).await
1321 }
1322 /// Updates the metadata and configuration of a specific Redis instance.
1323 ///
1324 /// Completed longrunning.Operation will contain the new instance object
1325 /// in the response field. The returned operation is automatically deleted
1326 /// after a few hours, so there is no need to call DeleteOperation.
1327 pub async fn update_instance(
1328 &mut self,
1329 request: impl tonic::IntoRequest<super::UpdateInstanceRequest>,
1330 ) -> std::result::Result<
1331 tonic::Response<super::super::super::super::longrunning::Operation>,
1332 tonic::Status,
1333 > {
1334 self.inner
1335 .ready()
1336 .await
1337 .map_err(|e| {
1338 tonic::Status::unknown(
1339 format!("Service was not ready: {}", e.into()),
1340 )
1341 })?;
1342 let codec = tonic_prost::ProstCodec::default();
1343 let path = http::uri::PathAndQuery::from_static(
1344 "/google.cloud.redis.v1.CloudRedis/UpdateInstance",
1345 );
1346 let mut req = request.into_request();
1347 req.extensions_mut()
1348 .insert(
1349 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "UpdateInstance"),
1350 );
1351 self.inner.unary(req, path, codec).await
1352 }
1353 /// Upgrades Redis instance to the newer Redis version specified in the
1354 /// request.
1355 pub async fn upgrade_instance(
1356 &mut self,
1357 request: impl tonic::IntoRequest<super::UpgradeInstanceRequest>,
1358 ) -> std::result::Result<
1359 tonic::Response<super::super::super::super::longrunning::Operation>,
1360 tonic::Status,
1361 > {
1362 self.inner
1363 .ready()
1364 .await
1365 .map_err(|e| {
1366 tonic::Status::unknown(
1367 format!("Service was not ready: {}", e.into()),
1368 )
1369 })?;
1370 let codec = tonic_prost::ProstCodec::default();
1371 let path = http::uri::PathAndQuery::from_static(
1372 "/google.cloud.redis.v1.CloudRedis/UpgradeInstance",
1373 );
1374 let mut req = request.into_request();
1375 req.extensions_mut()
1376 .insert(
1377 GrpcMethod::new(
1378 "google.cloud.redis.v1.CloudRedis",
1379 "UpgradeInstance",
1380 ),
1381 );
1382 self.inner.unary(req, path, codec).await
1383 }
1384 /// Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
1385 ///
1386 /// Redis may stop serving during this operation. Instance state will be
1387 /// IMPORTING for entire operation. When complete, the instance will contain
1388 /// only data from the imported file.
1389 ///
1390 /// The returned operation is automatically deleted after a few hours, so
1391 /// there is no need to call DeleteOperation.
1392 pub async fn import_instance(
1393 &mut self,
1394 request: impl tonic::IntoRequest<super::ImportInstanceRequest>,
1395 ) -> std::result::Result<
1396 tonic::Response<super::super::super::super::longrunning::Operation>,
1397 tonic::Status,
1398 > {
1399 self.inner
1400 .ready()
1401 .await
1402 .map_err(|e| {
1403 tonic::Status::unknown(
1404 format!("Service was not ready: {}", e.into()),
1405 )
1406 })?;
1407 let codec = tonic_prost::ProstCodec::default();
1408 let path = http::uri::PathAndQuery::from_static(
1409 "/google.cloud.redis.v1.CloudRedis/ImportInstance",
1410 );
1411 let mut req = request.into_request();
1412 req.extensions_mut()
1413 .insert(
1414 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "ImportInstance"),
1415 );
1416 self.inner.unary(req, path, codec).await
1417 }
1418 /// Export Redis instance data into a Redis RDB format file in Cloud Storage.
1419 ///
1420 /// Redis will continue serving during this operation.
1421 ///
1422 /// The returned operation is automatically deleted after a few hours, so
1423 /// there is no need to call DeleteOperation.
1424 pub async fn export_instance(
1425 &mut self,
1426 request: impl tonic::IntoRequest<super::ExportInstanceRequest>,
1427 ) -> std::result::Result<
1428 tonic::Response<super::super::super::super::longrunning::Operation>,
1429 tonic::Status,
1430 > {
1431 self.inner
1432 .ready()
1433 .await
1434 .map_err(|e| {
1435 tonic::Status::unknown(
1436 format!("Service was not ready: {}", e.into()),
1437 )
1438 })?;
1439 let codec = tonic_prost::ProstCodec::default();
1440 let path = http::uri::PathAndQuery::from_static(
1441 "/google.cloud.redis.v1.CloudRedis/ExportInstance",
1442 );
1443 let mut req = request.into_request();
1444 req.extensions_mut()
1445 .insert(
1446 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "ExportInstance"),
1447 );
1448 self.inner.unary(req, path, codec).await
1449 }
1450 /// Initiates a failover of the primary node to current replica node for a
1451 /// specific STANDARD tier Cloud Memorystore for Redis instance.
1452 pub async fn failover_instance(
1453 &mut self,
1454 request: impl tonic::IntoRequest<super::FailoverInstanceRequest>,
1455 ) -> std::result::Result<
1456 tonic::Response<super::super::super::super::longrunning::Operation>,
1457 tonic::Status,
1458 > {
1459 self.inner
1460 .ready()
1461 .await
1462 .map_err(|e| {
1463 tonic::Status::unknown(
1464 format!("Service was not ready: {}", e.into()),
1465 )
1466 })?;
1467 let codec = tonic_prost::ProstCodec::default();
1468 let path = http::uri::PathAndQuery::from_static(
1469 "/google.cloud.redis.v1.CloudRedis/FailoverInstance",
1470 );
1471 let mut req = request.into_request();
1472 req.extensions_mut()
1473 .insert(
1474 GrpcMethod::new(
1475 "google.cloud.redis.v1.CloudRedis",
1476 "FailoverInstance",
1477 ),
1478 );
1479 self.inner.unary(req, path, codec).await
1480 }
1481 /// Deletes a specific Redis instance. Instance stops serving and data is
1482 /// deleted.
1483 pub async fn delete_instance(
1484 &mut self,
1485 request: impl tonic::IntoRequest<super::DeleteInstanceRequest>,
1486 ) -> std::result::Result<
1487 tonic::Response<super::super::super::super::longrunning::Operation>,
1488 tonic::Status,
1489 > {
1490 self.inner
1491 .ready()
1492 .await
1493 .map_err(|e| {
1494 tonic::Status::unknown(
1495 format!("Service was not ready: {}", e.into()),
1496 )
1497 })?;
1498 let codec = tonic_prost::ProstCodec::default();
1499 let path = http::uri::PathAndQuery::from_static(
1500 "/google.cloud.redis.v1.CloudRedis/DeleteInstance",
1501 );
1502 let mut req = request.into_request();
1503 req.extensions_mut()
1504 .insert(
1505 GrpcMethod::new("google.cloud.redis.v1.CloudRedis", "DeleteInstance"),
1506 );
1507 self.inner.unary(req, path, codec).await
1508 }
1509 /// Reschedule maintenance for a given instance in a given project and
1510 /// location.
1511 pub async fn reschedule_maintenance(
1512 &mut self,
1513 request: impl tonic::IntoRequest<super::RescheduleMaintenanceRequest>,
1514 ) -> std::result::Result<
1515 tonic::Response<super::super::super::super::longrunning::Operation>,
1516 tonic::Status,
1517 > {
1518 self.inner
1519 .ready()
1520 .await
1521 .map_err(|e| {
1522 tonic::Status::unknown(
1523 format!("Service was not ready: {}", e.into()),
1524 )
1525 })?;
1526 let codec = tonic_prost::ProstCodec::default();
1527 let path = http::uri::PathAndQuery::from_static(
1528 "/google.cloud.redis.v1.CloudRedis/RescheduleMaintenance",
1529 );
1530 let mut req = request.into_request();
1531 req.extensions_mut()
1532 .insert(
1533 GrpcMethod::new(
1534 "google.cloud.redis.v1.CloudRedis",
1535 "RescheduleMaintenance",
1536 ),
1537 );
1538 self.inner.unary(req, path, codec).await
1539 }
1540 }
1541}