Skip to content

Commit 0cac659

Browse files
feat: [Memorystore] [Memorystore for Valkey] Add support for Flexible CA feature (#9061)
* feat: [Memorystore for Valkey] Add support for Flexible CA feature PiperOrigin-RevId: 892004368 Source-Link: googleapis/googleapis@456866b Source-Link: googleapis/googleapis-gen@3b3ecd8 Copy-Tag: eyJwIjoiTWVtb3J5c3RvcmUvLk93bEJvdC55YW1sIiwiaCI6IjNiM2VjZDhmNGM4YjVhNTYyMWFmODJkY2EwMjgwNWYyN2I2OWZhMDYifQ== * 🦉 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 5b1dec0 commit 0cac659

14 files changed

Lines changed: 854 additions & 1 deletion

Memorystore/metadata/V1/Memorystore.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 memorystore_v1_generated_Memorystore_GetSharedRegionalCertificateAuthority_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
28+
use Google\Cloud\Memorystore\V1\GetSharedRegionalCertificateAuthorityRequest;
29+
use Google\Cloud\Memorystore\V1\SharedRegionalCertificateAuthority;
30+
31+
/**
32+
* Gets the details of shared regional certificate authority information for
33+
* Memorystore instance.
34+
*
35+
* @param string $formattedName Regional certificate authority resource name using the form:
36+
* `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority`
37+
* where `location_id` refers to a Google Cloud region. Please see
38+
* {@see MemorystoreClient::sharedRegionalCertificateAuthorityName()} for help formatting this field.
39+
*/
40+
function get_shared_regional_certificate_authority_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$memorystoreClient = new MemorystoreClient();
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 = $memorystoreClient->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 = MemorystoreClient::sharedRegionalCertificateAuthorityName(
71+
'[PROJECT]',
72+
'[LOCATION]'
73+
);
74+
75+
get_shared_regional_certificate_authority_sample($formattedName);
76+
}
77+
// [END memorystore_v1_generated_Memorystore_GetSharedRegionalCertificateAuthority_sync]

Memorystore/src/V1/Client/MemorystoreClient.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@
5050
use Google\Cloud\Memorystore\V1\GetBackupRequest;
5151
use Google\Cloud\Memorystore\V1\GetCertificateAuthorityRequest;
5252
use Google\Cloud\Memorystore\V1\GetInstanceRequest;
53+
use Google\Cloud\Memorystore\V1\GetSharedRegionalCertificateAuthorityRequest;
5354
use Google\Cloud\Memorystore\V1\Instance;
5455
use Google\Cloud\Memorystore\V1\ListBackupCollectionsRequest;
5556
use Google\Cloud\Memorystore\V1\ListBackupsRequest;
5657
use Google\Cloud\Memorystore\V1\ListInstancesRequest;
5758
use Google\Cloud\Memorystore\V1\RescheduleMaintenanceRequest;
59+
use Google\Cloud\Memorystore\V1\SharedRegionalCertificateAuthority;
5860
use Google\Cloud\Memorystore\V1\UpdateInstanceRequest;
5961
use Google\LongRunning\Client\OperationsClient;
6062
use Google\LongRunning\Operation;
@@ -81,6 +83,7 @@
8183
* @method PromiseInterface<BackupCollection> getBackupCollectionAsync(GetBackupCollectionRequest $request, array $optionalArgs = [])
8284
* @method PromiseInterface<CertificateAuthority> getCertificateAuthorityAsync(GetCertificateAuthorityRequest $request, array $optionalArgs = [])
8385
* @method PromiseInterface<Instance> getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = [])
86+
* @method PromiseInterface<SharedRegionalCertificateAuthority> getSharedRegionalCertificateAuthorityAsync(GetSharedRegionalCertificateAuthorityRequest $request, array $optionalArgs = [])
8487
* @method PromiseInterface<PagedListResponse> listBackupCollectionsAsync(ListBackupCollectionsRequest $request, array $optionalArgs = [])
8588
* @method PromiseInterface<PagedListResponse> listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = [])
8689
* @method PromiseInterface<PagedListResponse> listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = [])
@@ -241,6 +244,25 @@ public static function backupCollectionName(string $project, string $location, s
241244
]);
242245
}
243246

