Reference documentation and code samples for the Google Cloud Net App V1 Client class NetAppClient.
Service Description: NetApp Files Google Cloud Service
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ NetApp \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
↳ logger |
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
createActiveDirectory
CreateActiveDirectory Creates the active directory specified in the request.
The async variant is NetAppClient::createActiveDirectoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateActiveDirectoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\ActiveDirectory;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateActiveDirectoryRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see NetAppClient::locationName()} for help formatting this field.
* @param string $activeDirectoryDomain Name of the Active Directory domain
* @param string $activeDirectoryDns Comma separated list of DNS server IP addresses for the Active
* Directory domain.
* @param string $activeDirectoryNetBiosPrefix NetBIOSPrefix is used as a prefix for SMB server name.
* @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 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,
string $activeDirectoryDomain,
string $activeDirectoryDns,
string $activeDirectoryNetBiosPrefix,
string $activeDirectoryUsername,
string $activeDirectoryPassword,
string $activeDirectoryId
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$activeDirectory = (new ActiveDirectory())
->setDomain($activeDirectoryDomain)
->setDns($activeDirectoryDns)
->setNetBiosPrefix($activeDirectoryNetBiosPrefix)
->setUsername($activeDirectoryUsername)
->setPassword($activeDirectoryPassword);
$request = (new CreateActiveDirectoryRequest())
->setParent($formattedParent)
->setActiveDirectory($activeDirectory)
->setActiveDirectoryId($activeDirectoryId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createActiveDirectory($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ActiveDirectory $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$activeDirectoryDomain = '[DOMAIN]';
$activeDirectoryDns = '[DNS]';
$activeDirectoryNetBiosPrefix = '[NET_BIOS_PREFIX]';
$activeDirectoryUsername = '[USERNAME]';
$activeDirectoryPassword = '[PASSWORD]';
$activeDirectoryId = '[ACTIVE_DIRECTORY_ID]';
create_active_directory_sample(
$formattedParent,
$activeDirectoryDomain,
$activeDirectoryDns,
$activeDirectoryNetBiosPrefix,
$activeDirectoryUsername,
$activeDirectoryPassword,
$activeDirectoryId
);
}
createBackup
Creates a backup from the volume specified in the request The backup can be created from the given snapshot if specified in the request. If no snapshot specified, there'll be a new snapshot taken to initiate the backup creation.
The async variant is NetAppClient::createBackupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Backup;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateBackupRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The NetApp backupVault to create the backups of, in the format
* `projects/*/locations/*/backupVaults/{backup_vault_id}`
* 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 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
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$backup = new Backup();
$request = (new CreateBackupRequest())
->setParent($formattedParent)
->setBackupId($backupId)
->setBackup($backup);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createBackup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Backup $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
{
$formattedParent = NetAppClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]');
$backupId = '[BACKUP_ID]';
create_backup_sample($formattedParent, $backupId);
}
createBackupPolicy
Creates new backup policy
The async variant is NetAppClient::createBackupPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\BackupPolicy;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateBackupPolicyRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The location to create the backup policies of, in the format
* `projects/{project_id}/locations/{location}`
* 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 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
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$backupPolicy = new BackupPolicy();
$request = (new CreateBackupPolicyRequest())
->setParent($formattedParent)
->setBackupPolicy($backupPolicy)
->setBackupPolicyId($backupPolicyId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createBackupPolicy($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BackupPolicy $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$backupPolicyId = '[BACKUP_POLICY_ID]';
create_backup_policy_sample($formattedParent, $backupPolicyId);
}
createBackupVault
Creates new backup vault
The async variant is NetAppClient::createBackupVaultAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupVaultRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\BackupVault;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateBackupVaultRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The location to create the backup vaults, in the format
* `projects/{project_id}/locations/{location}`
* 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 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
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$backupVault = new BackupVault();
$request = (new CreateBackupVaultRequest())
->setParent($formattedParent)
->setBackupVaultId($backupVaultId)
->setBackupVault($backupVault);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createBackupVault($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BackupVault $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$backupVaultId = '[BACKUP_VAULT_ID]';
create_backup_vault_sample($formattedParent, $backupVaultId);
}
createKmsConfig
Creates a new KMS config.
The async variant is NetAppClient::createKmsConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateKmsConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateKmsConfigRequest;
use Google\Cloud\NetApp\V1\KmsConfig;
use Google\Rpc\Status;
/**
* @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 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}.
*/
function create_kms_config_sample(
string $formattedParent,
string $kmsConfigId,
string $kmsConfigCryptoKeyName
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$kmsConfig = (new KmsConfig())
->setCryptoKeyName($kmsConfigCryptoKeyName);
$request = (new CreateKmsConfigRequest())
->setParent($formattedParent)
->setKmsConfigId($kmsConfigId)
->setKmsConfig($kmsConfig);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createKmsConfig($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var KmsConfig $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$kmsConfigId = '[KMS_CONFIG_ID]';
$kmsConfigCryptoKeyName = '[CRYPTO_KEY_NAME]';
create_kms_config_sample($formattedParent, $kmsConfigId, $kmsConfigCryptoKeyName);
}
createReplication
Create a new replication for a volume.
The async variant is NetAppClient::createReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateReplicationRequest;
use Google\Cloud\NetApp\V1\DestinationVolumeParameters;
use Google\Cloud\NetApp\V1\Replication;
use Google\Cloud\NetApp\V1\Replication\ReplicationSchedule;
use Google\Rpc\Status;
/**
* @param string $formattedParent The NetApp volume to create the replications of, in the format
* `projects/{project_id}/locations/{location}/volumes/{volume_id}`
* Please see {@see NetAppClient::volumeName()} for help formatting this field.
* @param int $replicationReplicationSchedule Indicates the schedule for replication.
* @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 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,
int $replicationReplicationSchedule,
string $formattedReplicationDestinationVolumeParametersStoragePool,
string $replicationId
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$replicationDestinationVolumeParameters = (new DestinationVolumeParameters())
->setStoragePool($formattedReplicationDestinationVolumeParametersStoragePool);
$replication = (new Replication())
->setReplicationSchedule($replicationReplicationSchedule)
->setDestinationVolumeParameters($replicationDestinationVolumeParameters);
$request = (new CreateReplicationRequest())
->setParent($formattedParent)
->setReplication($replication)
->setReplicationId($replicationId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createReplication($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
{
$formattedParent = NetAppClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
$replicationReplicationSchedule = ReplicationSchedule::REPLICATION_SCHEDULE_UNSPECIFIED;
$formattedReplicationDestinationVolumeParametersStoragePool = NetAppClient::storagePoolName(
'[PROJECT]',
'[LOCATION]',
'[STORAGE_POOL]'
);
$replicationId = '[REPLICATION_ID]';
create_replication_sample(
$formattedParent,
$replicationReplicationSchedule,
$formattedReplicationDestinationVolumeParametersStoragePool,
$replicationId
);
}
createSnapshot
Create a new snapshot for a volume.
The async variant is NetAppClient::createSnapshotAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateSnapshotRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateSnapshotRequest;
use Google\Cloud\NetApp\V1\Snapshot;
use Google\Rpc\Status;
/**
* @param string $formattedParent The NetApp volume to create the snapshots of, in the format
* `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 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
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$snapshot = new Snapshot();
$request = (new CreateSnapshotRequest())
->setParent($formattedParent)
->setSnapshot($snapshot)
->setSnapshotId($snapshotId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createSnapshot($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Snapshot $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
{
$formattedParent = NetAppClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
$snapshotId = '[SNAPSHOT_ID]';
create_snapshot_sample($formattedParent, $snapshotId);
}
createStoragePool
Creates a new storage pool.
The async variant is NetAppClient::createStoragePoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateStoragePoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateStoragePoolRequest;
use Google\Cloud\NetApp\V1\ServiceLevel;
use Google\Cloud\NetApp\V1\StoragePool;
use Google\Rpc\Status;
/**
* @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 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.
* Format: projects/{project}/global/networks/{network}
* Please see {@see NetAppClient::networkName()} for help formatting this field.
*/
function create_storage_pool_sample(
string $formattedParent,
string $storagePoolId,
int $storagePoolServiceLevel,
int $storagePoolCapacityGib,
string $formattedStoragePoolNetwork
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$storagePool = (new StoragePool())
->setServiceLevel($storagePoolServiceLevel)
->setCapacityGib($storagePoolCapacityGib)
->setNetwork($formattedStoragePoolNetwork);
$request = (new CreateStoragePoolRequest())
->setParent($formattedParent)
->setStoragePoolId($storagePoolId)
->setStoragePool($storagePool);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createStoragePool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var StoragePool $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$storagePoolId = '[STORAGE_POOL_ID]';
$storagePoolServiceLevel = ServiceLevel::SERVICE_LEVEL_UNSPECIFIED;
$storagePoolCapacityGib = 0;
$formattedStoragePoolNetwork = NetAppClient::networkName('[PROJECT]', '[NETWORK]');
create_storage_pool_sample(
$formattedParent,
$storagePoolId,
$storagePoolServiceLevel,
$storagePoolCapacityGib,
$formattedStoragePoolNetwork
);
}
createVolume
Creates a new Volume in a given project and location.
The async variant is NetAppClient::createVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateVolumeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\CreateVolumeRequest;
use Google\Cloud\NetApp\V1\Protocols;
use Google\Cloud\NetApp\V1\Volume;
use Google\Rpc\Status;
/**
* @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 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.
* @param int $volumeCapacityGib Capacity in GIB of the volume
* @param int $volumeProtocolsElement Protocols required for the volume
*/
function create_volume_sample(
string $formattedParent,
string $volumeId,
string $volumeShareName,
string $formattedVolumeStoragePool,
int $volumeCapacityGib,
int $volumeProtocolsElement
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$volumeProtocols = [$volumeProtocolsElement,];
$volume = (new Volume())
->setShareName($volumeShareName)
->setStoragePool($formattedVolumeStoragePool)
->setCapacityGib($volumeCapacityGib)
->setProtocols($volumeProtocols);
$request = (new CreateVolumeRequest())
->setParent($formattedParent)
->setVolumeId($volumeId)
->setVolume($volume);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->createVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Volume $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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
$volumeId = '[VOLUME_ID]';
$volumeShareName = '[SHARE_NAME]';
$formattedVolumeStoragePool = NetAppClient::storagePoolName(
'[PROJECT]',
'[LOCATION]',
'[STORAGE_POOL]'
);
$volumeCapacityGib = 0;
$volumeProtocolsElement = Protocols::PROTOCOLS_UNSPECIFIED;
create_volume_sample(
$formattedParent,
$volumeId,
$volumeShareName,
$formattedVolumeStoragePool,
$volumeCapacityGib,
$volumeProtocolsElement
);
}
deleteActiveDirectory
Delete the active directory specified in the request.
The async variant is NetAppClient::deleteActiveDirectoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteActiveDirectoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteActiveDirectoryRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the active directory. Please see
* {@see NetAppClient::activeDirectoryName()} for help formatting this field.
*/
function delete_active_directory_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteActiveDirectoryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteActiveDirectory($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::activeDirectoryName('[PROJECT]', '[LOCATION]', '[ACTIVE_DIRECTORY]');
delete_active_directory_sample($formattedName);
}
deleteBackup
Warning! This operation will permanently delete the backup.
The async variant is NetAppClient::deleteBackupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteBackupRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The backup resource name, in the format
* `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
* Please see {@see NetAppClient::backupName()} for help formatting this field.
*/
function delete_backup_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteBackupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteBackup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]', '[BACKUP]');
delete_backup_sample($formattedName);
}
deleteBackupPolicy
Warning! This operation will permanently delete the backup policy.
The async variant is NetAppClient::deleteBackupPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteBackupPolicyRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The backup policy resource name, in the format
* `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
* Please see {@see NetAppClient::backupPolicyName()} for help formatting this field.
*/
function delete_backup_policy_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteBackupPolicyRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteBackupPolicy($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::backupPolicyName('[PROJECT]', '[LOCATION]', '[BACKUP_POLICY]');
delete_backup_policy_sample($formattedName);
}
deleteBackupVault
Warning! This operation will permanently delete the backup vault.
The async variant is NetAppClient::deleteBackupVaultAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupVaultRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteBackupVaultRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The backupVault resource name, in the format
* `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
* Please see {@see NetAppClient::backupVaultName()} for help formatting this field.
*/
function delete_backup_vault_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteBackupVaultRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteBackupVault($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]');
delete_backup_vault_sample($formattedName);
}
deleteKmsConfig
Warning! This operation will permanently delete the Kms config.
The async variant is NetAppClient::deleteKmsConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteKmsConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteKmsConfigRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the KmsConfig. Please see
* {@see NetAppClient::kmsConfigName()} for help formatting this field.
*/
function delete_kms_config_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteKmsConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteKmsConfig($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::kmsConfigName('[PROJECT]', '[LOCATION]', '[KMS_CONFIG]');
delete_kms_config_sample($formattedName);
}
deleteReplication
Deletes a replication.
The async variant is NetAppClient::deleteReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteReplicationRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The replication resource name, in the format
* `projects/*/locations/*/volumes/*/replications/{replication_id}`
* Please see {@see NetAppClient::replicationName()} for help formatting this field.
*/
function delete_replication_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteReplicationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteReplication($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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]'
);
delete_replication_sample($formattedName);
}
deleteSnapshot
Deletes a snapshot.
The async variant is NetAppClient::deleteSnapshotAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteSnapshotRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteSnapshotRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The snapshot resource name, in the format
* `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
* Please see {@see NetAppClient::snapshotName()} for help formatting this field.
*/
function delete_snapshot_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteSnapshotRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteSnapshot($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::snapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]');
delete_snapshot_sample($formattedName);
}
deleteStoragePool
Warning! This operation will permanently delete the storage pool.
The async variant is NetAppClient::deleteStoragePoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteStoragePoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteStoragePoolRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the storage pool
* Please see {@see NetAppClient::storagePoolName()} for help formatting this field.
*/
function delete_storage_pool_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteStoragePoolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteStoragePool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::storagePoolName('[PROJECT]', '[LOCATION]', '[STORAGE_POOL]');
delete_storage_pool_sample($formattedName);
}
deleteVolume
Deletes a single Volume.
The async variant is NetAppClient::deleteVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteVolumeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DeleteVolumeRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the volume
* Please see {@see NetAppClient::volumeName()} for help formatting this field.
*/
function delete_volume_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new DeleteVolumeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->deleteVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} 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::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
delete_volume_sample($formattedName);
}
encryptVolumes
Encrypt the existing volumes without CMEK encryption with the desired the KMS config for the whole region.
The async variant is NetAppClient::encryptVolumesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\EncryptVolumesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\EncryptVolumesRequest;
use Google\Cloud\NetApp\V1\KmsConfig;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the KmsConfig. Please see
* {@see NetAppClient::kmsConfigName()} for help formatting this field.
*/
function encrypt_volumes_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new EncryptVolumesRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->encryptVolumes($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var KmsConfig $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::kmsConfigName('[PROJECT]', '[LOCATION]', '[KMS_CONFIG]');
encrypt_volumes_sample($formattedName);
}
establishPeering
Establish replication peering.
The async variant is NetAppClient::establishPeeringAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\EstablishPeeringRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
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;
/**
* @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);
}
getActiveDirectory
Describes a specified active directory.
The async variant is NetAppClient::getActiveDirectoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetActiveDirectoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\ActiveDirectory |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\ActiveDirectory;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetActiveDirectoryRequest;
/**
* @param string $formattedName Name of the active directory. Please see
* {@see NetAppClient::activeDirectoryName()} for help formatting this field.
*/
function get_active_directory_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetActiveDirectoryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ActiveDirectory $response */
$response = $netAppClient->getActiveDirectory($request);
printf('Response data: %s' . PHP_EOL, $response->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::activeDirectoryName('[PROJECT]', '[LOCATION]', '[ACTIVE_DIRECTORY]');
get_active_directory_sample($formattedName);
}
getBackup
Returns the description of the specified backup
The async variant is NetAppClient::getBackupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\Backup |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Backup;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetBackupRequest;
/**
* @param string $formattedName The backup resource name, in the format
* `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
* Please see {@see NetAppClient::backupName()} for help formatting this field.
*/
function get_backup_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetBackupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Backup $response */
$response = $netAppClient->getBackup($request);
printf('Response data: %s' . PHP_EOL, $response->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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]', '[BACKUP]');
get_backup_sample($formattedName);
}
getBackupPolicy
Returns the description of the specified backup policy by backup_policy_id.
The async variant is NetAppClient::getBackupPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\BackupPolicy |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\BackupPolicy;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetBackupPolicyRequest;
/**
* @param string $formattedName The backupPolicy resource name, in the format
* `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
* Please see {@see NetAppClient::backupPolicyName()} for help formatting this field.
*/
function get_backup_policy_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetBackupPolicyRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var BackupPolicy $response */
$response = $netAppClient->getBackupPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->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::backupPolicyName('[PROJECT]', '[LOCATION]', '[BACKUP_POLICY]');
get_backup_policy_sample($formattedName);
}
getBackupVault
Returns the description of the specified backup vault
The async variant is NetAppClient::getBackupVaultAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupVaultRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\BackupVault |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\BackupVault;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetBackupVaultRequest;
/**
* @param string $formattedName The backupVault resource name, in the format
* `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
* Please see {@see NetAppClient::backupVaultName()} for help formatting this field.
*/
function get_backup_vault_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetBackupVaultRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var BackupVault $response */
$response = $netAppClient->getBackupVault($request);
printf('Response data: %s' . PHP_EOL, $response->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::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]');
get_backup_vault_sample($formattedName);
}
getKmsConfig
Returns the description of the specified KMS config by kms_config_id.
The async variant is NetAppClient::getKmsConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetKmsConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\KmsConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetKmsConfigRequest;
use Google\Cloud\NetApp\V1\KmsConfig;
/**
* @param string $formattedName Name of the KmsConfig
* Please see {@see NetAppClient::kmsConfigName()} for help formatting this field.
*/
function get_kms_config_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetKmsConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var KmsConfig $response */
$response = $netAppClient->getKmsConfig($request);
printf('Response data: %s' . PHP_EOL, $response->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::kmsConfigName('[PROJECT]', '[LOCATION]', '[KMS_CONFIG]');
get_kms_config_sample($formattedName);
}
getReplication
Describe a replication for a volume.
The async variant is NetAppClient::getReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\Replication |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetReplicationRequest;
use Google\Cloud\NetApp\V1\Replication;
/**
* @param string $formattedName The replication resource name, in the format
* `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
* Please see {@see NetAppClient::replicationName()} for help formatting this field.
*/
function get_replication_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetReplicationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Replication $response */
$response = $netAppClient->getReplication($request);
printf('Response data: %s' . PHP_EOL, $response->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]'
);
get_replication_sample($formattedName);
}
getSnapshot
Describe a snapshot for a volume.
The async variant is NetAppClient::getSnapshotAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetSnapshotRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\Snapshot |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetSnapshotRequest;
use Google\Cloud\NetApp\V1\Snapshot;
/**
* @param string $formattedName The snapshot resource name, in the format
* `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
* Please see {@see NetAppClient::snapshotName()} for help formatting this field.
*/
function get_snapshot_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetSnapshotRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Snapshot $response */
$response = $netAppClient->getSnapshot($request);
printf('Response data: %s' . PHP_EOL, $response->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::snapshotName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[SNAPSHOT]');
get_snapshot_sample($formattedName);
}
getStoragePool
Returns the description of the specified storage pool by poolId.
The async variant is NetAppClient::getStoragePoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetStoragePoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\StoragePool |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetStoragePoolRequest;
use Google\Cloud\NetApp\V1\StoragePool;
/**
* @param string $formattedName Name of the storage pool
* Please see {@see NetAppClient::storagePoolName()} for help formatting this field.
*/
function get_storage_pool_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetStoragePoolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var StoragePool $response */
$response = $netAppClient->getStoragePool($request);
printf('Response data: %s' . PHP_EOL, $response->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::storagePoolName('[PROJECT]', '[LOCATION]', '[STORAGE_POOL]');
get_storage_pool_sample($formattedName);
}
getVolume
Gets details of a single Volume.
The async variant is NetAppClient::getVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetVolumeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\Volume |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\GetVolumeRequest;
use Google\Cloud\NetApp\V1\Volume;
/**
* @param string $formattedName Name of the volume
* Please see {@see NetAppClient::volumeName()} for help formatting this field.
*/
function get_volume_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new GetVolumeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Volume $response */
$response = $netAppClient->getVolume($request);
printf('Response data: %s' . PHP_EOL, $response->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::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
get_volume_sample($formattedName);
}
listActiveDirectories
Lists active directories.
The async variant is NetAppClient::listActiveDirectoriesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListActiveDirectoriesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\ActiveDirectory;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListActiveDirectoriesRequest;
/**
* @param string $formattedParent Parent value for ListActiveDirectoriesRequest
* Please see {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_active_directories_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListActiveDirectoriesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listActiveDirectories($request);
/** @var ActiveDirectory $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_active_directories_sample($formattedParent);
}
listBackupPolicies
Returns list of all available backup policies.
The async variant is NetAppClient::listBackupPoliciesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupPoliciesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\BackupPolicy;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListBackupPoliciesRequest;
/**
* @param string $formattedParent Parent value for ListBackupPoliciesRequest
* Please see {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_backup_policies_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListBackupPoliciesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listBackupPolicies($request);
/** @var BackupPolicy $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_backup_policies_sample($formattedParent);
}
listBackupVaults
Returns list of all available backup vaults.
The async variant is NetAppClient::listBackupVaultsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupVaultsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\BackupVault;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListBackupVaultsRequest;
/**
* @param string $formattedParent The location for which to retrieve backupVault information,
* in the format
* `projects/{project_id}/locations/{location}`. Please see
* {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_backup_vaults_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListBackupVaultsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listBackupVaults($request);
/** @var BackupVault $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_backup_vaults_sample($formattedParent);
}
listBackups
Returns descriptions of all backups for a backupVault.
The async variant is NetAppClient::listBackupsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Backup;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListBackupsRequest;
/**
* @param string $formattedParent The backupVault for which to retrieve backup information,
* in the format
* `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
* To retrieve backup information for all locations, use "-" for the
* `{location}` value.
* To retrieve backup information for all backupVaults, use "-" for the
* `{backup_vault_id}` value.
* To retrieve backup information for a volume, use "-" for the
* `{backup_vault_id}` value and specify volume full name with the filter. Please see
* {@see NetAppClient::backupVaultName()} for help formatting this field.
*/
function list_backups_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListBackupsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listBackups($request);
/** @var Backup $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUP_VAULT]');
list_backups_sample($formattedParent);
}
listKmsConfigs
Returns descriptions of all KMS configs owned by the caller.
The async variant is NetAppClient::listKmsConfigsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListKmsConfigsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\KmsConfig;
use Google\Cloud\NetApp\V1\ListKmsConfigsRequest;
/**
* @param string $formattedParent Parent value
* Please see {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_kms_configs_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListKmsConfigsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listKmsConfigs($request);
/** @var KmsConfig $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_kms_configs_sample($formattedParent);
}
listReplications
Returns descriptions of all replications for a volume.
The async variant is NetAppClient::listReplicationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListReplicationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListReplicationsRequest;
use Google\Cloud\NetApp\V1\Replication;
/**
* @param string $formattedParent The volume for which to retrieve replication information,
* in the format
* `projects/{project_id}/locations/{location}/volumes/{volume_id}`. Please see
* {@see NetAppClient::volumeName()} for help formatting this field.
*/
function list_replications_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListReplicationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listReplications($request);
/** @var Replication $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
list_replications_sample($formattedParent);
}
listSnapshots
Returns descriptions of all snapshots for a volume.
The async variant is NetAppClient::listSnapshotsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListSnapshotsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListSnapshotsRequest;
use Google\Cloud\NetApp\V1\Snapshot;
/**
* @param string $formattedParent The volume for which to retrieve snapshot information,
* in the format
* `projects/{project_id}/locations/{location}/volumes/{volume_id}`. Please see
* {@see NetAppClient::volumeName()} for help formatting this field.
*/
function list_snapshots_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListSnapshotsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listSnapshots($request);
/** @var Snapshot $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
list_snapshots_sample($formattedParent);
}
listStoragePools
Returns descriptions of all storage pools owned by the caller.
The async variant is NetAppClient::listStoragePoolsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListStoragePoolsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListStoragePoolsRequest;
use Google\Cloud\NetApp\V1\StoragePool;
/**
* @param string $formattedParent Parent value
* Please see {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_storage_pools_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListStoragePoolsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listStoragePools($request);
/** @var StoragePool $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_storage_pools_sample($formattedParent);
}
listVolumes
Lists Volumes in a given project.
The async variant is NetAppClient::listVolumesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListVolumesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ListVolumesRequest;
use Google\Cloud\NetApp\V1\Volume;
/**
* @param string $formattedParent Parent value for ListVolumesRequest
* Please see {@see NetAppClient::locationName()} for help formatting this field.
*/
function list_volumes_sample(string $formattedParent): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ListVolumesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listVolumes($request);
/** @var Volume $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = NetAppClient::locationName('[PROJECT]', '[LOCATION]');
list_volumes_sample($formattedParent);
}
resumeReplication
Resume Cross Region Replication.
The async variant is NetAppClient::resumeReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ResumeReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
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\ResumeReplicationRequest;
use Google\Rpc\Status;
/**
* @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 resume_replication_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ResumeReplicationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->resumeReplication($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]'
);
resume_replication_sample($formattedName);
}
reverseReplicationDirection
Reverses direction of replication. Source becomes destination and destination becomes source.
The async variant is NetAppClient::reverseReplicationDirectionAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ReverseReplicationDirectionRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
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\ReverseReplicationDirectionRequest;
use Google\Rpc\Status;
/**
* @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 reverse_replication_direction_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new ReverseReplicationDirectionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->reverseReplicationDirection($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]'
);
reverse_replication_direction_sample($formattedName);
}
revertVolume
Revert an existing volume to a specified snapshot.
Warning! This operation will permanently revert all changes made after the snapshot was created.
The async variant is NetAppClient::revertVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\RevertVolumeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\RevertVolumeRequest;
use Google\Cloud\NetApp\V1\Volume;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the volume, in the format of
* projects/{project_id}/locations/{location}/volumes/{volume_id}. Please see
* {@see NetAppClient::volumeName()} for help formatting this field.
* @param string $snapshotId The snapshot resource ID, in the format 'my-snapshot', where the
* specified ID is the {snapshot_id} of the fully qualified name like
* projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
*/
function revert_volume_sample(string $formattedName, string $snapshotId): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new RevertVolumeRequest())
->setName($formattedName)
->setSnapshotId($snapshotId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->revertVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Volume $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::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
$snapshotId = '[SNAPSHOT_ID]';
revert_volume_sample($formattedName, $snapshotId);
}
stopReplication
Stop Cross Region Replication.
The async variant is NetAppClient::stopReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\StopReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
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\StopReplicationRequest;
use Google\Rpc\Status;
/**
* @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 stop_replication_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new StopReplicationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->stopReplication($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]'
);
stop_replication_sample($formattedName);
}
switchActiveReplicaZone
This operation will switch the active/replica zone for a regional storagePool.
The async variant is NetAppClient::switchActiveReplicaZoneAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\SwitchActiveReplicaZoneRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\StoragePool;
use Google\Cloud\NetApp\V1\SwitchActiveReplicaZoneRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the storage pool
* Please see {@see NetAppClient::storagePoolName()} for help formatting this field.
*/
function switch_active_replica_zone_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new SwitchActiveReplicaZoneRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->switchActiveReplicaZone($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var StoragePool $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::storagePoolName('[PROJECT]', '[LOCATION]', '[STORAGE_POOL]');
switch_active_replica_zone_sample($formattedName);
}
syncReplication
Syncs the replication. This will invoke one time volume data transfer from source to destination.
The async variant is NetAppClient::syncReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\SyncReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
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;
/**
* @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);
}
updateActiveDirectory
Update the parameters of an active directories.
The async variant is NetAppClient::updateActiveDirectoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateActiveDirectoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\ActiveDirectory;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\UpdateActiveDirectoryRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $activeDirectoryDomain Name of the Active Directory domain
* @param string $activeDirectoryDns Comma separated list of DNS server IP addresses for the Active
* Directory domain.
* @param string $activeDirectoryNetBiosPrefix NetBIOSPrefix is used as a prefix for SMB server name.
* @param string $activeDirectoryUsername Username of the Active Directory domain administrator.
* @param string $activeDirectoryPassword Password of the Active Directory domain administrator.
*/
function update_active_directory_sample(
string $activeDirectoryDomain,
string $activeDirectoryDns,
string $activeDirectoryNetBiosPrefix,
string $activeDirectoryUsername,
string $activeDirectoryPassword
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$activeDirectory = (new ActiveDirectory())
->setDomain($activeDirectoryDomain)
->setDns($activeDirectoryDns)
->setNetBiosPrefix($activeDirectoryNetBiosPrefix)
->setUsername($activeDirectoryUsername)
->setPassword($activeDirectoryPassword);
$request = (new UpdateActiveDirectoryRequest())
->setUpdateMask($updateMask)
->setActiveDirectory($activeDirectory);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateActiveDirectory($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ActiveDirectory $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
{
$activeDirectoryDomain = '[DOMAIN]';
$activeDirectoryDns = '[DNS]';
$activeDirectoryNetBiosPrefix = '[NET_BIOS_PREFIX]';
$activeDirectoryUsername = '[USERNAME]';
$activeDirectoryPassword = '[PASSWORD]';
update_active_directory_sample(
$activeDirectoryDomain,
$activeDirectoryDns,
$activeDirectoryNetBiosPrefix,
$activeDirectoryUsername,
$activeDirectoryPassword
);
}
updateBackup
Update backup with full spec.
The async variant is NetAppClient::updateBackupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Backup;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\UpdateBackupRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* 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 update_backup_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$backup = new Backup();
$request = (new UpdateBackupRequest())
->setUpdateMask($updateMask)
->setBackup($backup);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateBackup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Backup $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());
}
}
updateBackupPolicy
Updates settings of a specific backup policy.
The async variant is NetAppClient::updateBackupPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\BackupPolicy;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\UpdateBackupPolicyRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* 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 update_backup_policy_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$backupPolicy = new BackupPolicy();
$request = (new UpdateBackupPolicyRequest())
->setUpdateMask($updateMask)
->setBackupPolicy($backupPolicy);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateBackupPolicy($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BackupPolicy $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());
}
}
updateBackupVault
Updates the settings of a specific backup vault.
The async variant is NetAppClient::updateBackupVaultAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupVaultRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\BackupVault;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\UpdateBackupVaultRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* 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 update_backup_vault_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$backupVault = new BackupVault();
$request = (new UpdateBackupVaultRequest())
->setUpdateMask($updateMask)
->setBackupVault($backupVault);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateBackupVault($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BackupVault $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());
}
}
updateKmsConfig
Updates the Kms config properties with the full spec
The async variant is NetAppClient::updateKmsConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateKmsConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\KmsConfig;
use Google\Cloud\NetApp\V1\UpdateKmsConfigRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $kmsConfigCryptoKeyName Customer managed crypto key resource full name. Format:
* projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{key}.
*/
function update_kms_config_sample(string $kmsConfigCryptoKeyName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$kmsConfig = (new KmsConfig())
->setCryptoKeyName($kmsConfigCryptoKeyName);
$request = (new UpdateKmsConfigRequest())
->setUpdateMask($updateMask)
->setKmsConfig($kmsConfig);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateKmsConfig($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var KmsConfig $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
{
$kmsConfigCryptoKeyName = '[CRYPTO_KEY_NAME]';
update_kms_config_sample($kmsConfigCryptoKeyName);
}
updateReplication
Updates the settings of a specific replication.
The async variant is NetAppClient::updateReplicationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateReplicationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\DestinationVolumeParameters;
use Google\Cloud\NetApp\V1\Replication;
use Google\Cloud\NetApp\V1\Replication\ReplicationSchedule;
use Google\Cloud\NetApp\V1\UpdateReplicationRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param int $replicationReplicationSchedule Indicates the schedule for replication.
* @param string $formattedReplicationDestinationVolumeParametersStoragePool Existing destination StoragePool name. Please see
* {@see NetAppClient::storagePoolName()} for help formatting this field.
*/
function update_replication_sample(
int $replicationReplicationSchedule,
string $formattedReplicationDestinationVolumeParametersStoragePool
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$replicationDestinationVolumeParameters = (new DestinationVolumeParameters())
->setStoragePool($formattedReplicationDestinationVolumeParametersStoragePool);
$replication = (new Replication())
->setReplicationSchedule($replicationReplicationSchedule)
->setDestinationVolumeParameters($replicationDestinationVolumeParameters);
$request = (new UpdateReplicationRequest())
->setUpdateMask($updateMask)
->setReplication($replication);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateReplication($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
{
$replicationReplicationSchedule = ReplicationSchedule::REPLICATION_SCHEDULE_UNSPECIFIED;
$formattedReplicationDestinationVolumeParametersStoragePool = NetAppClient::storagePoolName(
'[PROJECT]',
'[LOCATION]',
'[STORAGE_POOL]'
);
update_replication_sample(
$replicationReplicationSchedule,
$formattedReplicationDestinationVolumeParametersStoragePool
);
}
updateSnapshot
Updates the settings of a specific snapshot.
The async variant is NetAppClient::updateSnapshotAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateSnapshotRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\Snapshot;
use Google\Cloud\NetApp\V1\UpdateSnapshotRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* 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 update_snapshot_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$snapshot = new Snapshot();
$request = (new UpdateSnapshotRequest())
->setUpdateMask($updateMask)
->setSnapshot($snapshot);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateSnapshot($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Snapshot $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());
}
}
updateStoragePool
Updates the storage pool properties with the full spec
The async variant is NetAppClient::updateStoragePoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateStoragePoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\ServiceLevel;
use Google\Cloud\NetApp\V1\StoragePool;
use Google\Cloud\NetApp\V1\UpdateStoragePoolRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param int $storagePoolServiceLevel Service level of the storage pool
* @param int $storagePoolCapacityGib Capacity in GIB of the pool
* @param string $formattedStoragePoolNetwork VPC Network name.
* Format: projects/{project}/global/networks/{network}
* Please see {@see NetAppClient::networkName()} for help formatting this field.
*/
function update_storage_pool_sample(
int $storagePoolServiceLevel,
int $storagePoolCapacityGib,
string $formattedStoragePoolNetwork
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$storagePool = (new StoragePool())
->setServiceLevel($storagePoolServiceLevel)
->setCapacityGib($storagePoolCapacityGib)
->setNetwork($formattedStoragePoolNetwork);
$request = (new UpdateStoragePoolRequest())
->setUpdateMask($updateMask)
->setStoragePool($storagePool);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateStoragePool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var StoragePool $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
{
$storagePoolServiceLevel = ServiceLevel::SERVICE_LEVEL_UNSPECIFIED;
$storagePoolCapacityGib = 0;
$formattedStoragePoolNetwork = NetAppClient::networkName('[PROJECT]', '[NETWORK]');
update_storage_pool_sample(
$storagePoolServiceLevel,
$storagePoolCapacityGib,
$formattedStoragePoolNetwork
);
}
updateVolume
Updates the parameters of a single Volume.
The async variant is NetAppClient::updateVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateVolumeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\Protocols;
use Google\Cloud\NetApp\V1\UpdateVolumeRequest;
use Google\Cloud\NetApp\V1\Volume;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @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.
* @param int $volumeCapacityGib Capacity in GIB of the volume
* @param int $volumeProtocolsElement Protocols required for the volume
*/
function update_volume_sample(
string $volumeShareName,
string $formattedVolumeStoragePool,
int $volumeCapacityGib,
int $volumeProtocolsElement
): void {
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$updateMask = new FieldMask();
$volumeProtocols = [$volumeProtocolsElement,];
$volume = (new Volume())
->setShareName($volumeShareName)
->setStoragePool($formattedVolumeStoragePool)
->setCapacityGib($volumeCapacityGib)
->setProtocols($volumeProtocols);
$request = (new UpdateVolumeRequest())
->setUpdateMask($updateMask)
->setVolume($volume);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $netAppClient->updateVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Volume $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
{
$volumeShareName = '[SHARE_NAME]';
$formattedVolumeStoragePool = NetAppClient::storagePoolName(
'[PROJECT]',
'[LOCATION]',
'[STORAGE_POOL]'
);
$volumeCapacityGib = 0;
$volumeProtocolsElement = Protocols::PROTOCOLS_UNSPECIFIED;
update_volume_sample(
$volumeShareName,
$formattedVolumeStoragePool,
$volumeCapacityGib,
$volumeProtocolsElement
);
}
verifyKmsConfig
Verifies KMS config reachability.
The async variant is NetAppClient::verifyKmsConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\VerifyKmsConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\NetApp\V1\VerifyKmsConfigResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
use Google\Cloud\NetApp\V1\VerifyKmsConfigRequest;
use Google\Cloud\NetApp\V1\VerifyKmsConfigResponse;
/**
* @param string $formattedName Name of the KMS Config to be verified. Please see
* {@see NetAppClient::kmsConfigName()} for help formatting this field.
*/
function verify_kms_config_sample(string $formattedName): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = (new VerifyKmsConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var VerifyKmsConfigResponse $response */
$response = $netAppClient->verifyKmsConfig($request);
printf('Response data: %s' . PHP_EOL, $response->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::kmsConfigName('[PROJECT]', '[LOCATION]', '[KMS_CONFIG]');
verify_kms_config_sample($formattedName);
}
getLocation
Gets information about a location.
The async variant is NetAppClient::getLocationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
/**
* 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 get_location_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $netAppClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
The async variant is NetAppClient::listLocationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\NetApp\V1\Client\NetAppClient;
/**
* 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 list_locations_sample(): void
{
// Create a client.
$netAppClient = new NetAppClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $netAppClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
createActiveDirectoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateActiveDirectoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createBackupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createBackupPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createBackupVaultAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateBackupVaultRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createKmsConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateKmsConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createSnapshotAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateSnapshotRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createStoragePoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateStoragePoolRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\CreateVolumeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteActiveDirectoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteActiveDirectoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteBackupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteBackupPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteBackupVaultAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteBackupVaultRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteKmsConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteKmsConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteSnapshotAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteSnapshotRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteStoragePoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteStoragePoolRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\DeleteVolumeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
encryptVolumesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\EncryptVolumesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
establishPeeringAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\EstablishPeeringRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getActiveDirectoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetActiveDirectoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\ActiveDirectory> |
getBackupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\Backup> |
getBackupPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\BackupPolicy> |
getBackupVaultAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetBackupVaultRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\BackupVault> |
getKmsConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetKmsConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\KmsConfig> |
getReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\Replication> |
getSnapshotAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetSnapshotRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\Snapshot> |
getStoragePoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetStoragePoolRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\StoragePool> |
getVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\GetVolumeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\Volume> |
listActiveDirectoriesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListActiveDirectoriesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listBackupPoliciesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupPoliciesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listBackupVaultsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupVaultsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listBackupsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListBackupsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listKmsConfigsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListKmsConfigsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listReplicationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListReplicationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listSnapshotsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListSnapshotsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listStoragePoolsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListStoragePoolsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listVolumesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ListVolumesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
resumeReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ResumeReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
reverseReplicationDirectionAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\ReverseReplicationDirectionRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
revertVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\RevertVolumeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
stopReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\StopReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
switchActiveReplicaZoneAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\SwitchActiveReplicaZoneRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
syncReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\SyncReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateActiveDirectoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateActiveDirectoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateBackupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateBackupPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateBackupVaultAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateBackupVaultRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateKmsConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateKmsConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateReplicationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateReplicationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateSnapshotAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateSnapshotRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateStoragePoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateStoragePoolRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\UpdateVolumeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
verifyKmsConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\NetApp\V1\VerifyKmsConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\NetApp\V1\VerifyKmsConfigResponse> |
getLocationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location> |
listLocationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\LongRunning\Client\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::activeDirectoryName
Formats a string containing the fully-qualified path to represent a active_directory resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
activeDirectory |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted active_directory resource. |
static::backupName
Formats a string containing the fully-qualified path to represent a backup resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
backupVault |
string
|
backup |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted backup resource. |
static::backupPolicyName
Formats a string containing the fully-qualified path to represent a backup_policy resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
backupPolicy |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted backup_policy resource. |
static::backupVaultName
Formats a string containing the fully-qualified path to represent a backup_vault resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
backupVault |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted backup_vault resource. |
static::kmsConfigName
Formats a string containing the fully-qualified path to represent a kms_config resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
kmsConfig |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted kms_config resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted location resource. |
static::networkName
Formats a string containing the fully-qualified path to represent a network resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
network |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted network resource. |
static::replicationName
Formats a string containing the fully-qualified path to represent a replication resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
volume |
string
|
replication |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted replication resource. |
static::snapshotName
Formats a string containing the fully-qualified path to represent a snapshot resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
volume |
string
|
snapshot |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted snapshot resource. |
static::storagePoolName
Formats a string containing the fully-qualified path to represent a storage_pool resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
storagePool |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted storage_pool resource. |
static::volumeName
Formats a string containing the fully-qualified path to represent a volume resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
volume |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted volume resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- activeDirectory: projects/{project}/locations/{location}/activeDirectories/{active_directory}
- backup: projects/{project}/locations/{location}/backupVaults/{backup_vault}/backups/{backup}
- backupPolicy: projects/{project}/locations/{location}/backupPolicies/{backup_policy}
- backupVault: projects/{project}/locations/{location}/backupVaults/{backup_vault}
- kmsConfig: projects/{project}/locations/{location}/kmsConfigs/{kms_config}
- location: projects/{project}/locations/{location}
- network: projects/{project}/global/networks/{network}
- replication: projects/{project}/locations/{location}/volumes/{volume}/replications/{replication}
- snapshot: projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
- storagePool: projects/{project}/locations/{location}/storagePools/{storage_pool}
- volume: projects/{project}/locations/{location}/volumes/{volume}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |