Struct google_sqladmin1_beta4::api::InstanceMethods
source · pub struct InstanceMethods<'a, S>where
S: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on instance resources.
It is not used directly, but through the SQLAdmin
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_sqladmin1_beta4 as sqladmin1_beta4;
use std::default::Default;
use sqladmin1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
let secret: oauth2::ApplicationSecret = Default::default();
let auth = oauth2::InstalledFlowAuthenticator::builder(
secret,
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `add_server_ca(...)`, `clone(...)`, `delete(...)`, `demote(...)`, `demote_master(...)`, `export(...)`, `failover(...)`, `get(...)`, `import(...)`, `insert(...)`, `list(...)`, `list_server_cas(...)`, `patch(...)`, `promote_replica(...)`, `reencrypt(...)`, `reset_ssl_config(...)`, `restart(...)`, `restore_backup(...)`, `rotate_server_ca(...)`, `start_replica(...)`, `stop_replica(...)`, `switchover(...)`, `truncate_log(...)` and `update(...)`
// to build up your call.
let rb = hub.instances();
Implementations§
source§impl<'a, S> InstanceMethods<'a, S>
impl<'a, S> InstanceMethods<'a, S>
sourcepub fn add_server_ca(
&self,
project: &str,
instance: &str
) -> InstanceAddServerCaCall<'a, S>
pub fn add_server_ca( &self, project: &str, instance: &str ) -> InstanceAddServerCaCall<'a, S>
Create a builder to help you perform the following task:
Add 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.
§Arguments
project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn clone(
&self,
request: InstancesCloneRequest,
project: &str,
instance: &str
) -> InstanceCloneCall<'a, S>
pub fn clone( &self, request: InstancesCloneRequest, project: &str, instance: &str ) -> InstanceCloneCall<'a, S>
Create a builder to help you perform the following task:
Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
§Arguments
request
- No description provided.project
- Project ID of the source as well as the clone Cloud SQL instance.instance
- The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.
sourcepub fn delete(&self, project: &str, instance: &str) -> InstanceDeleteCall<'a, S>
pub fn delete(&self, project: &str, instance: &str) -> InstanceDeleteCall<'a, S>
Create a builder to help you perform the following task:
Deletes a Cloud SQL instance.
§Arguments
project
- Project ID of the project that contains the instance to be deleted.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn demote(
&self,
request: InstancesDemoteRequest,
project: &str,
instance: &str
) -> InstanceDemoteCall<'a, S>
pub fn demote( &self, request: InstancesDemoteRequest, project: &str, instance: &str ) -> InstanceDemoteCall<'a, S>
Create a builder to help you perform the following task:
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
§Arguments
request
- No description provided.project
- Required. The project ID of the project that contains the instance.instance
- Required. The name of the Cloud SQL instance.
sourcepub fn demote_master(
&self,
request: InstancesDemoteMasterRequest,
project: &str,
instance: &str
) -> InstanceDemoteMasterCall<'a, S>
pub fn demote_master( &self, request: InstancesDemoteMasterRequest, project: &str, instance: &str ) -> InstanceDemoteMasterCall<'a, S>
Create a builder to help you perform the following task:
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
§Arguments
request
- No description provided.project
- ID of the project that contains the instance.instance
- Cloud SQL instance name.
sourcepub fn export(
&self,
request: InstancesExportRequest,
project: &str,
instance: &str
) -> InstanceExportCall<'a, S>
pub fn export( &self, request: InstancesExportRequest, project: &str, instance: &str ) -> InstanceExportCall<'a, S>
Create a builder to help you perform the following task:
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance to be exported.instance
- The Cloud SQL instance ID. This doesn’t include the project ID.
sourcepub fn failover(
&self,
request: InstancesFailoverRequest,
project: &str,
instance: &str
) -> InstanceFailoverCall<'a, S>
pub fn failover( &self, request: InstancesFailoverRequest, project: &str, instance: &str ) -> InstanceFailoverCall<'a, S>
Create a builder to help you perform the following task:
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.
§Arguments
request
- No description provided.project
- ID of the project that contains the read replica.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn get(&self, project: &str, instance: &str) -> InstanceGetCall<'a, S>
pub fn get(&self, project: &str, instance: &str) -> InstanceGetCall<'a, S>
Create a builder to help you perform the following task:
Retrieves a resource containing information about a Cloud SQL instance.
§Arguments
project
- Project ID of the project that contains the instance.instance
- Database instance ID. This does not include the project ID.
sourcepub fn import(
&self,
request: InstancesImportRequest,
project: &str,
instance: &str
) -> InstanceImportCall<'a, S>
pub fn import( &self, request: InstancesImportRequest, project: &str, instance: &str ) -> InstanceImportCall<'a, S>
Create a builder to help you perform the following task:
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn insert(
&self,
request: DatabaseInstance,
project: &str
) -> InstanceInsertCall<'a, S>
pub fn insert( &self, request: DatabaseInstance, project: &str ) -> InstanceInsertCall<'a, S>
Create a builder to help you perform the following task:
Creates a new Cloud SQL instance.
§Arguments
request
- No description provided.project
- Project ID of the project to which the newly created Cloud SQL instances should belong.
sourcepub fn list(&self, project: &str) -> InstanceListCall<'a, S>
pub fn list(&self, project: &str) -> InstanceListCall<'a, S>
Create a builder to help you perform the following task:
Lists instances under a given project.
§Arguments
project
- Project ID of the project for which to list Cloud SQL instances.
sourcepub fn list_server_cas(
&self,
project: &str,
instance: &str
) -> InstanceListServerCaCall<'a, S>
pub fn list_server_cas( &self, project: &str, instance: &str ) -> InstanceListServerCaCall<'a, S>
Create a builder to help you perform the following task:
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.
§Arguments
project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn patch(
&self,
request: DatabaseInstance,
project: &str,
instance: &str
) -> InstancePatchCall<'a, S>
pub fn patch( &self, request: DatabaseInstance, project: &str, instance: &str ) -> InstancePatchCall<'a, S>
Create a builder to help you perform the following task:
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn promote_replica(
&self,
project: &str,
instance: &str
) -> InstancePromoteReplicaCall<'a, S>
pub fn promote_replica( &self, project: &str, instance: &str ) -> InstancePromoteReplicaCall<'a, S>
Create a builder to help you perform the following task:
Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.
§Arguments
project
- ID of the project that contains the read replica.instance
- Cloud SQL read replica instance name.
sourcepub fn reencrypt(
&self,
request: InstancesReencryptRequest,
project: &str,
instance: &str
) -> InstanceReencryptCall<'a, S>
pub fn reencrypt( &self, request: InstancesReencryptRequest, project: &str, instance: &str ) -> InstanceReencryptCall<'a, S>
Create a builder to help you perform the following task:
Reencrypt CMEK instance with latest key version.
§Arguments
request
- No description provided.project
- ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn reset_ssl_config(
&self,
project: &str,
instance: &str
) -> InstanceResetSslConfigCall<'a, S>
pub fn reset_ssl_config( &self, project: &str, instance: &str ) -> InstanceResetSslConfigCall<'a, S>
Create a builder to help you perform the following task:
Deletes all client certificates and generates a new server SSL certificate for the instance.
§Arguments
project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn restart(
&self,
project: &str,
instance: &str
) -> InstanceRestartCall<'a, S>
pub fn restart( &self, project: &str, instance: &str ) -> InstanceRestartCall<'a, S>
Create a builder to help you perform the following task:
Restarts a Cloud SQL instance.
§Arguments
project
- Project ID of the project that contains the instance to be restarted.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn restore_backup(
&self,
request: InstancesRestoreBackupRequest,
project: &str,
instance: &str
) -> InstanceRestoreBackupCall<'a, S>
pub fn restore_backup( &self, request: InstancesRestoreBackupRequest, project: &str, instance: &str ) -> InstanceRestoreBackupCall<'a, S>
Create a builder to help you perform the following task:
Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn rotate_server_ca(
&self,
request: InstancesRotateServerCaRequest,
project: &str,
instance: &str
) -> InstanceRotateServerCaCall<'a, S>
pub fn rotate_server_ca( &self, request: InstancesRotateServerCaRequest, project: &str, instance: &str ) -> InstanceRotateServerCaCall<'a, S>
Create a builder to help you perform the following task:
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn start_replica(
&self,
project: &str,
instance: &str
) -> InstanceStartReplicaCall<'a, S>
pub fn start_replica( &self, project: &str, instance: &str ) -> InstanceStartReplicaCall<'a, S>
Create a builder to help you perform the following task:
Starts the replication in the read replica instance.
§Arguments
project
- ID of the project that contains the read replica.instance
- Cloud SQL read replica instance name.
sourcepub fn stop_replica(
&self,
project: &str,
instance: &str
) -> InstanceStopReplicaCall<'a, S>
pub fn stop_replica( &self, project: &str, instance: &str ) -> InstanceStopReplicaCall<'a, S>
Create a builder to help you perform the following task:
Stops the replication in the read replica instance.
§Arguments
project
- ID of the project that contains the read replica.instance
- Cloud SQL read replica instance name.
sourcepub fn switchover(
&self,
project: &str,
instance: &str
) -> InstanceSwitchoverCall<'a, S>
pub fn switchover( &self, project: &str, instance: &str ) -> InstanceSwitchoverCall<'a, S>
Create a builder to help you perform the following task:
Switches over from the primary instance to a replica instance.
§Arguments
project
- ID of the project that contains the replica.instance
- Cloud SQL read replica instance name.
sourcepub fn truncate_log(
&self,
request: InstancesTruncateLogRequest,
project: &str,
instance: &str
) -> InstanceTruncateLogCall<'a, S>
pub fn truncate_log( &self, request: InstancesTruncateLogRequest, project: &str, instance: &str ) -> InstanceTruncateLogCall<'a, S>
Create a builder to help you perform the following task:
Truncate MySQL general and slow query log tables MySQL only.
§Arguments
request
- No description provided.project
- Project ID of the Cloud SQL project.instance
- Cloud SQL instance ID. This does not include the project ID.
sourcepub fn update(
&self,
request: DatabaseInstance,
project: &str,
instance: &str
) -> InstanceUpdateCall<'a, S>
pub fn update( &self, request: DatabaseInstance, project: &str, instance: &str ) -> InstanceUpdateCall<'a, S>
Create a builder to help you perform the following task:
Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
§Arguments
request
- No description provided.project
- Project ID of the project that contains the instance.instance
- Cloud SQL instance ID. This does not include the project ID.