Google Cloud Oracle Database V1 Client - Class OracleDatabaseClient (0.1.2)

Reference documentation and code samples for the Google Cloud Oracle Database V1 Client class OracleDatabaseClient.

Service Description: Service describing handlers for resources

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 \ OracleDatabase \ 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. At the moment, supports only rest. 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 = [ 'rest' => [...], ]; See the Google\ApiCore\Transport\RestTransport::build() method for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

↳ logger false|LoggerInterface

A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag

createAutonomousDatabase

Creates a new Autonomous Database in a given project and location.

The async variant is OracleDatabaseClient::createAutonomousDatabaseAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateAutonomousDatabaseRequest

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\OracleDatabase\V1\AutonomousDatabase;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CreateAutonomousDatabaseRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                    The name of the parent in the following format:
 *                                                   projects/{project}/locations/{location}. Please see
 *                                                   {@see OracleDatabaseClient::locationName()} for help formatting this field.
 * @param string $autonomousDatabaseId               The ID of the Autonomous Database to create. This value is
 *                                                   restricted to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of
 *                                                   63 characters in length. The value must start with a letter and end with a
 *                                                   letter or a number.
 * @param string $formattedAutonomousDatabaseNetwork The name of the VPC network used by the Autonomous Database in
 *                                                   the following format: projects/{project}/global/networks/{network}
 *                                                   Please see {@see OracleDatabaseClient::networkName()} for help formatting this field.
 * @param string $autonomousDatabaseCidr             The subnet CIDR range for the Autonmous Database.
 */
function create_autonomous_database_sample(
    string $formattedParent,
    string $autonomousDatabaseId,
    string $formattedAutonomousDatabaseNetwork,
    string $autonomousDatabaseCidr
): void {
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $autonomousDatabase = (new AutonomousDatabase())
        ->setNetwork($formattedAutonomousDatabaseNetwork)
        ->setCidr($autonomousDatabaseCidr);
    $request = (new CreateAutonomousDatabaseRequest())
        ->setParent($formattedParent)
        ->setAutonomousDatabaseId($autonomousDatabaseId)
        ->setAutonomousDatabase($autonomousDatabase);

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

        if ($response->operationSucceeded()) {
            /** @var AutonomousDatabase $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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');
    $autonomousDatabaseId = '[AUTONOMOUS_DATABASE_ID]';
    $formattedAutonomousDatabaseNetwork = OracleDatabaseClient::networkName('[PROJECT]', '[NETWORK]');
    $autonomousDatabaseCidr = '[CIDR]';

    create_autonomous_database_sample(
        $formattedParent,
        $autonomousDatabaseId,
        $formattedAutonomousDatabaseNetwork,
        $autonomousDatabaseCidr
    );
}

createCloudExadataInfrastructure

Creates a new Exadata Infrastructure in a given project and location.

The async variant is OracleDatabaseClient::createCloudExadataInfrastructureAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateCloudExadataInfrastructureRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CloudExadataInfrastructure;
use Google\Cloud\OracleDatabase\V1\CreateCloudExadataInfrastructureRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent              The parent value for CloudExadataInfrastructure in the following
 *                                             format: projects/{project}/locations/{location}. Please see
 *                                             {@see OracleDatabaseClient::locationName()} for help formatting this field.
 * @param string $cloudExadataInfrastructureId The ID of the Exadata Infrastructure to create. This value is
 *                                             restricted to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of
 *                                             63 characters in length. The value must start with a letter and end with a
 *                                             letter or a number.
 */
function create_cloud_exadata_infrastructure_sample(
    string $formattedParent,
    string $cloudExadataInfrastructureId
): void {
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $cloudExadataInfrastructure = new CloudExadataInfrastructure();
    $request = (new CreateCloudExadataInfrastructureRequest())
        ->setParent($formattedParent)
        ->setCloudExadataInfrastructureId($cloudExadataInfrastructureId)
        ->setCloudExadataInfrastructure($cloudExadataInfrastructure);

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

        if ($response->operationSucceeded()) {
            /** @var CloudExadataInfrastructure $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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');
    $cloudExadataInfrastructureId = '[CLOUD_EXADATA_INFRASTRUCTURE_ID]';

    create_cloud_exadata_infrastructure_sample($formattedParent, $cloudExadataInfrastructureId);
}

createCloudVmCluster

Creates a new VM Cluster in a given project and location.

The async variant is OracleDatabaseClient::createCloudVmClusterAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateCloudVmClusterRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CloudVmCluster;
use Google\Cloud\OracleDatabase\V1\CreateCloudVmClusterRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                              The name of the parent in the following format:
 *                                                             projects/{project}/locations/{location}. Please see
 *                                                             {@see OracleDatabaseClient::locationName()} for help formatting this field.
 * @param string $cloudVmClusterId                             The ID of the VM Cluster to create. This value is restricted
 *                                                             to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of 63
 *                                                             characters in length. The value must start with a letter and end with
 *                                                             a letter or a number.
 * @param string $formattedCloudVmClusterExadataInfrastructure The name of the Exadata Infrastructure resource on which VM
 *                                                             cluster resource is created, in the following format:
 *                                                             projects/{project}/locations/{region}/cloudExadataInfrastuctures/{cloud_extradata_infrastructure}
 *                                                             Please see {@see OracleDatabaseClient::cloudExadataInfrastructureName()} for help formatting this field.
 * @param string $cloudVmClusterCidr                           Network settings. CIDR to use for cluster IP allocation.
 * @param string $cloudVmClusterBackupSubnetCidr               CIDR range of the backup subnet.
 * @param string $formattedCloudVmClusterNetwork               The name of the VPC network.
 *                                                             Format: projects/{project}/global/networks/{network}
 *                                                             Please see {@see OracleDatabaseClient::networkName()} for help formatting this field.
 */
function create_cloud_vm_cluster_sample(
    string $formattedParent,
    string $cloudVmClusterId,
    string $formattedCloudVmClusterExadataInfrastructure,
    string $cloudVmClusterCidr,
    string $cloudVmClusterBackupSubnetCidr,
    string $formattedCloudVmClusterNetwork
): void {
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $cloudVmCluster = (new CloudVmCluster())
        ->setExadataInfrastructure($formattedCloudVmClusterExadataInfrastructure)
        ->setCidr($cloudVmClusterCidr)
        ->setBackupSubnetCidr($cloudVmClusterBackupSubnetCidr)
        ->setNetwork($formattedCloudVmClusterNetwork);
    $request = (new CreateCloudVmClusterRequest())
        ->setParent($formattedParent)
        ->setCloudVmClusterId($cloudVmClusterId)
        ->setCloudVmCluster($cloudVmCluster);

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

        if ($response->operationSucceeded()) {
            /** @var CloudVmCluster $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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');
    $cloudVmClusterId = '[CLOUD_VM_CLUSTER_ID]';
    $formattedCloudVmClusterExadataInfrastructure = OracleDatabaseClient::cloudExadataInfrastructureName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_EXADATA_INFRASTRUCTURE]'
    );
    $cloudVmClusterCidr = '[CIDR]';
    $cloudVmClusterBackupSubnetCidr = '[BACKUP_SUBNET_CIDR]';
    $formattedCloudVmClusterNetwork = OracleDatabaseClient::networkName('[PROJECT]', '[NETWORK]');

    create_cloud_vm_cluster_sample(
        $formattedParent,
        $cloudVmClusterId,
        $formattedCloudVmClusterExadataInfrastructure,
        $cloudVmClusterCidr,
        $cloudVmClusterBackupSubnetCidr,
        $formattedCloudVmClusterNetwork
    );
}

deleteAutonomousDatabase

Deletes a single Autonomous Database.

The async variant is OracleDatabaseClient::deleteAutonomousDatabaseAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteAutonomousDatabaseRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\DeleteAutonomousDatabaseRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the resource in the following format:
 *                              projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}. Please see
 *                              {@see OracleDatabaseClient::autonomousDatabaseName()} for help formatting this field.
 */
function delete_autonomous_database_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $oracleDatabaseClient->deleteAutonomousDatabase($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 = OracleDatabaseClient::autonomousDatabaseName(
        '[PROJECT]',
        '[LOCATION]',
        '[AUTONOMOUS_DATABASE]'
    );

    delete_autonomous_database_sample($formattedName);
}

deleteCloudExadataInfrastructure

Deletes a single Exadata Infrastructure.

The async variant is OracleDatabaseClient::deleteCloudExadataInfrastructureAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteCloudExadataInfrastructureRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\DeleteCloudExadataInfrastructureRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the Cloud Exadata Infrastructure in the following
 *                              format:
 *                              projects/{project}/locations/{location}/cloudExadataInfrastructures/{cloud_exadata_infrastructure}. Please see
 *                              {@see OracleDatabaseClient::cloudExadataInfrastructureName()} for help formatting this field.
 */
function delete_cloud_exadata_infrastructure_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $oracleDatabaseClient->deleteCloudExadataInfrastructure($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 = OracleDatabaseClient::cloudExadataInfrastructureName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_EXADATA_INFRASTRUCTURE]'
    );

    delete_cloud_exadata_infrastructure_sample($formattedName);
}

deleteCloudVmCluster

Deletes a single VM Cluster.

The async variant is OracleDatabaseClient::deleteCloudVmClusterAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteCloudVmClusterRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\DeleteCloudVmClusterRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the Cloud VM Cluster in the following format:
 *                              projects/{project}/locations/{location}/cloudVmClusters/{cloud_vm_cluster}. Please see
 *                              {@see OracleDatabaseClient::cloudVmClusterName()} for help formatting this field.
 */
function delete_cloud_vm_cluster_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $oracleDatabaseClient->deleteCloudVmCluster($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 = OracleDatabaseClient::cloudVmClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_VM_CLUSTER]'
    );

    delete_cloud_vm_cluster_sample($formattedName);
}

generateAutonomousDatabaseWallet

Generates a wallet for an Autonomous Database.

The async variant is OracleDatabaseClient::generateAutonomousDatabaseWalletAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GenerateAutonomousDatabaseWalletRequest

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\OracleDatabase\V1\GenerateAutonomousDatabaseWalletResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\GenerateAutonomousDatabaseWalletRequest;
use Google\Cloud\OracleDatabase\V1\GenerateAutonomousDatabaseWalletResponse;

/**
 * @param string $formattedName The name of the Autonomous Database in the following format:
 *                              projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}. Please see
 *                              {@see OracleDatabaseClient::autonomousDatabaseName()} for help formatting this field.
 * @param string $password      The password used to encrypt the keys inside the wallet. The
 *                              password must be a minimum of 8 characters.
 */
function generate_autonomous_database_wallet_sample(string $formattedName, string $password): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var GenerateAutonomousDatabaseWalletResponse $response */
        $response = $oracleDatabaseClient->generateAutonomousDatabaseWallet($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 = OracleDatabaseClient::autonomousDatabaseName(
        '[PROJECT]',
        '[LOCATION]',
        '[AUTONOMOUS_DATABASE]'
    );
    $password = '[PASSWORD]';

    generate_autonomous_database_wallet_sample($formattedName, $password);
}

getAutonomousDatabase

Gets the details of a single Autonomous Database.

The async variant is OracleDatabaseClient::getAutonomousDatabaseAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetAutonomousDatabaseRequest

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\OracleDatabase\V1\AutonomousDatabase
Example
use Google\ApiCore\ApiException;
use Google\Cloud\OracleDatabase\V1\AutonomousDatabase;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\GetAutonomousDatabaseRequest;

/**
 * @param string $formattedName The name of the Autonomous Database in the following format:
 *                              projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}. Please see
 *                              {@see OracleDatabaseClient::autonomousDatabaseName()} for help formatting this field.
 */
function get_autonomous_database_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var AutonomousDatabase $response */
        $response = $oracleDatabaseClient->getAutonomousDatabase($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 = OracleDatabaseClient::autonomousDatabaseName(
        '[PROJECT]',
        '[LOCATION]',
        '[AUTONOMOUS_DATABASE]'
    );

    get_autonomous_database_sample($formattedName);
}

getCloudExadataInfrastructure

Gets details of a single Exadata Infrastructure.

The async variant is OracleDatabaseClient::getCloudExadataInfrastructureAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetCloudExadataInfrastructureRequest

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\OracleDatabase\V1\CloudExadataInfrastructure
Example
use Google\ApiCore\ApiException;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CloudExadataInfrastructure;
use Google\Cloud\OracleDatabase\V1\GetCloudExadataInfrastructureRequest;

/**
 * @param string $formattedName The name of the Cloud Exadata Infrastructure in the following
 *                              format:
 *                              projects/{project}/locations/{location}/cloudExadataInfrastructures/{cloud_exadata_infrastructure}. Please see
 *                              {@see OracleDatabaseClient::cloudExadataInfrastructureName()} for help formatting this field.
 */
function get_cloud_exadata_infrastructure_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CloudExadataInfrastructure $response */
        $response = $oracleDatabaseClient->getCloudExadataInfrastructure($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 = OracleDatabaseClient::cloudExadataInfrastructureName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_EXADATA_INFRASTRUCTURE]'
    );

    get_cloud_exadata_infrastructure_sample($formattedName);
}

getCloudVmCluster

Gets details of a single VM Cluster.

The async variant is OracleDatabaseClient::getCloudVmClusterAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetCloudVmClusterRequest

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\OracleDatabase\V1\CloudVmCluster
Example
use Google\ApiCore\ApiException;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CloudVmCluster;
use Google\Cloud\OracleDatabase\V1\GetCloudVmClusterRequest;

/**
 * @param string $formattedName The name of the Cloud VM Cluster in the following format:
 *                              projects/{project}/locations/{location}/cloudVmClusters/{cloud_vm_cluster}. Please see
 *                              {@see OracleDatabaseClient::cloudVmClusterName()} for help formatting this field.
 */
function get_cloud_vm_cluster_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CloudVmCluster $response */
        $response = $oracleDatabaseClient->getCloudVmCluster($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 = OracleDatabaseClient::cloudVmClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_VM_CLUSTER]'
    );

    get_cloud_vm_cluster_sample($formattedName);
}

listAutonomousDatabaseBackups

Lists the long-term and automatic backups of an Autonomous Database.

The async variant is OracleDatabaseClient::listAutonomousDatabaseBackupsAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseBackupsRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseBackupsRequest;

/**
 * @param string $formattedParent The parent value for ListAutonomousDatabaseBackups in the
 *                                following format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_autonomous_database_backups_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListAutonomousDatabaseBackupsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listAutonomousDatabaseBackups($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_autonomous_database_backups_sample($formattedParent);
}

listAutonomousDatabaseCharacterSets

Lists Autonomous Database Character Sets in a given project and location.

The async variant is OracleDatabaseClient::listAutonomousDatabaseCharacterSetsAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseCharacterSetsRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseCharacterSetsRequest;

/**
 * @param string $formattedParent The parent value for the Autonomous Database in the following
 *                                format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_autonomous_database_character_sets_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListAutonomousDatabaseCharacterSetsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listAutonomousDatabaseCharacterSets($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_autonomous_database_character_sets_sample($formattedParent);
}

listAutonomousDatabases

Lists the Autonomous Databases in a given project and location.

The async variant is OracleDatabaseClient::listAutonomousDatabasesAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabasesRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListAutonomousDatabasesRequest;

/**
 * @param string $formattedParent The parent value for the Autonomous Database in the following
 *                                format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_autonomous_databases_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListAutonomousDatabasesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listAutonomousDatabases($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_autonomous_databases_sample($formattedParent);
}

listAutonomousDbVersions

Lists all the available Autonomous Database versions for a project and location.

The async variant is OracleDatabaseClient::listAutonomousDbVersionsAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDbVersionsRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListAutonomousDbVersionsRequest;

/**
 * @param string $formattedParent The parent value for the Autonomous Database in the following
 *                                format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_autonomous_db_versions_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListAutonomousDbVersionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listAutonomousDbVersions($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_autonomous_db_versions_sample($formattedParent);
}

listCloudExadataInfrastructures

Lists Exadata Infrastructures in a given project and location.

The async variant is OracleDatabaseClient::listCloudExadataInfrastructuresAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListCloudExadataInfrastructuresRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListCloudExadataInfrastructuresRequest;

/**
 * @param string $formattedParent The parent value for CloudExadataInfrastructure in the following
 *                                format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_cloud_exadata_infrastructures_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListCloudExadataInfrastructuresRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listCloudExadataInfrastructures($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_cloud_exadata_infrastructures_sample($formattedParent);
}

listCloudVmClusters

Lists the VM Clusters in a given project and location.

The async variant is OracleDatabaseClient::listCloudVmClustersAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListCloudVmClustersRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListCloudVmClustersRequest;

/**
 * @param string $formattedParent The name of the parent in the following format:
 *                                projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_cloud_vm_clusters_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListCloudVmClustersRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listCloudVmClusters($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_cloud_vm_clusters_sample($formattedParent);
}

listDbNodes

Lists the database nodes of a VM Cluster.

The async variant is OracleDatabaseClient::listDbNodesAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbNodesRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListDbNodesRequest;

/**
 * @param string $formattedParent The parent value for database node in the following format:
 *                                projects/{project}/locations/{location}/cloudVmClusters/{cloudVmCluster}. Please see
 *                                {@see OracleDatabaseClient::cloudVmClusterName()} for help formatting this field.
 */
