Skip to content

Commit

Permalink
feat: Support for the AcquireSsrsLease and ReleaseSsrsLease RPCs (#7273)
Browse files Browse the repository at this point in the history
* feat: add `AcquireSsrsLease` and `ReleaseSsrsLease` RPCs
feat: add `migration_type` to `SqlInstancesVerifyExternalSyncSettingsRequest`
feat: add `sync_parallel_level` to `SqlInstancesVerifyExternalSyncSettingsRequest`
feat: add `migration_type` to `SqlInstancesStartExternalSyncRequest`
feat: add `transactional_log_storage_state` to `BackupConfiguration`
feat: add `replication_cluster` to `DatabaseInstance`
feat: add `gemini_config` to `DatabaseInstance`
feat: add `sql_import_options` to `ImportContext`
feat: add `acquire_ssrs_lease_context` to `Operation`
feat: add `enable_google_ml_integration` to `Settings`
feat: ssl_mode supports SQL Server now
chore: update go_package and Go importpath
docs: update ssl_mode instructions
PiperOrigin-RevId: 629467712
Source-Link: googleapis/googleapis@84c8f36
Source-Link: googleapis/googleapis-gen@e8b4cae
Copy-Tag: eyJwIjoiU3FsQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6ImU4YjRjYWVjNmMzYWQ5NjJkNDJlNjkxOGRhYmUxYTg0YzY0MDkyYmEifQ==

* feat: Support for the AcquireSsrsLease and ReleaseSsrsLease RPCs
feat: Support for migration type and PostgreSQL parallel level in the VerifyExternalSyncSettings call
feat: Support for setting the migration type when starting an external sync
feat: Support for additional error types in external sync settings
feat: DatabaseInstance resource now includes disaster recovery replica information and Gemini configuration
feat: BackupConfiguration resource now includes transactional log storage location
feat: ImportContext now includes options for importing data from SQL statements
feat: Operation resource now includes context for acquire SSRS lease operations
feat: Support for additional SQL operations related to SSRS leases and old primary reconfiguration
feat: Databsae instance settings now includes a flag to enable Vertex AI integration
feat: Support for several newer releases of MySQL 8.0
docs: Note that `ssl_mode` is now used by all databases including SQL Server
PiperOrigin-RevId: 629471589
Source-Link: googleapis/googleapis@b63fdfa
Source-Link: googleapis/googleapis-gen@8f51198
Copy-Tag: eyJwIjoiU3FsQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6IjhmNTExOThjYWRhODdmZGFlZjgwOGRlZDgwMzViMzA3ODQyMTEzOGMifQ==
  • Loading branch information
gcf-owl-bot[bot] authored May 3, 2024
1 parent 63ace28 commit e48698d
Show file tree
Hide file tree
Showing 63 changed files with 4,953 additions and 72 deletions.
Binary file modified SqlAdmin/metadata/V1/CloudSqlInstances.php
Binary file not shown.
Binary file modified SqlAdmin/metadata/V1/CloudSqlResources.php
Binary file not shown.
Binary file modified SqlAdmin/metadata/V1Beta4/CloudSql.php
Binary file not shown.
Binary file modified SqlAdmin/metadata/V1Beta4/CloudSqlResources.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

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

// [START sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Sql\V1\Client\SqlInstancesServiceClient;
use Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest;
use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseRequest;
use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseResponse;

/**
* Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
*
* @param string $instance Cloud SQL instance ID. This doesn't include the project ID. It's
* composed of lowercase letters, numbers, and hyphens, and it must start with
* a letter. The total length must be 98 characters or less (Example:
* instance-id).
* @param string $project Project ID of the project that contains the instance (Example:
* project-id).
*/
function acquire_ssrs_lease_sample(string $instance, string $project): void
{
// Create a client.
$sqlInstancesServiceClient = new SqlInstancesServiceClient();

// Prepare the request message.
$body = new InstancesAcquireSsrsLeaseRequest();
$request = (new SqlInstancesAcquireSsrsLeaseRequest())
->setInstance($instance)
->setProject($project)
->setBody($body);

// Call the API and handle any network failures.
try {
/** @var SqlInstancesAcquireSsrsLeaseResponse $response */
$response = $sqlInstancesServiceClient->acquireSsrsLease($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
{
$instance = '[INSTANCE]';
$project = '[PROJECT]';

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

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

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

// [START sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Sql\V1\Client\SqlInstancesServiceClient;
use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseRequest;
use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseResponse;

/**
* Release a lease for the setup of SQL Server Reporting Services (SSRS).
*
* @param string $instance The Cloud SQL instance ID. This doesn't include the project ID.
* The instance ID contains lowercase letters, numbers, and hyphens, and it
* must start with a letter. This ID can have a maximum length of 98
* characters.
* @param string $project The project ID that contains the instance.
*/
function release_ssrs_lease_sample(string $instance, string $project): void
{
// Create a client.
$sqlInstancesServiceClient = new SqlInstancesServiceClient();

// Prepare the request message.
$request = (new SqlInstancesReleaseSsrsLeaseRequest())
->setInstance($instance)
->setProject($project);

// Call the API and handle any network failures.
try {
/** @var SqlInstancesReleaseSsrsLeaseResponse $response */
$response = $sqlInstancesServiceClient->releaseSsrsLease($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
{
$instance = '[INSTANCE]';
$project = '[PROJECT]';

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

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

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

// [START sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Sql\V1beta4\SqlInstancesAcquireSsrsLeaseResponse;
use Google\Cloud\Sql\V1beta4\SqlInstancesServiceClient;

/**
* Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
*
* @param string $instance Cloud SQL instance ID. This doesn't include the project ID. It's
* composed of lowercase letters, numbers, and hyphens, and it must start with
* a letter. The total length must be 98 characters or less (Example:
* instance-id).
* @param string $project ID of the project that contains the instance (Example:
* project-id).
*/
function acquire_ssrs_lease_sample(string $instance, string $project): void
{
// Create a client.
$sqlInstancesServiceClient = new SqlInstancesServiceClient();

// Call the API and handle any network failures.
try {
/** @var SqlInstancesAcquireSsrsLeaseResponse $response */
$response = $sqlInstancesServiceClient->acquireSsrsLease($instance, $project);
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
{
$instance = '[INSTANCE]';
$project = '[PROJECT]';

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

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

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

// [START sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Sql\V1beta4\SqlInstancesReleaseSsrsLeaseResponse;
use Google\Cloud\Sql\V1beta4\SqlInstancesServiceClient;

/**
* Release a lease for the setup of SQL Server Reporting Services (SSRS).
*
* @param string $instance The Cloud SQL instance ID. This doesn't include the project ID.
* It's composed of lowercase letters, numbers, and hyphens, and it must start
* with a letter. The total length must be 98 characters or less (Example:
* instance-id).
* @param string $project The ID of the project that contains the instance (Example:
* project-id).
*/
function release_ssrs_lease_sample(string $instance, string $project): void
{
// Create a client.
$sqlInstancesServiceClient = new SqlInstancesServiceClient();

// Call the API and handle any network failures.
try {
/** @var SqlInstancesReleaseSsrsLeaseResponse $response */
$response = $sqlInstancesServiceClient->releaseSsrsLease($instance, $project);
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
{
$instance = '[INSTANCE]';
$project = '[PROJECT]';

release_ssrs_lease_sample($instance, $project);
}
// [END sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_sync]
Loading

0 comments on commit e48698d

Please sign in to comment.