Skip to content

Commit 5b1dec0

Browse files
feat: [RedisCluster] [Memorystore for Redis Cluster] Add support for Flexible CA feature (#9060)
* feat: [Memorystore for Redis Cluster] Add support for Flexible CA feature PiperOrigin-RevId: 891891848 Source-Link: googleapis/googleapis@0eb2a36 Source-Link: googleapis/googleapis-gen@e41edbe Copy-Tag: eyJwIjoiUmVkaXNDbHVzdGVyLy5Pd2xCb3QueWFtbCIsImgiOiJlNDFlZGJlZmE4YTI4NDkxZGYxODJlYzIyMzk0ZGU3MDM4MWU2MDE5In0= * 🦉 Updates from OwlBot post-processor 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 3ceff36 commit 5b1dec0

14 files changed

Lines changed: 833 additions & 1 deletion

RedisCluster/metadata/V1/CloudRedisCluster.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START redis_v1_generated_CloudRedisCluster_GetSharedRegionalCertificateAuthority_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Redis\Cluster\V1\Client\CloudRedisClusterClient;
28+
use Google\Cloud\Redis\Cluster\V1\GetSharedRegionalCertificateAuthorityRequest;
29+
use Google\Cloud\Redis\Cluster\V1\SharedRegionalCertificateAuthority;
30+
31+
/**
32+
* Gets the details of regional certificate authority information for Redis
33+
* cluster.
34+
*
35+
* @param string $formattedName Regional certificate authority resource name using the form:
36+
* `projects/{project_id}/locations/{location_id}/sharedRegionalCertificateAuthority`
37+
* where `location_id` refers to a Google Cloud region. Please see
38+
* {@see CloudRedisClusterClient::sharedRegionalCertificateAuthorityName()} for help formatting this field.
39+
*/
40+
function get_shared_regional_certificate_authority_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$cloudRedisClusterClient = new CloudRedisClusterClient();
44+
45+
// Prepare the request message.
46+
$request = (new GetSharedRegionalCertificateAuthorityRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var SharedRegionalCertificateAuthority $response */
52+
$response = $cloudRedisClusterClient->getSharedRegionalCertificateAuthority($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedName = CloudRedisClusterClient::sharedRegionalCertificateAuthorityName(
71+
'[PROJECT]',
72+
'[LOCATION]'
73+
);
74+
75+
get_shared_regional_certificate_authority_sample($formattedName);
76+
}
77+
// [END redis_v1_generated_CloudRedisCluster_GetSharedRegionalCertificateAuthority_sync]

RedisCluster/src/V1/Client/CloudRedisClusterClient.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@
5151
use Google\Cloud\Redis\Cluster\V1\GetBackupRequest;
5252
use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest;
5353
use Google\Cloud\Redis\Cluster\V1\GetClusterRequest;
54+
use Google\Cloud\Redis\Cluster\V1\GetSharedRegionalCertificateAuthorityRequest;
5455
use Google\Cloud\Redis\Cluster\V1\ListBackupCollectionsRequest;
5556
use Google\Cloud\Redis\Cluster\V1\ListBackupsRequest;
5657
use Google\Cloud\Redis\Cluster\V1\ListClustersRequest;
5758
use Google\Cloud\Redis\Cluster\V1\RescheduleClusterMaintenanceRequest;
59+
use Google\Cloud\Redis\Cluster\V1\SharedRegionalCertificateAuthority;
5860
use Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest;
5961
use Google\LongRunning\Client\OperationsClient;
6062
use Google\LongRunning\Operation;
@@ -96,6 +98,7 @@
9698
* @method PromiseInterface<BackupCollection> getBackupCollectionAsync(GetBackupCollectionRequest $request, array $optionalArgs = [])
9799
* @method PromiseInterface<Cluster> getClusterAsync(GetClusterRequest $request, array $optionalArgs = [])
98100
* @method PromiseInterface<CertificateAuthority> getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = [])
101+
* @method PromiseInterface<SharedRegionalCertificateAuthority> getSharedRegionalCertificateAuthorityAsync(GetSharedRegionalCertificateAuthorityRequest $request, array $optionalArgs = [])
99102
* @method PromiseInterface<PagedListResponse> listBackupCollectionsAsync(ListBackupCollectionsRequest $request, array $optionalArgs = [])
100103
* @method PromiseInterface<PagedListResponse> listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = [])
101104
* @method PromiseInterface<PagedListResponse> listClustersAsync(ListClustersRequest $request, array $optionalArgs = [])
@@ -244,6 +247,25 @@ public static function backupCollectionName(string $project, string $location, s
244247
]);
245248
}
246249