247+
/**
248+
* Formats a string containing the fully-qualified path to represent a ca_pool
249+
* resource.
250+
*
251+
* @param string $project
252+
* @param string $location
253+
* @param string $caPool
254+
*
255+
* @return string The formatted ca_pool resource.
256+
*/
257+
public static function caPoolName(string $project, string $location, string $caPool): string
258+
{
259+
return self::getPathTemplate('caPool')->render([
260+
'project' => $project,
261+
'location' => $location,
262+
'ca_pool' => $caPool,
263+
]);
264+
}
265+
244266
/**
245267
* Formats a string containing the fully-qualified path to represent a crypto_key
246268
* resource.
@@ -381,19 +403,38 @@ public static function serviceAttachmentName(string $project, string $region, st
381403
]);
382404
}
383405

406+
/**
407+
* Formats a string containing the fully-qualified path to represent a
408+
* shared_regional_certificate_authority resource.
409+
*
410+
* @param string $project
411+
* @param string $location
412+
*
413+
* @return string The formatted shared_regional_certificate_authority resource.
414+
*/
415+
public static function sharedRegionalCertificateAuthorityName(string $project, string $location): string
416+
{
417+
return self::getPathTemplate('sharedRegionalCertificateAuthority')->render([
418+
'project' => $project,
419+
'location' => $location,
420+
]);
421+
}
422+
384423
/**
385424
* Parses a formatted name string and returns an associative array of the components in the name.
386425
* The following name formats are supported:
387426
* Template: Pattern
388427
* - backup: projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}
389428
* - backupCollection: projects/{project}/locations/{location}/backupCollections/{backup_collection}
429+
* - caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
390430
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
391431
* - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
392432
* - forwardingRule: projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
393433
* - instance: projects/{project}/locations/{location}/instances/{instance}
394434
* - location: projects/{project}/locations/{location}
395435
* - network: projects/{project}/global/networks/{network}
396436
* - serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
437+
* - sharedRegionalCertificateAuthority: projects/{project}/locations/{location}/sharedRegionalCertificateAuthority
397438
*
398439
* The optional $template argument can be supplied to specify a particular pattern,
399440
* and must match one of the templates listed above. If no $template argument is
@@ -743,6 +784,36 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = []
743784
return $this->startApiCall('GetInstance', $request, $callOptions)->wait();
744785
}
745786

787+
/**
788+
* Gets the details of shared regional certificate authority information for
789+
* Memorystore instance.
790+
*
791+
* The async variant is
792+
* {@see MemorystoreClient::getSharedRegionalCertificateAuthorityAsync()} .
793+
*
794+
* @example samples/V1/MemorystoreClient/get_shared_regional_certificate_authority.php
795+
*
796+
* @param GetSharedRegionalCertificateAuthorityRequest $request A request to house fields associated with the call.
797+
* @param array $callOptions {
798+
* Optional.
799+
*
800+
* @type RetrySettings|array $retrySettings
801+
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
802+
* associative array of retry settings parameters. See the documentation on
803+
* {@see RetrySettings} for example usage.
804+
* }
805+
*
806+
* @return SharedRegionalCertificateAuthority
807+
*
808+
* @throws ApiException Thrown if the API call fails.
809+
*/
810+
public function getSharedRegionalCertificateAuthority(
811+
GetSharedRegionalCertificateAuthorityRequest $request,
812+
array $callOptions = []
813+
): SharedRegionalCertificateAuthority {
814+
return $this->startApiCall('GetSharedRegionalCertificateAuthority', $request, $callOptions)->wait();
815+
}
816+
746817
/**
747818
* Lists all backup collections owned by a consumer project in either the
748819
* specified location (region) or all locations.

Memorystore/src/V1/GetSharedRegionalCertificateAuthorityRequest.php

Lines changed: 92 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)