Skip to content

Commit ecf54be

Browse files
feat: [NetApp] Update NetApp v1 API with Host Groups, Block Volumes, Cache Volumes, and Backup Restore (#8862)
* feat: Update NetApp v1 API with Host Groups, Block Volumes, Cache Volumes, and Backup Restore This CL introduces several new features and enhancements to the NetApp API: - **Host Groups:** Added a new `HostGroup` resource to manage collections of hosts for Block Volume access. Includes full CRUD operations. - **Block Volumes:** Enhanced the `Volume` resource to support `ISCSI` protocol and `BlockDevice` configurations. - **Cache Volumes:** Added `CacheParameters` to the `Volume` resource to support FlexCache volumes. - **Backup Restore:** Introduced a new `RestoreBackupFiles` RPC to restore individual files from a backup. - **CMEK for Backup Vaults:** Added fields to `BackupVault` to support Customer Managed Encryption Keys (CMEK). - **Storage Pool Type:** Added a `type` field to `StoragePool` to specify support for FILE, UNIFIED, or UNIFIED_LARGE_CAPACITY volumes. - **Location Metadata:** Added `has_ontap_proxy` flag. - Updated copyright year to 2026. docs: A comment for field `backup_retention_policy` in message `.google.cloud.netapp.v1.BackupVault` is changed docs: A comment for message `KmsConfig` is changed docs: A comment for field `name` in message `.google.cloud.netapp.v1.KmsConfig` is changed docs: A comment for field `crypto_key_name` in message `.google.cloud.netapp.v1.KmsConfig` is changed docs: A comment for enum `SquashMode` is changed docs: A comment for enum value `SQUASH_MODE_UNSPECIFIED` in enum `SquashMode` is changed docs: A comment for field `anon_uid` in message `.google.cloud.netapp.v1.SimpleExportPolicyRule` is changed PiperOrigin-RevId: 856056649 Source-Link: googleapis/googleapis@94aa4f5 Source-Link: googleapis/googleapis-gen@d3ff194 Copy-Tag: eyJwIjoiTmV0QXBwLy5Pd2xCb3QueWFtbCIsImgiOiJkM2ZmMTk0MjNjNmUxMzJmYmE5MTIwYTRmMjI2OTE5ZTJkNjNhNTAyIn0= * 🦉 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 e948ad3 commit ecf54be

Some content is hidden

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

49 files changed

+5094
-58
lines changed

NetApp/metadata/V1/BackupVault.php

367 Bytes
Binary file not shown.

NetApp/metadata/V1/CloudNetappService.php

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

NetApp/metadata/V1/Common.php

204 Bytes
Binary file not shown.

NetApp/metadata/V1/HostGroup.php

2.64 KB
Binary file not shown.

NetApp/metadata/V1/Kms.php

170 Bytes
Binary file not shown.

NetApp/metadata/V1/StoragePool.php

75 Bytes
Binary file not shown.

NetApp/metadata/V1/Volume.php

1.76 KB
Binary file not shown.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 netapp_v1_generated_NetApp_CreateHostGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\NetApp\V1\Client\NetAppClient;
29+
use Google\Cloud\NetApp\V1\CreateHostGroupRequest;
30+
use Google\Cloud\NetApp\V1\HostGroup;
31+
use Google\Cloud\NetApp\V1\HostGroup\Type;
32+
use Google\Cloud\NetApp\V1\OsType;
33+
use Google\Rpc\Status;
34+
35+
/**
36+
* Creates a new host group.
37+
*
38+
* @param string $formattedParent Parent value for CreateHostGroupRequest
39+
* Please see {@see NetAppClient::locationName()} for help formatting this field.
40+
* @param int $hostGroupType Type of the host group.
41+
* @param string $hostGroupHostsElement The list of hosts associated with the host group.
42+
* @param int $hostGroupOsType The OS type of the host group. It indicates the type of operating
43+
* system used by all of the hosts in the HostGroup. All hosts in a HostGroup
44+
* must be of the same OS type. This can be set only when creating a
45+
* HostGroup.
46+
* @param string $hostGroupId ID of the host group to create. Must be unique within the parent
47+
* resource. Must contain only letters, numbers, and hyphen, with
48+
* the first character a letter or underscore, the last a letter or underscore
49+
* or a number, and a 63 character maximum.
50+
*/
51+
function create_host_group_sample(
52+
string $formattedParent,
53+
int $hostGroupType,
54+
string $hostGroupHostsElement,
55+
int $hostGroupOsType,
56+
string $hostGroupId
57+
): void {
58+
// Create a client.
59+
$netAppClient = new NetAppClient();
60+
61+
// Prepare the request message.
62+
$hostGroupHosts = [$hostGroupHostsElement,];
63+
$hostGroup = (new HostGroup())
64+
->setType($hostGroupType)
65+
->setHosts($hostGroupHosts)
66+
->setOsType($hostGroupOsType);
67+
$request = (new CreateHostGroupRequest())
68+
->setParent($formattedParent)
69+
->setHostGroup($hostGroup)
70+
->setHostGroupId($hostGroupId);
71+
72+
// Call the API and handle any network failures.
73+
try {
74+
/** @var OperationResponse $response */
75+
$response = $netAppClient->createHostGroup($request);
76+
$response->pollUntilComplete();
77+
78+
if ($response->operationSucceeded()) {
79+
/** @var HostGroup $result */
80+
$result = $response->getResult();
81+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
82+
} else {
83+
/** @var Status $error */
84+
$error = $response->getError();
85+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
86+
}
87+
} catch (ApiException $ex) {
88+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
89+
}
90+
}
91+
92+
/**
93+
* Helper to execute the sample.
94+
*
95+
* This sample has been automatically generated and should be regarded as a code
96+
* template only. It will require modifications to work:
97+
* - It may require correct/in-range values for request initialization.
98+
* - It may require specifying regional endpoints when creating the service client,
99+
* please see the apiEndpoint client configuration option for more details.
100+
*/
101+
function callSample(): void
102+
{
103+
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
104+
$hostGroupType = Type::TYPE_UNSPECIFIED;
105+
$hostGroupHostsElement = '[HOSTS]';
106+
$hostGroupOsType = OsType::OS_TYPE_UNSPECIFIED;
107+
$hostGroupId = '[HOST_GROUP_ID]';
108+
109+
create_host_group_sample(
110+
$formattedParent,
111+
$hostGroupType,
112+
$hostGroupHostsElement,
113+
$hostGroupOsType,
114+
$hostGroupId
115+
);
116+
}
117+
// [END netapp_v1_generated_NetApp_CreateHostGroup_sync]

NetApp/samples/V1/NetAppClient/create_kms_config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* resource. Must contain only letters, numbers and hyphen, with the first
4040
* character a letter, the last a letter or a
4141
* number, and a 63 character maximum.
42-
* @param string $kmsConfigCryptoKeyName Customer managed crypto key resource full name. Format:
43-
* projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{key}.
42+
* @param string $kmsConfigCryptoKeyName Customer-managed crypto key resource full name. Format:
43+
* `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
4444
*/
4545
function create_kms_config_sample(
4646
string $formattedParent,
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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 netapp_v1_generated_NetApp_DeleteHostGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\NetApp\V1\Client\NetAppClient;
29+
use Google\Cloud\NetApp\V1\DeleteHostGroupRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a host group.
34+
*
35+
* @param string $formattedName The resource name of the host group.
36+
* Format:
37+
* `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`. Please see
38+
* {@see NetAppClient::hostGroupName()} for help formatting this field.
39+
*/
40+
function delete_host_group_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$netAppClient = new NetAppClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteHostGroupRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $netAppClient->deleteHostGroup($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 = NetAppClient::hostGroupName('[PROJECT]', '[LOCATION]', '[HOST_GROUP]');
79+
80+
delete_host_group_sample($formattedName);
81+
}
82+
// [END netapp_v1_generated_NetApp_DeleteHostGroup_sync]

0 commit comments

Comments
 (0)