250+
/**
251+
* Formats a string containing the fully-qualified path to represent a ca_pool
252+
* resource.
253+
*
254+
* @param string $project
255+
* @param string $location
256+
* @param string $caPool
257+
*
258+
* @return string The formatted ca_pool resource.
259+
*/
260+
public static function caPoolName(string $project, string $location, string $caPool): string
261+
{
262+
return self::getPathTemplate('caPool')->render([
263+
'project' => $project,
264+
'location' => $location,
265+
'ca_pool' => $caPool,
266+
]);
267+
}
268+
247269
/**
248270
* Formats a string containing the fully-qualified path to represent a
249271
* certificate_authority resource.
@@ -403,12 +425,30 @@ public static function serviceAttachmentName(string $project, string $region, st
403425
]);
404426
}
405427

428+
/**
429+
* Formats a string containing the fully-qualified path to represent a
430+
* shared_regional_certificate_authority resource.
431+
*
432+
* @param string $project
433+
* @param string $location
434+
*
435+
* @return string The formatted shared_regional_certificate_authority resource.
436+
*/
437+
public static function sharedRegionalCertificateAuthorityName(string $project, string $location): string
438+
{
439+
return self::getPathTemplate('sharedRegionalCertificateAuthority')->render([
440+
'project' => $project,
441+
'location' => $location,
442+
]);
443+
}
444+
406445
/**
407446
* Parses a formatted name string and returns an associative array of the components in the name.
408447
* The following name formats are supported:
409448
* Template: Pattern
410449
* - backup: projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}
411450
* - backupCollection: projects/{project}/locations/{location}/backupCollections/{backup_collection}
451+
* - caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
412452
* - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority
413453
* - cluster: projects/{project}/locations/{location}/clusters/{cluster}
414454
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
@@ -417,6 +457,7 @@ public static function serviceAttachmentName(string $project, string $region, st
417457
* - location: projects/{project}/locations/{location}
418458
* - network: projects/{project}/global/networks/{network}
419459
* - serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
460+
* - sharedRegionalCertificateAuthority: projects/{project}/locations/{location}/sharedRegionalCertificateAuthority
420461
*
421462
* The optional $template argument can be supplied to specify a particular pattern,
422463
* and must match one of the templates listed above. If no $template argument is
@@ -779,6 +820,36 @@ public function getClusterCertificateAuthority(
779820
return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait();
780821
}
781822

823+
/**
824+
* Gets the details of regional certificate authority information for Redis
825+
* cluster.
826+
*
827+
* The async variant is
828+
* {@see CloudRedisClusterClient::getSharedRegionalCertificateAuthorityAsync()} .
829+
*
830+
* @example samples/V1/CloudRedisClusterClient/get_shared_regional_certificate_authority.php
831+
*
832+
* @param GetSharedRegionalCertificateAuthorityRequest $request A request to house fields associated with the call.
833+
* @param array $callOptions {
834+
* Optional.
835+
*
836+
* @type RetrySettings|array $retrySettings
837+
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
838+
* associative array of retry settings parameters. See the documentation on
839+
* {@see RetrySettings} for example usage.
840+
* }
841+
*
842+
* @return SharedRegionalCertificateAuthority
843+
*
844+
* @throws ApiException Thrown if the API call fails.
845+
*/
846+
public function getSharedRegionalCertificateAuthority(
847+
GetSharedRegionalCertificateAuthorityRequest $request,
848+
array $callOptions = []
849+
): SharedRegionalCertificateAuthority {
850+
return $this->startApiCall('GetSharedRegionalCertificateAuthority', $request, $callOptions)->wait();
851+
}
852+
782853
/**
783854
* Lists all backup collections owned by a consumer project in either the
784855
* specified location (region) or all locations.

RedisCluster/src/V1/Cluster.php

Lines changed: 140 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)