Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [NetApp] Enable creation of Onprem Migration in CreateVolume #7850

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified NetApp/metadata/V1/ActiveDirectory.php
Binary file not shown.
10 changes: 7 additions & 3 deletions NetApp/metadata/V1/CloudNetappService.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified NetApp/metadata/V1/Replication.php
Binary file not shown.
Binary file modified NetApp/metadata/V1/Volume.php
Binary file not shown.
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_active_directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
* @param string $activeDirectoryUsername Username of the Active Directory domain administrator.
* @param string $activeDirectoryPassword Password of the Active Directory domain administrator.
* @param string $activeDirectoryId ID of the active directory to create. Must be unique within the
* parent resource. Must contain only letters, numbers, underscore and hyphen,
* with the first character a letter or underscore, the last a letter or
* underscore or a number, and a 63 character maximum.
* parent resource. Must contain only letters, numbers and hyphen, with the
* first character a letter , the last a letter or a number, and a 63
* character maximum.
*/
function create_active_directory_sample(
string $formattedParent,
Expand Down
4 changes: 2 additions & 2 deletions NetApp/samples/V1/NetAppClient/create_backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* Please see {@see NetAppClient::backupVaultName()} for help formatting this field.
* @param string $backupId The ID to use for the backup.
* The ID must be unique within the specified backupVault.
* Must contain only letters, numbers, underscore and hyphen, with the first
* character a letter or underscore, the last a letter or underscore or a
* Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
*/
function create_backup_sample(string $formattedParent, string $backupId): void
Expand Down
4 changes: 2 additions & 2 deletions NetApp/samples/V1/NetAppClient/create_backup_policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
* Please see {@see NetAppClient::locationName()} for help formatting this field.
* @param string $backupPolicyId The ID to use for the backup policy.
* The ID must be unique within the specified location.
* Must contain only letters, numbers, underscore and hyphen, with the first
* character a letter or underscore, the last a letter or underscore or a
* Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
*/
function create_backup_policy_sample(string $formattedParent, string $backupPolicyId): void
Expand Down
4 changes: 2 additions & 2 deletions NetApp/samples/V1/NetAppClient/create_backup_vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
* Please see {@see NetAppClient::locationName()} for help formatting this field.
* @param string $backupVaultId The ID to use for the backupVault.
* The ID must be unique within the specified location.
* Must contain only letters, numbers, underscore and hyphen, with the first
* character a letter or underscore, the last a letter or underscore or a
* Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
*/
function create_backup_vault_sample(string $formattedParent, string $backupVaultId): void
Expand Down
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_kms_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
* @param string $formattedParent Value for parent. Please see
* {@see NetAppClient::locationName()} for help formatting this field.
* @param string $kmsConfigId Id of the requesting KmsConfig. Must be unique within the parent
* resource. Must contain only letters, numbers, underscore and hyphen, with
* the first character a letter or underscore, the last a letter or underscore
* or a number, and a 63 character maximum.
* resource. Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
* @param string $kmsConfigCryptoKeyName Customer managed crypto key resource full name. Format:
* projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{key}.
*/
Expand Down
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_replication.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
* @param string $formattedReplicationDestinationVolumeParametersStoragePool Existing destination StoragePool name. Please see
* {@see NetAppClient::storagePoolName()} for help formatting this field.
* @param string $replicationId ID of the replication to create. Must be unique within the parent
* resource. Must contain only letters, numbers, underscore and hyphen, with
* the first character a letter or underscore, the last a letter or underscore
* or a number, and a 63 character maximum.
* resource. Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
*/
function create_replication_sample(
string $formattedParent,
Expand Down
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* `projects/{project_id}/locations/{location}/volumes/{volume_id}`
* Please see {@see NetAppClient::volumeName()} for help formatting this field.
* @param string $snapshotId ID of the snapshot to create. Must be unique within the parent
* resource. Must contain only letters, numbers, underscore and hyphen, with
* the first character a letter or underscore, the last a letter or underscore
* or a number, and a 63 character maximum.
* resource. Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a
* number, and a 63 character maximum.
*/
function create_snapshot_sample(string $formattedParent, string $snapshotId): void
{
Expand Down
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_storage_pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* @param string $formattedParent Value for parent. Please see
* {@see NetAppClient::locationName()} for help formatting this field.
* @param string $storagePoolId Id of the requesting storage pool. Must be unique within the
* parent resource. Must contain only letters, numbers, underscore and hyphen,
* with the first character a letter or underscore, the last a letter or
* underscore or a number, and a 63 character maximum.
* parent resource. Must contain only letters, numbers and hyphen, with the
* first character a letter, the last a letter or a number, and a 63 character
* maximum.
* @param int $storagePoolServiceLevel Service level of the storage pool
* @param int $storagePoolCapacityGib Capacity in GIB of the pool
* @param string $formattedStoragePoolNetwork VPC Network name.
Expand Down
6 changes: 3 additions & 3 deletions NetApp/samples/V1/NetAppClient/create_volume.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* @param string $formattedParent Value for parent. Please see
* {@see NetAppClient::locationName()} for help formatting this field.
* @param string $volumeId Id of the requesting volume. Must be unique within the parent
* resource. Must contain only letters, numbers, underscore and hyphen, with
* the first character a letter or underscore, the last a letter or underscore
* or a number, and a 63 character maximum.
* resource. Must contain only letters, numbers and hyphen, with the first
* character a letter, the last a letter or a number,
* and a 63 character maximum.
* @param string $volumeShareName Share name of the volume
* @param string $formattedVolumeStoragePool StoragePool name of the volume
* Please see {@see NetAppClient::storagePoolName()} for help formatting this field.
Expand Down
105 changes: 105 additions & 0 deletions NetApp/samples/V1/NetAppClient/establish_peering.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START netapp_v1_generated_NetApp_EstablishPeering_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\EstablishPeeringRequest;
use Google\Cloud\NetApp\V1\Replication;
use Google\Rpc\Status;

/**
* Establish replication peering.
*
* @param string $formattedName The resource name of the replication, in the format of
* projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}. Please see
* {@see NetAppClient::replicationName()} for help formatting this field.
* @param string $peerClusterName Name of the user's local source cluster to be peered with the
* destination cluster.
* @param string $peerSvmName Name of the user's local source vserver svm to be peered with the
* destination vserver svm.
* @param string $peerVolumeName Name of the user's local source volume to be peered with the
* destination volume.
*/
function establish_peering_sample(
string $formattedName,
string $peerClusterName,
string $peerSvmName,
string $peerVolumeName
): void {
// Create a client.
$netAppClient = new NetAppClient();

// Prepare the request message.
$request = (new EstablishPeeringRequest())
->setName($formattedName)
->setPeerClusterName($peerClusterName)
->setPeerSvmName($peerSvmName)
->setPeerVolumeName($peerVolumeName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->establishPeering($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var Replication $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = NetAppClient::replicationName(
'[PROJECT]',
'[LOCATION]',
'[VOLUME]',
'[REPLICATION]'
);
$peerClusterName = '[PEER_CLUSTER_NAME]';
$peerSvmName = '[PEER_SVM_NAME]';
$peerVolumeName = '[PEER_VOLUME_NAME]';

establish_peering_sample($formattedName, $peerClusterName, $peerSvmName, $peerVolumeName);
}
// [END netapp_v1_generated_NetApp_EstablishPeering_sync]
90 changes: 90 additions & 0 deletions NetApp/samples/V1/NetAppClient/sync_replication.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START netapp_v1_generated_NetApp_SyncReplication_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\Replication;
use Google\Cloud\NetApp\V1\SyncReplicationRequest;
use Google\Rpc\Status;

/**
* Syncs the replication. This will invoke one time volume data transfer from
* source to destination.
*
* @param string $formattedName The resource name of the replication, in the format of
* projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}. Please see
* {@see NetAppClient::replicationName()} for help formatting this field.
*/
function sync_replication_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();

// Prepare the request message.
$request = (new SyncReplicationRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->syncReplication($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var Replication $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = NetAppClient::replicationName(
'[PROJECT]',
'[LOCATION]',
'[VOLUME]',
'[REPLICATION]'
);

sync_replication_sample($formattedName);
}
// [END netapp_v1_generated_NetApp_SyncReplication_sync]
7 changes: 7 additions & 0 deletions NetApp/src/V1/ActiveDirectory/State.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading