Service to manage Cloud SQL instances.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
SqlInstancesServiceClient(SqlInstancesServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SqlInstancesServiceClient const &
|
SqlInstancesServiceClient(SqlInstancesServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SqlInstancesServiceClient &&
|
SqlInstancesServiceClient(std::shared_ptr< SqlInstancesServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< SqlInstancesServiceConnection >
|
opts |
Options
|
Operators
operator=(SqlInstancesServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SqlInstancesServiceClient const &
|
Returns | |
---|---|
Type | Description |
SqlInstancesServiceClient & |
operator=(SqlInstancesServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SqlInstancesServiceClient &&
|
Returns | |
---|---|
Type | Description |
SqlInstancesServiceClient & |
Functions
AddServerCa(google::cloud::sql::v1::SqlInstancesAddServerCaRequest const &, Options)
Adds a new trusted Certificate Authority (CA) version for the specified instance.
Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesAddServerCaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Clone(google::cloud::sql::v1::SqlInstancesCloneRequest const &, Options)
Creates a Cloud SQL instance as a clone of the source instance.
Using this operation might cause your instance to restart.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesCloneRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Delete(google::cloud::sql::v1::SqlInstancesDeleteRequest const &, Options)
Deletes a Cloud SQL instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesDeleteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DemoteMaster(google::cloud::sql::v1::SqlInstancesDemoteMasterRequest const &, Options)
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesDemoteMasterRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Export(google::cloud::sql::v1::SqlInstancesExportRequest const &, Options)
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesExportRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Failover(google::cloud::sql::v1::SqlInstancesFailoverRequest const &, Options)
Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance.
Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesFailoverRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Reencrypt(google::cloud::sql::v1::SqlInstancesReencryptRequest const &, Options)
Reencrypt CMEK instance with latest key version.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesReencryptRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Get(google::cloud::sql::v1::SqlInstancesGetRequest const &, Options)
Retrieves a resource containing information about a Cloud SQL instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesGetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::DatabaseInstance > | the result of the RPC. The response message type (google.cloud.sql.v1.DatabaseInstance) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Import(google::cloud::sql::v1::SqlInstancesImportRequest const &, Options)
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesImportRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Insert(google::cloud::sql::v1::SqlInstancesInsertRequest const &, Options)
Creates a new Cloud SQL instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesInsertRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
List(google::cloud::sql::v1::SqlInstancesListRequest, Options)
Lists instances under a given project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesListRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::sql::v1::DatabaseInstance > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListServerCas(google::cloud::sql::v1::SqlInstancesListServerCasRequest const &, Options)
Lists all of the trusted Certificate Authorities (CAs) for the specified instance.
There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesListServerCasRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::InstancesListServerCasResponse > | the result of the RPC. The response message type (google.cloud.sql.v1.InstancesListServerCasResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Patch(google::cloud::sql::v1::SqlInstancesPatchRequest const &, Options)
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration.
This method supports patch semantics.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesPatchRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
PromoteReplica(google::cloud::sql::v1::SqlInstancesPromoteReplicaRequest const &, Options)
Promotes the read replica instance to be a stand-alone Cloud SQL instance.
Using this operation might cause your instance to restart.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesPromoteReplicaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Switchover(google::cloud::sql::v1::SqlInstancesSwitchoverRequest const &, Options)
Switches over from the primary instance to the replica instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesSwitchoverRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ResetSslConfig(google::cloud::sql::v1::SqlInstancesResetSslConfigRequest const &, Options)
Deletes all client certificates and generates a new server SSL certificate for the instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesResetSslConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Restart(google::cloud::sql::v1::SqlInstancesRestartRequest const &, Options)
Restarts a Cloud SQL instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesRestartRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
RestoreBackup(google::cloud::sql::v1::SqlInstancesRestoreBackupRequest const &, Options)
Restores a backup of a Cloud SQL instance.
Using this operation might cause your instance to restart.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesRestoreBackupRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
RotateServerCa(google::cloud::sql::v1::SqlInstancesRotateServerCaRequest const &, Options)
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesRotateServerCaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
StartReplica(google::cloud::sql::v1::SqlInstancesStartReplicaRequest const &, Options)
Starts the replication in the read replica instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesStartReplicaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
StopReplica(google::cloud::sql::v1::SqlInstancesStopReplicaRequest const &, Options)
Stops the replication in the read replica instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesStopReplicaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TruncateLog(google::cloud::sql::v1::SqlInstancesTruncateLogRequest const &, Options)
Truncate MySQL general and slow query log tables MySQL only.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesTruncateLogRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
Update(google::cloud::sql::v1::SqlInstancesUpdateRequest const &, Options)
Updates settings of a Cloud SQL instance.
Using this operation might cause your instance to restart.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesUpdateRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateEphemeral(google::cloud::sql::v1::SqlInstancesCreateEphemeralCertRequest const &, Options)
Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance.
Users may use the certificate to authenticate as themselves when connecting to the database.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesCreateEphemeralCertRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::SslCert > | the result of the RPC. The response message type (google.cloud.sql.v1.SslCert) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
RescheduleMaintenance(google::cloud::sql::v1::SqlInstancesRescheduleMaintenanceRequest const &, Options)
Reschedules the maintenance on the given instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesRescheduleMaintenanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
VerifyExternalSyncSettings(google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest const &, Options)
Verify External primary instance external sync settings.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsResponse > | the result of the RPC. The response message type (google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
StartExternalSync(google::cloud::sql::v1::SqlInstancesStartExternalSyncRequest const &, Options)
Start External primary instance migration.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesStartExternalSyncRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
PerformDiskShrink(google::cloud::sql::v1::SqlInstancesPerformDiskShrinkRequest const &, Options)
Perform Disk Shrink on primary instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesPerformDiskShrinkRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetDiskShrinkConfig(google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigRequest const &, Options)
Get Disk Shrink Config for a given instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigResponse > | the result of the RPC. The response message type (google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ResetReplicaSize(google::cloud::sql::v1::SqlInstancesResetReplicaSizeRequest const &, Options)
Reset Replica Size to primary instance disk size.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesResetReplicaSizeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::Operation > | the result of the RPC. The response message type (google.cloud.sql.v1.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetLatestRecoveryTime(google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest const &, Options)
Get Latest Recovery Time for a given instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeResponse > | the result of the RPC. The response message type (google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |