Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions storage/src/create_bucket_turbo_replication.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use Google\Cloud\Storage\StorageClient;

/**
* Create a Cloud Storage Bucket with Turbo Replication set to `ASYNC_TURBO`.
* Create a Cloud Storage bucket with the recovery point objective (RPO) set to `ASYNC_TURBO`.
* The bucket must be a dual-region bucket for this setting to take effect.
*
* @param string $bucketName The name of your Cloud Storage bucket.
Expand All @@ -49,7 +49,7 @@ function create_bucket_turbo_replication($bucketName, $location = 'nam4')
'location' => $location,
'rpo' => $rpo
]);
printf('Bucket with Turbo Replication set to \'ASYNC_TURBO\' created: %s' . PHP_EOL, $bucket->name());
printf('Bucket with recovery point objective (RPO) set to \'ASYNC_TURBO\' created: %s' . PHP_EOL, $bucket->name());
}
# [END storage_create_bucket_turbo_replication]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
use Google\Cloud\Storage\StorageClient;

/**
* Get the bucket's Turbo Replication(rpo) setting.
* Get the bucket's recovery point objective (RPO) setting.
*
* @param string $bucketName the name of your Cloud Storage bucket.
*/
function get_turbo_replication_status($bucketName)
function get_rpo($bucketName)
{
// $bucketName = 'my-bucket';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @param string $bucketName the name of your Cloud Storage bucket.
*/
function set_turbo_replication_async_turbo($bucketName)
function set_rpo_async_turbo($bucketName)
{
// $bucketName = 'my-bucket';

Expand All @@ -45,7 +45,7 @@ function set_turbo_replication_async_turbo($bucketName)
]);

printf(
'Turbo Replication has been set to ASYNC_TURBO for %s.' . PHP_EOL,
'The replication behavior or recovery point objective (RPO) has been set to ASYNC_TURBO for %s.' . PHP_EOL,
$bucketName
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
use Google\Cloud\Storage\StorageClient;

/**
* Set the bucket's Turbo Replication(rpo) setting to `DEFAULT`.
* Set the bucket's replication behavior or recovery point objective (RPO) to `DEFAULT`.
*
* @param string $bucketName the name of your Cloud Storage bucket.
*/
function set_turbo_replication_default($bucketName)
function set_rpo_default($bucketName)
{
// $bucketName = 'my-bucket';

Expand All @@ -46,7 +46,7 @@ function set_turbo_replication_default($bucketName)
]);

printf(
'Turbo Replication has been set to DEFAULT for %s.' . PHP_EOL,
'The replication behavior or recovery point objective (RPO) has been set to DEFAULT for %s.' . PHP_EOL,
$bucketName
);
}
Expand Down
22 changes: 12 additions & 10 deletions storage/test/TurboReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
use PHPUnit\Framework\TestCase;

/**
* Unit tests for Turbo Replication(RPO)
* Unit tests to manage a bucket's recovery point objective (RPO). An RPO value set to `DEFAULT`
* indicates the default replication behavior is applied to the bucket.
* An RPO value set to `ASYNC_TURBO` indicates turbo replication is applied to the bucket.
*/
class TurboReplicationTest extends TestCase
{
Expand Down Expand Up @@ -52,7 +54,7 @@ public function testCreateBucketWithTurboReplication()

$this->assertStringContainsString(
sprintf(
'Bucket with Turbo Replication set to \'ASYNC_TURBO\' created: %s',
'Bucket with recovery point objective (RPO) set to \'ASYNC_TURBO\' created: %s',
self::$bucketName
),
$output
Expand All @@ -63,9 +65,9 @@ public function testCreateBucketWithTurboReplication()
}

/** @depends testCreateBucketWithTurboReplication */
public function testGetTurboReplicationStatus()
public function testGetRpo()
{
$output = self::runFunctionSnippet('get_turbo_replication_status', [
$output = self::runFunctionSnippet('get_rpo', [
self::$bucketName,
]);

Expand All @@ -79,15 +81,15 @@ public function testGetTurboReplicationStatus()
}

/** @depends testCreateBucketWithTurboReplication */
public function testSetTurboReplicationStatusDefault()
public function testSetRpoDefault()
{
$output = self::runFunctionSnippet('set_turbo_replication_default', [
$output = self::runFunctionSnippet('set_rpo_default', [
self::$bucketName,
]);

$this->assertEquals(
sprintf(
'Turbo Replication has been set to DEFAULT for %s.' . PHP_EOL,
'The replication behavior or recovery point objective (RPO) has been set to DEFAULT for %s.' . PHP_EOL,
self::$bucketName
),
$output
Expand All @@ -98,15 +100,15 @@ public function testSetTurboReplicationStatusDefault()
}

/** @depends testCreateBucketWithTurboReplication */
public function testSetTurboReplicationStatusAsyncTurbo()
public function testSetRpoAsyncTurbo()
{
$output = self::runFunctionSnippet('set_turbo_replication_async_turbo', [
$output = self::runFunctionSnippet('set_rpo_async_turbo', [
self::$bucketName,
]);

$this->assertEquals(
sprintf(
'Turbo Replication has been set to ASYNC_TURBO for %s.' . PHP_EOL,
'The replication behavior or recovery point objective (RPO) has been set to ASYNC_TURBO for %s.' . PHP_EOL,
self::$bucketName
),
$output
Expand Down