Skip to content

Commit b0bf411

Browse files
authored
docs(samples): Update the Recovery Point Objective (RPO) sample output (#725)
@ddelgrosso1 Related to b/217259317. Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-storage/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 3664dde commit b0bf411

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

google/cloud/storage/constants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@
119119
"""
120120

121121
RPO_ASYNC_TURBO = "ASYNC_TURBO"
122-
"""Turbo Replication RPO
122+
"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location.
123+
When the RPO value is set to ASYNC_TURBO, the turbo replication feature is enabled.
123124
124125
See: https://cloud.google.com/storage/docs/managing-turbo-replication
125126
"""
126127

127128
RPO_DEFAULT = "DEFAULT"
128-
"""Default RPO
129+
"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location.
130+
When the RPO value is set to DEFAULT, the default replication behavior is enabled.
129131
130132
See: https://cloud.google.com/storage/docs/managing-turbo-replication
131133
"""

samples/snippets/rpo_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ def test_get_rpo(dual_region_bucket, capsys):
4545
def test_set_rpo_async_turbo(dual_region_bucket, capsys):
4646
storage_set_rpo_async_turbo.set_rpo_async_turbo(dual_region_bucket.name)
4747
out, _ = capsys.readouterr()
48-
assert f"RPO is ASYNC_TURBO for {dual_region_bucket.name}." in out
48+
assert f"RPO is set to ASYNC_TURBO for {dual_region_bucket.name}." in out
4949

5050

5151
def test_set_rpo_default(dual_region_bucket, capsys):
5252
storage_set_rpo_default.set_rpo_default(dual_region_bucket.name)
5353
out, _ = capsys.readouterr()
54-
assert f"RPO is DEFAULT for {dual_region_bucket.name}." in out
54+
assert f"RPO is set to DEFAULT for {dual_region_bucket.name}." in out
5555

5656

5757
def test_create_bucket_turbo_replication(capsys):
5858
bucket_name = f"test-rpo-{uuid.uuid4()}"
5959
storage_create_bucket_turbo_replication.create_bucket_turbo_replication(bucket_name)
6060
out, _ = capsys.readouterr()
61-
assert f"{bucket_name} created with RPO ASYNC_TURBO in NAM4." in out
61+
assert f"{bucket_name} created with the recovery point objective (RPO) set to ASYNC_TURBO in NAM4." in out

samples/snippets/storage_create_bucket_turbo_replication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create_bucket_turbo_replication(bucket_name):
3939
bucket.rpo = RPO_ASYNC_TURBO
4040
bucket.create()
4141

42-
print(f"{bucket.name} created with RPO {bucket.rpo} in {bucket.location}.")
42+
print(f"{bucket.name} created with the recovery point objective (RPO) set to {bucket.rpo} in {bucket.location}.")
4343

4444

4545
# [END storage_create_bucket_turbo_replication]

samples/snippets/storage_set_rpo_async_turbo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def set_rpo_async_turbo(bucket_name):
3939
bucket.rpo = RPO_ASYNC_TURBO
4040
bucket.patch()
4141

42-
print(f"RPO is ASYNC_TURBO for {bucket.name}.")
42+
print(f"RPO is set to ASYNC_TURBO for {bucket.name}.")
4343

4444

4545
# [END storage_set_rpo_async_turbo]

samples/snippets/storage_set_rpo_default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import sys
1818

19-
"""Sample that sets RPO (Recovery Point Objective) to default
19+
"""Sample that sets the replication behavior or recovery point objective (RPO) to default.
2020
This sample is used on this page:
2121
https://cloud.google.com/storage/docs/managing-turbo-replication
2222
For more information, see README.md.
@@ -39,7 +39,7 @@ def set_rpo_default(bucket_name):
3939
bucket.rpo = RPO_DEFAULT
4040
bucket.patch()
4141

42-
print(f"RPO is DEFAULT for {bucket.name}.")
42+
print(f"RPO is set to DEFAULT for {bucket.name}.")
4343

4444

4545
# [END storage_set_rpo_default]

0 commit comments

Comments
 (0)