From b0bf411f8fec8712b3eeb99a2dd33de6d82312f8 Mon Sep 17 00:00:00 2001 From: Rebecca Peterson <44721098+rebecca-pete@users.noreply.github.com> Date: Fri, 20 May 2022 10:54:14 -0700 Subject: [PATCH] docs(samples): Update the Recovery Point Objective (RPO) sample output (#725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @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 # 🦕 --- google/cloud/storage/constants.py | 6 ++++-- samples/snippets/rpo_test.py | 6 +++--- samples/snippets/storage_create_bucket_turbo_replication.py | 2 +- samples/snippets/storage_set_rpo_async_turbo.py | 2 +- samples/snippets/storage_set_rpo_default.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/google/cloud/storage/constants.py b/google/cloud/storage/constants.py index b8ac87886..babbc5a42 100644 --- a/google/cloud/storage/constants.py +++ b/google/cloud/storage/constants.py @@ -119,13 +119,15 @@ """ RPO_ASYNC_TURBO = "ASYNC_TURBO" -"""Turbo Replication RPO +"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location. +When the RPO value is set to ASYNC_TURBO, the turbo replication feature is enabled. See: https://cloud.google.com/storage/docs/managing-turbo-replication """ RPO_DEFAULT = "DEFAULT" -"""Default RPO +"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location. +When the RPO value is set to DEFAULT, the default replication behavior is enabled. See: https://cloud.google.com/storage/docs/managing-turbo-replication """ diff --git a/samples/snippets/rpo_test.py b/samples/snippets/rpo_test.py index f1f16e7fb..befc0334a 100644 --- a/samples/snippets/rpo_test.py +++ b/samples/snippets/rpo_test.py @@ -45,17 +45,17 @@ def test_get_rpo(dual_region_bucket, capsys): def test_set_rpo_async_turbo(dual_region_bucket, capsys): storage_set_rpo_async_turbo.set_rpo_async_turbo(dual_region_bucket.name) out, _ = capsys.readouterr() - assert f"RPO is ASYNC_TURBO for {dual_region_bucket.name}." in out + assert f"RPO is set to ASYNC_TURBO for {dual_region_bucket.name}." in out def test_set_rpo_default(dual_region_bucket, capsys): storage_set_rpo_default.set_rpo_default(dual_region_bucket.name) out, _ = capsys.readouterr() - assert f"RPO is DEFAULT for {dual_region_bucket.name}." in out + assert f"RPO is set to DEFAULT for {dual_region_bucket.name}." in out def test_create_bucket_turbo_replication(capsys): bucket_name = f"test-rpo-{uuid.uuid4()}" storage_create_bucket_turbo_replication.create_bucket_turbo_replication(bucket_name) out, _ = capsys.readouterr() - assert f"{bucket_name} created with RPO ASYNC_TURBO in NAM4." in out + assert f"{bucket_name} created with the recovery point objective (RPO) set to ASYNC_TURBO in NAM4." in out diff --git a/samples/snippets/storage_create_bucket_turbo_replication.py b/samples/snippets/storage_create_bucket_turbo_replication.py index 68f0ba482..3d26616ec 100644 --- a/samples/snippets/storage_create_bucket_turbo_replication.py +++ b/samples/snippets/storage_create_bucket_turbo_replication.py @@ -39,7 +39,7 @@ def create_bucket_turbo_replication(bucket_name): bucket.rpo = RPO_ASYNC_TURBO bucket.create() - print(f"{bucket.name} created with RPO {bucket.rpo} in {bucket.location}.") + print(f"{bucket.name} created with the recovery point objective (RPO) set to {bucket.rpo} in {bucket.location}.") # [END storage_create_bucket_turbo_replication] diff --git a/samples/snippets/storage_set_rpo_async_turbo.py b/samples/snippets/storage_set_rpo_async_turbo.py index 10b4c67a3..a351cb8f8 100644 --- a/samples/snippets/storage_set_rpo_async_turbo.py +++ b/samples/snippets/storage_set_rpo_async_turbo.py @@ -39,7 +39,7 @@ def set_rpo_async_turbo(bucket_name): bucket.rpo = RPO_ASYNC_TURBO bucket.patch() - print(f"RPO is ASYNC_TURBO for {bucket.name}.") + print(f"RPO is set to ASYNC_TURBO for {bucket.name}.") # [END storage_set_rpo_async_turbo] diff --git a/samples/snippets/storage_set_rpo_default.py b/samples/snippets/storage_set_rpo_default.py index 8d41b1fe0..883fee0c9 100644 --- a/samples/snippets/storage_set_rpo_default.py +++ b/samples/snippets/storage_set_rpo_default.py @@ -16,7 +16,7 @@ import sys -"""Sample that sets RPO (Recovery Point Objective) to default +"""Sample that sets the replication behavior or recovery point objective (RPO) to default. This sample is used on this page: https://cloud.google.com/storage/docs/managing-turbo-replication For more information, see README.md. @@ -39,7 +39,7 @@ def set_rpo_default(bucket_name): bucket.rpo = RPO_DEFAULT bucket.patch() - print(f"RPO is DEFAULT for {bucket.name}.") + print(f"RPO is set to DEFAULT for {bucket.name}.") # [END storage_set_rpo_default]