function list_db_nodes_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListDbNodesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listDbNodes($request);

        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 = OracleDatabaseClient::cloudVmClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_VM_CLUSTER]'
    );

    list_db_nodes_sample($formattedParent);
}

listDbServers

Lists the database servers of an Exadata Infrastructure instance.

The async variant is OracleDatabaseClient::listDbServersAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbServersRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListDbServersRequest;

/**
 * @param string $formattedParent The parent value for database server in the following format:
 *                                projects/{project}/locations/{location}/cloudExadataInfrastructures/{cloudExadataInfrastructure}. Please see
 *                                {@see OracleDatabaseClient::cloudExadataInfrastructureName()} for help formatting this field.
 */
function list_db_servers_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListDbServersRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listDbServers($request);

        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 = OracleDatabaseClient::cloudExadataInfrastructureName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_EXADATA_INFRASTRUCTURE]'
    );

    list_db_servers_sample($formattedParent);
}

listDbSystemShapes

Lists the database system shapes available for the project and location.

The async variant is OracleDatabaseClient::listDbSystemShapesAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbSystemShapesRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListDbSystemShapesRequest;

/**
 * @param string $formattedParent The parent value for Database System Shapes in the following
 *                                format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_db_system_shapes_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListDbSystemShapesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listDbSystemShapes($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_db_system_shapes_sample($formattedParent);
}

listEntitlements

Lists the entitlements in a given project.

The async variant is OracleDatabaseClient::listEntitlementsAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListEntitlementsRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListEntitlementsRequest;

/**
 * @param string $formattedParent The parent value for the entitlement in the following format:
 *                                projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_entitlements_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListEntitlementsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listEntitlements($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_entitlements_sample($formattedParent);
}

listGiVersions

Lists all the valid Oracle Grid Infrastructure (GI) versions for the given project and location.

The async variant is OracleDatabaseClient::listGiVersionsAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListGiVersionsRequest

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\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\ListGiVersionsRequest;

/**
 * @param string $formattedParent The parent value for Grid Infrastructure Version in the following
 *                                format: Format: projects/{project}/locations/{location}. Please see
 *                                {@see OracleDatabaseClient::locationName()} for help formatting this field.
 */
