pub struct InstanceMethods<'a, C>where
C: '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_sql1_beta4 as sql1_beta4;
use sql1_beta4::{SQLAdmin, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = SQLAdmin::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `add_server_ca(...)`, `clone(...)`, `delete(...)`, `demote_master(...)`, `export(...)`, `failover(...)`, `get(...)`, `import(...)`, `insert(...)`, `list(...)`, `list_server_cas(...)`, `patch(...)`, `promote_replica(...)`, `reset_ssl_config(...)`, `restart(...)`, `restore_backup(...)`, `rotate_server_ca(...)`, `start_replica(...)`, `stop_replica(...)`, `truncate_log(...)` and `update(...)`
// to build up your call.
let rb = hub.instances();
Implementations§
Source§impl<'a, C> InstanceMethods<'a, C>
impl<'a, C> InstanceMethods<'a, C>
Sourcepub fn add_server_ca(
&self,
project: &str,
instance: &str,
) -> InstanceAddServerCaCall<'a, C>
pub fn add_server_ca( &self, project: &str, instance: &str, ) -> InstanceAddServerCaCall<'a, C>
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, C>
pub fn clone( &self, request: InstancesCloneRequest, project: &str, instance: &str, ) -> InstanceCloneCall<'a, C>
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, C>
pub fn delete(&self, project: &str, instance: &str) -> InstanceDeleteCall<'a, C>
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_master(
&self,
request: InstancesDemoteMasterRequest,
project: &str,
instance: &str,
) -> InstanceDemoteMasterCall<'a, C>
pub fn demote_master( &self, request: InstancesDemoteMasterRequest, project: &str, instance: &str, ) -> InstanceDemoteMasterCall<'a, C>
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, C>
pub fn export( &self, request: InstancesExportRequest, project: &str, instance: &str, ) -> InstanceExportCall<'a, C>
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
- Cloud SQL instance ID. This does not include the project ID.
Sourcepub fn failover(
&self,
request: InstancesFailoverRequest,
project: &str,
instance: &str,
) -> InstanceFailoverCall<'a, C>
pub fn failover( &self, request: InstancesFailoverRequest, project: &str, instance: &str, ) -> InstanceFailoverCall<'a, C>
Create a builder to help you perform the following task:
Failover the instance to its failover replica instance. Using this operation might cause your instance to restart.
§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, C>
pub fn get(&self, project: &str, instance: &str) -> InstanceGetCall<'a, C>
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, C>
pub fn import( &self, request: InstancesImportRequest, project: &str, instance: &str, ) -> InstanceImportCall<'a, C>
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, C>
pub fn insert( &self, request: DatabaseInstance, project: &str, ) -> InstanceInsertCall<'a, C>
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, C>
pub fn list(&self, project: &str) -> InstanceListCall<'a, C>
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, C>
pub fn list_server_cas( &self, project: &str, instance: &str, ) -> InstanceListServerCaCall<'a, C>
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, C>
pub fn patch( &self, request: DatabaseInstance, project: &str, instance: &str, ) -> InstancePatchCall<'a, C>
Create a builder to help you perform the following task:
Updates settings of a Cloud SQL instance. 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, C>
pub fn promote_replica( &self, project: &str, instance: &str, ) -> InstancePromoteReplicaCall<'a, C>
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 reset_ssl_config(
&self,
project: &str,
instance: &str,
) -> InstanceResetSslConfigCall<'a, C>
pub fn reset_ssl_config( &self, project: &str, instance: &str, ) -> InstanceResetSslConfigCall<'a, C>
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, C>
pub fn restart( &self, project: &str, instance: &str, ) -> InstanceRestartCall<'a, C>
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, C>
pub fn restore_backup( &self, request: InstancesRestoreBackupRequest, project: &str, instance: &str, ) -> InstanceRestoreBackupCall<'a, C>
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, C>
pub fn rotate_server_ca( &self, request: InstancesRotateServerCaRequest, project: &str, instance: &str, ) -> InstanceRotateServerCaCall<'a, C>
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, C>
pub fn start_replica( &self, project: &str, instance: &str, ) -> InstanceStartReplicaCall<'a, C>
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, C>
pub fn stop_replica( &self, project: &str, instance: &str, ) -> InstanceStopReplicaCall<'a, C>
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 truncate_log(
&self,
request: InstancesTruncateLogRequest,
project: &str,
instance: &str,
) -> InstanceTruncateLogCall<'a, C>
pub fn truncate_log( &self, request: InstancesTruncateLogRequest, project: &str, instance: &str, ) -> InstanceTruncateLogCall<'a, C>
Create a builder to help you perform the following task:
Truncate MySQL general and slow query log tables
§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, C>
pub fn update( &self, request: DatabaseInstance, project: &str, instance: &str, ) -> InstanceUpdateCall<'a, C>
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.
Trait Implementations§
impl<'a, C> MethodsBuilder for InstanceMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for InstanceMethods<'a, C>
impl<'a, C> !RefUnwindSafe for InstanceMethods<'a, C>
impl<'a, C> Send for InstanceMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for InstanceMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for InstanceMethods<'a, C>
impl<'a, C> !UnwindSafe for InstanceMethods<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more