Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 30d3fc6

Browse files
feat: add automated RDB, also known as persistence (#153)
* feat: Add automated RDB (AKA persistence) PiperOrigin-RevId: 424884640 Source-Link: googleapis/googleapis@28c6bb9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ea1c8b2a6449cc39d2cbccfa3c725fba470bd941 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWExYzhiMmE2NDQ5Y2MzOWQyY2JjY2ZhM2M3MjVmYmE0NzBiZDk0MSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 044d0b5 commit 30d3fc6

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

google/cloud/redis_v1beta1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from .types.cloud_redis import MaintenanceSchedule
3737
from .types.cloud_redis import NodeInfo
3838
from .types.cloud_redis import OutputConfig
39+
from .types.cloud_redis import PersistenceConfig
3940
from .types.cloud_redis import RescheduleMaintenanceRequest
4041
from .types.cloud_redis import TlsCertificate
4142
from .types.cloud_redis import UpdateInstanceRequest
@@ -65,6 +66,7 @@
6566
"MaintenanceSchedule",
6667
"NodeInfo",
6768
"OutputConfig",
69+
"PersistenceConfig",
6870
"RescheduleMaintenanceRequest",
6971
"TlsCertificate",
7072
"UpdateInstanceRequest",

google/cloud/redis_v1beta1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
MaintenanceSchedule,
3434
NodeInfo,
3535
OutputConfig,
36+
PersistenceConfig,
3637
RescheduleMaintenanceRequest,
3738
TlsCertificate,
3839
UpdateInstanceRequest,
@@ -61,6 +62,7 @@
6162
"MaintenanceSchedule",
6263
"NodeInfo",
6364
"OutputConfig",
65+
"PersistenceConfig",
6466
"RescheduleMaintenanceRequest",
6567
"TlsCertificate",
6668
"UpdateInstanceRequest",

google/cloud/redis_v1beta1/types/cloud_redis.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
manifest={
2828
"NodeInfo",
2929
"Instance",
30+
"PersistenceConfig",
3031
"RescheduleMaintenanceRequest",
3132
"MaintenancePolicy",
3233
"WeeklyMaintenanceWindow",
@@ -230,6 +231,9 @@ class Instance(proto.Message):
230231
read_replicas_mode (google.cloud.redis_v1beta1.types.Instance.ReadReplicasMode):
231232
Optional. Read replica mode. Can only be
232233
specified when trying to create the instance.
234+
persistence_config (google.cloud.redis_v1beta1.types.PersistenceConfig):
235+
Optional. Persistence configuration
236+
parameters
233237
"""
234238

235239
class State(proto.Enum):
@@ -307,6 +311,59 @@ class ReadReplicasMode(proto.Enum):
307311
read_endpoint = proto.Field(proto.STRING, number=33,)
308312
read_endpoint_port = proto.Field(proto.INT32, number=34,)
309313
read_replicas_mode = proto.Field(proto.ENUM, number=35, enum=ReadReplicasMode,)
314+
persistence_config = proto.Field(
315+
proto.MESSAGE, number=37, message="PersistenceConfig",
316+
)
317+
318+
319+
class PersistenceConfig(proto.Message):
320+
r"""Configuration of the persistence functionality.
321+
322+
Attributes:
323+
persistence_mode (google.cloud.redis_v1beta1.types.PersistenceConfig.PersistenceMode):
324+
Optional. Controls whether Persistence
325+
features are enabled. If not provided, the
326+
existing value will be used.
327+
rdb_snapshot_period (google.cloud.redis_v1beta1.types.PersistenceConfig.SnapshotPeriod):
328+
Optional. Period between RDB snapshots. Snapshots will be
329+
attempted every period starting from the provided snapshot
330+
start time. For example, a start time of 01/01/2033 06:45
331+
and SIX_HOURS snapshot period will do nothing until
332+
01/01/2033, and then trigger snapshots every day at 06:45,
333+
12:45, 18:45, and 00:45 the next day, and so on. If not
334+
provided, TWENTY_FOUR_HOURS will be used as default.
335+
rdb_next_snapshot_time (google.protobuf.timestamp_pb2.Timestamp):
336+
Output only. The next time that a snapshot
337+
attempt is scheduled to occur.
338+
rdb_snapshot_start_time (google.protobuf.timestamp_pb2.Timestamp):
339+
Optional. Date and time that the first
340+
snapshot was/will be attempted, and to which
341+
future snapshots will be aligned. If not
342+
provided, the current time will be used.
343+
"""
344+
345+
class PersistenceMode(proto.Enum):
346+
r"""Available Persistence modes."""
347+
PERSISTENCE_MODE_UNSPECIFIED = 0
348+
DISABLED = 1
349+
RDB = 2
350+
351+
class SnapshotPeriod(proto.Enum):
352+
r"""Available snapshot periods for scheduling."""
353+
SNAPSHOT_PERIOD_UNSPECIFIED = 0
354+
ONE_HOUR = 3
355+
SIX_HOURS = 4
356+
TWELVE_HOURS = 5
357+
TWENTY_FOUR_HOURS = 6
358+
359+
persistence_mode = proto.Field(proto.ENUM, number=1, enum=PersistenceMode,)
360+
rdb_snapshot_period = proto.Field(proto.ENUM, number=2, enum=SnapshotPeriod,)
361+
rdb_next_snapshot_time = proto.Field(
362+
proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,
363+
)
364+
rdb_snapshot_start_time = proto.Field(
365+
proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,
366+
)
310367

311368

312369
class RescheduleMaintenanceRequest(proto.Message):

0 commit comments

Comments
 (0)