Skip to content

Commit f788544

Browse files
feat: [StorageControl] Add new CreateRapidCache (#9395)
* feat: Add new CreateRapidCache feat: Add new UpdateRapidCache feat: Add new GetRapidCache feat: Add new ListRapidCache docs: Update reference documentation for the `StorageControl` service, including `IntelligenceFindings`, `AnywhereCache`, and related configuration messages. PiperOrigin-RevId: 953328804 Source-Link: googleapis/googleapis@ede8b2e Source-Link: googleapis/googleapis-gen@58273f2 Copy-Tag: eyJwIjoiU3RvcmFnZUNvbnRyb2wvLk93bEJvdC55YW1sIiwiaCI6IjU4MjczZjJhNGQyOTQ2N2E0ZDdlMDExYTQyNzNlYWM2YmNlOTRlMWMifQ== * 🦉 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 2aa36cf commit f788544

41 files changed

Lines changed: 4024 additions & 56 deletions

Some content is hidden

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

StorageControl/metadata/V2/StorageControl.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: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 storage_v2_generated_StorageControl_CreateRapidCache_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
29+
use Google\Cloud\Storage\Control\V2\CreateRapidCacheRequest;
30+
use Google\Cloud\Storage\Control\V2\RapidCache;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Creates a Rapid Cache instance.
35+
*
36+
* @param string $formattedParent The bucket to which this cache belongs.
37+
* Format: `projects/{project}/buckets/{bucket}`
38+
* Please see {@see StorageControlClient::bucketName()} for help formatting this field.
39+
*/
40+
function create_rapid_cache_sample(string $formattedParent): void
41+
{
42+
// Create a client.
43+
$storageControlClient = new StorageControlClient();
44+
45+
// Prepare the request message.
46+
$rapidCache = new RapidCache();
47+
$request = (new CreateRapidCacheRequest())
48+
->setParent($formattedParent)
49+
->setRapidCache($rapidCache);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var OperationResponse $response */
54+
$response = $storageControlClient->createRapidCache($request);
55+
$response->pollUntilComplete();
56+
57+
if ($response->operationSucceeded()) {
58+
/** @var RapidCache $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+
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
83+
84+
create_rapid_cache_sample($formattedParent);
85+
}
86+
// [END storage_v2_generated_StorageControl_CreateRapidCache_sync]
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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 storage_v2_generated_StorageControl_GetRapidCache_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
28+
use Google\Cloud\Storage\Control\V2\GetRapidCacheRequest;
29+
use Google\Cloud\Storage\Control\V2\RapidCache;
30+
31+
/**
32+
* Gets a Rapid Cache instance.
33+
*
34+
* @param string $formattedName The name field in the request should be:
35+
* `projects/{project}/buckets/{bucket}/rapidCaches/{rapid_cache}`
36+
* Please see {@see StorageControlClient::rapidCacheName()} for help formatting this field.
37+
*/
38+
function get_rapid_cache_sample(string $formattedName): void
39+
{
40+
// Create a client.
41+
$storageControlClient = new StorageControlClient();
42+
43+
// Prepare the request message.
44+
$request = (new GetRapidCacheRequest())
45+
->setName($formattedName);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var RapidCache $response */
50+
$response = $storageControlClient->getRapidCache($request);
51+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
52+
} catch (ApiException $ex) {
53+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
54+
}
55+
}
56+
57+
/**
58+
* Helper to execute the sample.
59+
*
60+
* This sample has been automatically generated and should be regarded as a code
61+
* template only. It will require modifications to work:
62+
* - It may require correct/in-range values for request initialization.
63+
* - It may require specifying regional endpoints when creating the service client,
64+
* please see the apiEndpoint client configuration option for more details.
65+
*/
66+
function callSample(): void
67+
{
68+
$formattedName = StorageControlClient::rapidCacheName('[PROJECT]', '[BUCKET]', '[RAPID_CACHE]');
69+
70+
get_rapid_cache_sample($formattedName);
71+
}
72+
// [END storage_v2_generated_StorageControl_GetRapidCache_sync]

StorageControl/samples/V2/StorageControlClient/list_intelligence_findings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
use Google\Cloud\Storage\Control\V2\ListIntelligenceFindingsRequest;
3131

3232
/**
33-
* Lists the `IntelligenceFinding` resources for the specified project.
33+
* Lists the `IntelligenceFinding` resources for the specified the project.
3434
*
3535
* @param string $formattedParent The parent of the `IntelligenceFinding` resource.
3636
*
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 storage_v2_generated_StorageControl_ListRapidCaches_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
29+
use Google\Cloud\Storage\Control\V2\ListRapidCachesRequest;
30+
use Google\Cloud\Storage\Control\V2\RapidCache;
31+
32+
/**
33+
* Lists Rapid Cache instances for a given bucket.
34+
*
35+
* @param string $formattedParent The bucket to which this cache belongs. Please see
36+
* {@see StorageControlClient::bucketName()} for help formatting this field.
37+
*/
38+
function list_rapid_caches_sample(string $formattedParent): void
39+
{
40+
// Create a client.
41+
$storageControlClient = new StorageControlClient();
42+
43+
// Prepare the request message.
44+
$request = (new ListRapidCachesRequest())
45+
->setParent($formattedParent);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var PagedListResponse $response */
50+
$response = $storageControlClient->listRapidCaches($request);
51+
52+
/** @var RapidCache $element */
53+
foreach ($response as $element) {
54+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
55+
}
56+
} catch (ApiException $ex) {
57+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
58+
}
59+
}
60+
61+
/**
62+
* Helper to execute the sample.
63+
*
64+
* This sample has been automatically generated and should be regarded as a code
65+
* template only. It will require modifications to work:
66+
* - It may require correct/in-range values for request initialization.
67+
* - It may require specifying regional endpoints when creating the service client,
68+
* please see the apiEndpoint client configuration option for more details.
69+
*/
70+
function callSample(): void
71+
{
72+
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
73+
74+
list_rapid_caches_sample($formattedParent);
75+
}
76+
// [END storage_v2_generated_StorageControl_ListRapidCaches_sync]

StorageControl/samples/V2/StorageControlClient/summarize_intelligence_findings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
use Google\Cloud\Storage\Control\V2\SummarizeIntelligenceFindingsRequest;
3131

3232
/**
33-
* Summarize the intelligence findings for the specified scope(org, folder or
34-
* project).
33+
* Summarizes the intelligence findings for the specified scope (organization,
34+
* folder or project).
3535
*
3636
* @param string $parent The scope to summarize the findings for.
3737
* Format:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 storage_v2_generated_StorageControl_UpdateManagedFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
28+
use Google\Cloud\Storage\Control\V2\ManagedFolder;
29+
use Google\Cloud\Storage\Control\V2\UpdateManagedFolderRequest;
30+
31+
/**
32+
* Updates a managed folder. Currently, this RPC only supports updating the
33+
* `rapid_cache_config` field.
34+
*
35+
* This sample has been automatically generated and should be regarded as a code
36+
* template only. It will require modifications to work:
37+
* - It may require correct/in-range values for request initialization.
38+
* - It may require specifying regional endpoints when creating the service client,
39+
* please see the apiEndpoint client configuration option for more details.
40+
*/
41+
function update_managed_folder_sample(): void
42+
{
43+
// Create a client.
44+
$storageControlClient = new StorageControlClient();
45+
46+
// Prepare the request message.
47+
$managedFolder = new ManagedFolder();
48+
$request = (new UpdateManagedFolderRequest())
49+
->setManagedFolder($managedFolder);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var ManagedFolder $response */
54+
$response = $storageControlClient->updateManagedFolder($request);
55+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
56+
} catch (ApiException $ex) {
57+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
58+
}
59+
}
60+
// [END storage_v2_generated_StorageControl_UpdateManagedFolder_sync]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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 storage_v2_generated_StorageControl_UpdateRapidCache_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
29+
use Google\Cloud\Storage\Control\V2\RapidCache;
30+
use Google\Cloud\Storage\Control\V2\UpdateRapidCacheRequest;
31+
use Google\Protobuf\FieldMask;
32+
use Google\Rpc\Status;
33+
34+
/**
35+
* Updates a Rapid Cache instance.
36+
*
37+
* This sample has been automatically generated and should be regarded as a code
38+
* template only. It will require modifications to work:
39+
* - It may require correct/in-range values for request initialization.
40+
* - It may require specifying regional endpoints when creating the service client,
41+
* please see the apiEndpoint client configuration option for more details.
42+
*/
43+
function update_rapid_cache_sample(): void
44+
{
45+
// Create a client.
46+
$storageControlClient = new StorageControlClient();
47+
48+
// Prepare the request message.
49+
$rapidCache = new RapidCache();
50+
$updateMask = new FieldMask();
51+
$request = (new UpdateRapidCacheRequest())
52+
->setRapidCache($rapidCache)
53+
->setUpdateMask($updateMask);
54+
55+
// Call the API and handle any network failures.
56+
try {
57+
/** @var OperationResponse $response */
58+
$response = $storageControlClient->updateRapidCache($request);
59+
$response->pollUntilComplete();
60+
61+
if ($response->operationSucceeded()) {
62+
/** @var RapidCache $result */
63+
$result = $response->getResult();
64+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
65+
} else {
66+
/** @var Status $error */
67+
$error = $response->getError();
68+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
69+
}
70+
} catch (ApiException $ex) {
71+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
72+
}
73+
}
74+
// [END storage_v2_generated_StorageControl_UpdateRapidCache_sync]

0 commit comments

Comments
 (0)