Google Cloud Net App V1 Client - Class NetAppClient (1.0.1)

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 \ Client

Methods

__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 false.

↳ 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 rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ 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.

createActiveDirectory

CreateActiveDirectory Creates the active directory specified in the request.

The async variant is Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen,
 *                                             with the first character a letter or underscore, the last a letter or
 *                                             underscore or a number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with the first
 *                                character a letter or underscore, the last a letter or underscore or a
 *                                number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with the first
 *                                character a letter or underscore, the last a letter or underscore or a
 *                                number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with the first
 *                                character a letter or underscore, the last a letter or underscore or a
 *                                number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with
 *                                       the first character a letter or underscore, the last a letter or underscore
 *                                       or a number, and a 63 character maximum.
 * @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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with
 *                                                                           the first character a letter or underscore, the last a letter or underscore
 *                                                                           or a number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with
 *                                the first character a letter or underscore, the last a letter or underscore
 *                                or a number, and a 63 character maximum.
 */
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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen,
 *                                            with the first character a letter or underscore, the last a letter or
 *                                            underscore or a number, and a 63 character maximum.
 * @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 Google\Cloud\NetApp\V1\Client\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
Example
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, underscore and hyphen, with
 *                                           the first character a letter or underscore, the last a letter or underscore
 *                                           or a number, and a 63 character maximum.
 * @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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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);
}

getActiveDirectory

Describes a specified active directory.

The async variant is Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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);
}

updateActiveDirectory

Update the parameters of an active directories.

The async variant is Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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 Google\Cloud\NetApp\V1\Client\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
Example
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

createBackupAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateBackupRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createBackupPolicyAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateBackupPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createBackupVaultAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateBackupVaultRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createKmsConfigAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateKmsConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createSnapshotAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateSnapshotRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createStoragePoolAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateStoragePoolRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createVolumeAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\CreateVolumeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteActiveDirectoryAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteActiveDirectoryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteBackupAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteBackupRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteBackupPolicyAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteBackupPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteBackupVaultAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteBackupVaultRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteKmsConfigAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteKmsConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteSnapshotAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteSnapshotRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteStoragePoolAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteStoragePoolRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteVolumeAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\DeleteVolumeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

encryptVolumesAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\EncryptVolumesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getActiveDirectoryAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetActiveDirectoryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getBackupAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetBackupRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getBackupPolicyAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetBackupPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getBackupVaultAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetBackupVaultRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getKmsConfigAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetKmsConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getSnapshotAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetSnapshotRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getStoragePoolAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetStoragePoolRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getVolumeAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\GetVolumeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listActiveDirectoriesAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListActiveDirectoriesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listBackupPoliciesAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListBackupPoliciesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listBackupVaultsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListBackupVaultsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listBackupsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListBackupsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listKmsConfigsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListKmsConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listReplicationsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListReplicationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSnapshotsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListSnapshotsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listStoragePoolsAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListStoragePoolsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listVolumesAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ListVolumesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

resumeReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ResumeReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

reverseReplicationDirectionAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\ReverseReplicationDirectionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

revertVolumeAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\RevertVolumeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

stopReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\StopReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateActiveDirectoryAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateActiveDirectoryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateBackupAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateBackupRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateBackupPolicyAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateBackupPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateBackupVaultAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateBackupVaultRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateKmsConfigAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateKmsConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateReplicationAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateReplicationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateSnapshotAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateSnapshotRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateStoragePoolAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateStoragePoolRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateVolumeAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\UpdateVolumeRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

verifyKmsConfigAsync

Parameters
Name Description
request Google\Cloud\NetApp\V1\VerifyKmsConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

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.