Skip to content

Commit 186ac90

Browse files
feat: [Memorystore] Add support for Basic Auth feature to Memorystore for Valkey (googleapis#9343)
* feat: A new resource_definition `cloudkms.googleapis.com/CryptoKey` is added feat: A new resource_definition `cloudkms.googleapis.com/CryptoKeyVersion` is added feat: A new resource_definition `compute.googleapis.com/NetworkAttachment` is added feat: A new oauth_scope `https://www.googleapis.com/auth/memorystore.read-only` is added to service `Memorystore` feat: A new oauth_scope `https://www.googleapis.com/auth/memorystore.read-write` is added to service `Memorystore` feat: A new method `RescheduleMaintenance` is added to service `Memorystore` feat: A new method `ListBackupCollections` is added to service `Memorystore` feat: A new method `GetBackupCollection` is added to service `Memorystore` feat: A new method `ListBackups` is added to service `Memorystore` feat: A new method `GetBackup` is added to service `Memorystore` feat: A new method `DeleteBackup` is added to service `Memorystore` feat: A new method `ExportBackup` is added to service `Memorystore` feat: A new method `BackupInstance` is added to service `Memorystore` feat: A new method `StartMigration` is added to service `Memorystore` feat: A new method `FinishMigration` is added to service `Memorystore` feat: A new method `ListTokenAuthUsers` is added to service `Memorystore` feat: A new method `GetTokenAuthUser` is added to service `Memorystore` feat: A new method `ListAuthTokens` is added to service `Memorystore` feat: A new method `GetAuthToken` is added to service `Memorystore` feat: A new method `AddTokenAuthUser` is added to service `Memorystore` feat: A new method `DeleteTokenAuthUser` is added to service `Memorystore` feat: A new method `AddAuthToken` is added to service `Memorystore` feat: A new method `DeleteAuthToken` is added to service `Memorystore` feat: A new field `target_engine_version` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `target_node_type` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new message `GcsBackupSource` is added feat: A new message `ManagedBackupSource` is added feat: A new value `MIGRATING` is added to enum `State` feat: A new value `TOKEN_AUTH` is added to enum `AuthorizationMode` feat: A new field `gcs_source` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `managed_backup_source` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `psc_attachment_details` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `simulate_maintenance_event` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `ondemand_maintenance` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `satisfies_pzs` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `satisfies_pzi` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `maintenance_policy` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `maintenance_schedule` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `cross_instance_replication_config` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `async_instance_endpoints_deletion_enabled` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `kms_key` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `encryption_info` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `backup_collection` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `automated_backup_config` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `maintenance_version` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `effective_maintenance_version` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `available_maintenance_versions` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `allow_fewer_zones_deployment` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new field `migration_config` is added to message `.google.cloud.memorystore.v1beta.Instance` feat: A new message `StartMigrationRequest` is added feat: A new message `FinishMigrationRequest` is added feat: A new message `SelfManagedSource` is added feat: A new message `MigrationConfig` is added feat: A new message `AutomatedBackupConfig` is added feat: A new message `BackupCollection` is added feat: A new resource_definition `memorystore.googleapis.com/BackupCollection` is added feat: A new message `Backup` is added feat: A new resource_definition `memorystore.googleapis.com/Backup` is added feat: A new message `BackupFile` is added feat: A new message `CrossInstanceReplicationConfig` is added feat: A new message `TokenAuthUser` is added feat: A new resource_definition `memorystore.googleapis.com/TokenAuthUser` is added feat: A new message `AuthToken` is added feat: A new resource_definition `memorystore.googleapis.com/AuthToken` is added feat: A new message `MaintenancePolicy` is added feat: A new message `WeeklyMaintenanceWindow` is added feat: A new message `MaintenanceSchedule` is added feat: A new message `PscAttachmentDetail` is added feat: A new field `port` is added to message `.google.cloud.memorystore.v1beta.PscConnection` feat: A new message `RescheduleMaintenanceRequest` is added feat: A new message `ListBackupCollectionsRequest` is added feat: A new message `ListBackupCollectionsResponse` is added feat: A new message `GetBackupCollectionRequest` is added feat: A new message `ListBackupsRequest` is added feat: A new message `ListBackupsResponse` is added feat: A new message `GetBackupRequest` is added feat: A new message `DeleteBackupRequest` is added feat: A new message `ExportBackupRequest` is added feat: A new message `BackupInstanceRequest` is added feat: A new message `ListTokenAuthUsersRequest` is added feat: A new message `ListTokenAuthUsersResponse` is added feat: A new message `GetTokenAuthUserRequest` is added feat: A new message `ListAuthTokensRequest` is added feat: A new message `ListAuthTokensResponse` is added feat: A new message `GetAuthTokenRequest` is added feat: A new message `AddTokenAuthUserRequest` is added feat: A new message `DeleteTokenAuthUserRequest` is added feat: A new message `AddAuthTokenRequest` is added feat: A new message `DeleteAuthTokenRequest` is added feat: A new message `EncryptionInfo` is added fix: Changed field behavior for an existing field `psc_connection_id` in message `.google.cloud.memorystore.v1beta.PscConnection` docs: A comment for field `psc_auto_connection` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `discovery_endpoints` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `node_type` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `engine_version` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `psc_auto_connections` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `mode` in message `.google.cloud.memorystore.v1beta.Instance` is changed docs: A comment for field `port` in message `.google.cloud.memorystore.v1beta.PscAutoConnection` is changed docs: A comment for field `network` in message `.google.cloud.memorystore.v1beta.PscAutoConnection` is changed docs: A comment for field `psc_connection_id` in message `.google.cloud.memorystore.v1beta.PscConnection` is changed docs: A comment for field `network` in message `.google.cloud.memorystore.v1beta.PscConnection` is changed docs: A comment for field `network` in message `.google.cloud.memorystore.v1beta.DiscoveryEndpoint` is changed docs: A comment for message `ListInstancesRequest` is changed docs: A comment for message `ListInstancesResponse` is changed docs: A comment for message `GetInstanceRequest` is changed docs: A comment for message `GetCertificateAuthorityRequest` is changed docs: A comment for message `GetSharedRegionalCertificateAuthorityRequest` is changed PiperOrigin-RevId: 947982065 Source-Link: googleapis/googleapis@669938a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c39efc9a372554cf03f96ba9bdcd907f38bd9d24 Copy-Tag: eyJwIjoiTWVtb3J5c3RvcmUvLk93bEJvdC55YW1sIiwiaCI6ImMzOWVmYzlhMzcyNTU0Y2YwM2Y5NmJhOWJkY2Q5MDdmMzhiZDlkMjQifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add support for Basic Auth feature to Memorystore for Valkey PiperOrigin-RevId: 949216188 Source-Link: googleapis/googleapis@69d7866 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6440493a63246d6d1505f362e7f57bea11b15339 Copy-Tag: eyJwIjoiTWVtb3J5c3RvcmUvLk93bEJvdC55YW1sIiwiaCI6IjY0NDA0OTNhNjMyNDZkNmQxNTA1ZjM2MmU3ZjU3YmVhMTFiMTUzMzkifQ== * 🦉 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 569ca88 commit 186ac90

122 files changed

Lines changed: 18091 additions & 544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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.

Memorystore/metadata/V1Beta/Memorystore.php

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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_AddAuthToken_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Memorystore\V1\AddAuthTokenRequest;
29+
use Google\Cloud\Memorystore\V1\AuthToken;
30+
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
31+
use Google\Cloud\Memorystore\V1\TokenAuthUser;
32+
use Google\Rpc\Status;
33+
34+
/**
35+
* Adds a token for a user of a token based auth enabled instance.
36+
*
37+
* @param string $formattedTokenAuthUser The name of the token auth user resource that this token will be
38+
* added for. Please see
39+
* {@see MemorystoreClient::tokenAuthUserName()} for help formatting this field.
40+
*/
41+
function add_auth_token_sample(string $formattedTokenAuthUser): void
42+
{
43+
// Create a client.
44+
$memorystoreClient = new MemorystoreClient();
45+
46+
// Prepare the request message.
47+
$authToken = new AuthToken();
48+
$request = (new AddAuthTokenRequest())
49+
->setTokenAuthUser($formattedTokenAuthUser)
50+
->setAuthToken($authToken);
51+
52+
// Call the API and handle any network failures.
53+
try {
54+
/** @var OperationResponse $response */
55+
$response = $memorystoreClient->addAuthToken($request);
56+
$response->pollUntilComplete();
57+
58+
if ($response->operationSucceeded()) {
59+
/** @var TokenAuthUser $result */
60+
$result = $response->getResult();
61+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
62+
} else {
63+
/** @var Status $error */
64+
$error = $response->getError();
65+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
66+
}
67+
} catch (ApiException $ex) {
68+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
69+
}
70+
}
71+
72+
/**
73+
* Helper to execute the sample.
74+
*
75+
* This sample has been automatically generated and should be regarded as a code
76+
* template only. It will require modifications to work:
77+
* - It may require correct/in-range values for request initialization.
78+
* - It may require specifying regional endpoints when creating the service client,
79+
* please see the apiEndpoint client configuration option for more details.
80+
*/
81+
function callSample(): void
82+
{
83+
$formattedTokenAuthUser = MemorystoreClient::tokenAuthUserName(
84+
'[PROJECT]',
85+
'[LOCATION]',
86+
'[INSTANCE]',
87+
'[TOKEN_AUTH_USER]'
88+
);
89+
90+
add_auth_token_sample($formattedTokenAuthUser);
91+
}
92+
// [END memorystore_v1_generated_Memorystore_AddAuthToken_sync]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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_AddTokenAuthUser_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Memorystore\V1\AddTokenAuthUserRequest;
29+
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
30+
use Google\Cloud\Memorystore\V1\Instance;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Adds a token auth user for a token based auth enabled instance.
35+
*
36+
* @param string $formattedInstance The instance resource that this token auth user will be added
37+
* for. Format: projects/{project}/locations/{location}/instances/{instance}
38+
* Please see {@see MemorystoreClient::instanceName()} for help formatting this field.
39+
* @param string $tokenAuthUser The name of the token auth user to add.
40+
*/
41+
function add_token_auth_user_sample(string $formattedInstance, string $tokenAuthUser): void
42+
{
43+
// Create a client.
44+
$memorystoreClient = new MemorystoreClient();
45+
46+
// Prepare the request message.
47+
$request = (new AddTokenAuthUserRequest())
48+
->setInstance($formattedInstance)
49+
->setTokenAuthUser($tokenAuthUser);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var OperationResponse $response */
54+
$response = $memorystoreClient->addTokenAuthUser($request);
55+
$response->pollUntilComplete();
56+
57+
if ($response->operationSucceeded()) {
58+
/** @var Instance $result */
59+
$result = $response->getResult();
60+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
61+
} else {
62+
/** @var Status $error */
63+
$error = $response->getError();
64+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
65+
}
66+
} catch (ApiException $ex) {
67+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
68+
}
69+
}
70+
71+
/**
72+
* Helper to execute the sample.
73+
*
74+
* This sample has been automatically generated and should be regarded as a code
75+
* template only. It will require modifications to work:
76+
* - It may require correct/in-range values for request initialization.
77+
* - It may require specifying regional endpoints when creating the service client,
78+
* please see the apiEndpoint client configuration option for more details.
79+
*/
80+
function callSample(): void
81+
{
82+
$formattedInstance = MemorystoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
83+
$tokenAuthUser = '[TOKEN_AUTH_USER]';
84+
85+
add_token_auth_user_sample($formattedInstance, $tokenAuthUser);
86+
}
87+
// [END memorystore_v1_generated_Memorystore_AddTokenAuthUser_sync]
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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_DeleteAuthToken_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
29+
use Google\Cloud\Memorystore\V1\DeleteAuthTokenRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a token for a user of a token based auth enabled instance.
34+
*
35+
* @param string $formattedName The name of the token auth user resource that this token will be
36+
* deleted from. Format:
37+
* projects/{project}/locations/{location}/instances/{instance}/tokenAuthUsers/{token_auth_user}/authTokens/{name}
38+
* Please see {@see MemorystoreClient::authTokenName()} for help formatting this field.
39+
*/
40+
function delete_auth_token_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$memorystoreClient = new MemorystoreClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteAuthTokenRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $memorystoreClient->deleteAuthToken($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
printf('Operation completed successfully.' . PHP_EOL);
57+
} else {
58+
/** @var Status $error */
59+
$error = $response->getError();
60+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
61+
}
62+
} catch (ApiException $ex) {
63+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
64+
}
65+
}
66+
67+
/**
68+
* Helper to execute the sample.
69+
*
70+
* This sample has been automatically generated and should be regarded as a code
71+
* template only. It will require modifications to work:
72+
* - It may require correct/in-range values for request initialization.
73+
* - It may require specifying regional endpoints when creating the service client,
74+
* please see the apiEndpoint client configuration option for more details.
75+
*/
76+
function callSample(): void
77+
{
78+
$formattedName = MemorystoreClient::authTokenName(
79+
'[PROJECT]',
80+
'[LOCATION]',
81+
'[INSTANCE]',
82+
'[TOKEN_AUTH_USER]',
83+
'[AUTH_TOKEN]'
84+
);
85+
86+
delete_auth_token_sample($formattedName);
87+
}
88+
// [END memorystore_v1_generated_Memorystore_DeleteAuthToken_sync]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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_DeleteTokenAuthUser_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
29+
use Google\Cloud\Memorystore\V1\DeleteTokenAuthUserRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a token auth user for a token based auth enabled instance.
34+
*
35+
* @param string $formattedName The name of the token auth user to delete.
36+
* Format:
37+
* projects/{project}/locations/{location}/instances/{instance}/tokenAuthUsers/{token_auth_user}
38+
* Please see {@see MemorystoreClient::tokenAuthUserName()} for help formatting this field.
39+
*/
40+
function delete_token_auth_user_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$memorystoreClient = new MemorystoreClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteTokenAuthUserRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $memorystoreClient->deleteTokenAuthUser($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
printf('Operation completed successfully.' . PHP_EOL);
57+
} else {
58+
/** @var Status $error */
59+
$error = $response->getError();
60+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
61+
}
62+
} catch (ApiException $ex) {
63+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
64+
}
65+
}
66+
67+
/**
68+
* Helper to execute the sample.
69+
*
70+
* This sample has been automatically generated and should be regarded as a code
71+
* template only. It will require modifications to work:
72+
* - It may require correct/in-range values for request initialization.
73+
* - It may require specifying regional endpoints when creating the service client,
74+
* please see the apiEndpoint client configuration option for more details.
75+
*/
76+
function callSample(): void
77+
{
78+
$formattedName = MemorystoreClient::tokenAuthUserName(
79+
'[PROJECT]',
80+
'[LOCATION]',
81+
'[INSTANCE]',
82+
'[TOKEN_AUTH_USER]'
83+
);
84+
85+
delete_token_auth_user_sample($formattedName);
86+
}
87+
// [END memorystore_v1_generated_Memorystore_DeleteTokenAuthUser_sync]

0 commit comments

Comments
 (0)