function list_gi_versions_sample(string $formattedParent): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = (new ListGiVersionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listGiVersions($request);

        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 = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');

    list_gi_versions_sample($formattedParent);
}

restoreAutonomousDatabase

Restores a single Autonomous Database.

The async variant is OracleDatabaseClient::restoreAutonomousDatabaseAsync() .

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\RestoreAutonomousDatabaseRequest

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\OracleDatabase\V1\AutonomousDatabase;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\RestoreAutonomousDatabaseRequest;
use Google\Protobuf\Timestamp;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the Autonomous Database in the following format:
 *                              projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}. Please see
 *                              {@see OracleDatabaseClient::autonomousDatabaseName()} for help formatting this field.
 */
function restore_autonomous_database_sample(string $formattedName): void
{
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $restoreTime = new Timestamp();
    $request = (new RestoreAutonomousDatabaseRequest())
        ->setName($formattedName)
        ->setRestoreTime($restoreTime);

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

        if ($response->operationSucceeded()) {
            /** @var AutonomousDatabase $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 = OracleDatabaseClient::autonomousDatabaseName(
        '[PROJECT]',
        '[LOCATION]',
        '[AUTONOMOUS_DATABASE]'
    );

    restore_autonomous_database_sample($formattedName);
}

getLocation

Gets information about a location.

The async variant is OracleDatabaseClient::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\OracleDatabase\V1\Client\OracleDatabaseClient;

/**
 * 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.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $oracleDatabaseClient->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 OracleDatabaseClient::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\OracleDatabase\V1\Client\OracleDatabaseClient;

/**
 * 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.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $oracleDatabaseClient->listLocations($request);

        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());
    }
}

createAutonomousDatabaseAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateAutonomousDatabaseRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createCloudExadataInfrastructureAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateCloudExadataInfrastructureRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createCloudVmClusterAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\CreateCloudVmClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteAutonomousDatabaseAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteAutonomousDatabaseRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteCloudExadataInfrastructureAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteCloudExadataInfrastructureRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteCloudVmClusterAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\DeleteCloudVmClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

generateAutonomousDatabaseWalletAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GenerateAutonomousDatabaseWalletRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\OracleDatabase\V1\GenerateAutonomousDatabaseWalletResponse>

getAutonomousDatabaseAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetAutonomousDatabaseRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\OracleDatabase\V1\AutonomousDatabase>

getCloudExadataInfrastructureAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetCloudExadataInfrastructureRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\OracleDatabase\V1\CloudExadataInfrastructure>

getCloudVmClusterAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\GetCloudVmClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\OracleDatabase\V1\CloudVmCluster>

listAutonomousDatabaseBackupsAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseBackupsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAutonomousDatabaseCharacterSetsAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabaseCharacterSetsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAutonomousDatabasesAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDatabasesRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAutonomousDbVersionsAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListAutonomousDbVersionsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listCloudExadataInfrastructuresAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListCloudExadataInfrastructuresRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listCloudVmClustersAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListCloudVmClustersRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listDbNodesAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbNodesRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listDbServersAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbServersRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listDbSystemShapesAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListDbSystemShapesRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listEntitlementsAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListEntitlementsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listGiVersionsAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\ListGiVersionsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

restoreAutonomousDatabaseAsync

Parameters
Name Description
request Google\Cloud\OracleDatabase\V1\RestoreAutonomousDatabaseRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

getLocationAsync

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location>

listLocationsAsync

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
Type Description
Google\LongRunning\Client\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::autonomousDatabaseName

Formats a string containing the fully-qualified path to represent a autonomous_database resource.

Parameters
Name Description
project string
location string
autonomousDatabase string
Returns
Type Description
string The formatted autonomous_database resource.

static::cloudExadataInfrastructureName

Formats a string containing the fully-qualified path to represent a cloud_exadata_infrastructure resource.

Parameters
Name Description
project string
location string
cloudExadataInfrastructure string
Returns
Type Description
string The formatted cloud_exadata_infrastructure resource.

static::cloudVmClusterName

Formats a string containing the fully-qualified path to represent a cloud_vm_cluster resource.

Parameters
Name Description
project string
location string
cloudVmCluster string
Returns
Type Description
string The formatted cloud_vm_cluster 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::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

  • autonomousDatabase: projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}
  • cloudExadataInfrastructure: projects/{project}/locations/{location}/cloudExadataInfrastructures/{cloud_exadata_infrastructure}
  • cloudVmCluster: projects/{project}/locations/{location}/cloudVmClusters/{cloud_vm_cluster}
  • location: projects/{project}/locations/{location}
  • network: projects/{project}/global/networks/{network}

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.