/// <summary> /// Stops the replication in the read replica instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/instances/stopReplica /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">ID of the project that contains the read replica.</param> /// <param name="instance">Cloud SQL read replica instance name.</param> /// <returns>OperationResponse</returns> public static Operation StopReplica(SqladminService service, string project, string instance) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.Instances.StopReplica(project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.StopReplica failed.", ex); } }
/// <summary> /// Lists instances under a given project in the alphabetical order of the instance name. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/instances/list /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project for which to list Cloud SQL instances.</param> /// <param name="optional">Optional paramaters.</param> /// <returns>InstancesListResponseResponse</returns> public static InstancesListResponse List(SqladminService service, string project, InstancesListOptionalParms optional = null) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } // Building the initial request. var request = service.Instances.List(project); // Applying optional parameters to the request. request = (InstancesResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return(request.Execute()); } catch (Exception ex) { throw new Exception("Request Instances.List failed.", ex); } }
/// <summary> /// Restores a backup of a Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/instances/restoreBackup /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <param name="body">A valid Sqladmin v1beta4 body.</param> /// <returns>OperationResponse</returns> public static Operation RestoreBackup(SqladminService service, string project, string instance, InstancesRestoreBackupRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.Instances.RestoreBackup(body, project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.RestoreBackup failed.", ex); } }
/// <summary> /// 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. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/sslCerts/createEphemeral /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the Cloud SQL project.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <param name="body">A valid Sqladmin v1beta4 body.</param> /// <returns>SslCertResponse</returns> public static SslCert CreateEphemeral(SqladminService service, string project, string instance, SslCertsCreateEphemeralRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.SslCerts.CreateEphemeral(body, project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request SslCerts.CreateEphemeral failed.", ex); } }
/// <summary> /// Creates a new Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/instances/insert /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project to which the newly created Cloud SQL instances should belong.</param> /// <param name="body">A valid Sqladmin v1beta4 body.</param> /// <returns>OperationResponse</returns> public static Operation Insert(SqladminService service, string project, DatabaseInstance body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } // Make the request. return(service.Instances.Insert(body, project).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.Insert failed.", ex); } }
/// <summary> /// Deletes the SSL certificate. The change will not take effect until the instance is restarted. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/sslCerts/delete /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance to be deleted.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <param name="sha1Fingerprint">Sha1 FingerPrint.</param> /// <returns>OperationResponse</returns> public static Operation Delete(SqladminService service, string project, string instance, string sha1Fingerprint) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } if (sha1Fingerprint == null) { throw new ArgumentNullException(sha1Fingerprint); } // Make the request. return(service.SslCerts.Delete(project, instance, sha1Fingerprint).Execute()); } catch (Exception ex) { throw new Exception("Request SslCerts.Delete failed.", ex); } }
/// <summary> /// Lists all of the current SSL certificates for the instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/sslCerts/list /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project for which to list Cloud SQL instances.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <returns>SslCertsListResponseResponse</returns> public static SslCertsListResponse List(SqladminService service, string project, string instance) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.SslCerts.List(project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request SslCerts.List failed.", ex); } }
/// <summary> /// Restores a backup of a Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta3/reference/instances/restoreBackup /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <param name="backupConfiguration">The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.</param> /// <param name="dueTime">The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.</param> /// <returns>InstancesRestoreBackupResponseResponse</returns> public static InstancesRestoreBackupResponse RestoreBackup(SqladminService service, string project, string instance, string backupConfiguration, string dueTime) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } if (backupConfiguration == null) { throw new ArgumentNullException(backupConfiguration); } if (dueTime == null) { throw new ArgumentNullException(dueTime); } // Make the request. return(service.Instances.RestoreBackup(project, instance, backupConfiguration, dueTime).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.RestoreBackup failed.", ex); } }
/// <summary> /// Sets the password for the root user of the specified Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta3/reference/instances/setRootPassword /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <param name="body">A valid Sqladmin v1beta3 body.</param> /// <returns>InstancesSetRootPasswordResponseResponse</returns> public static InstancesSetRootPasswordResponse SetRootPassword(SqladminService service, string project, string instance, InstanceSetRootPasswordRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.Instances.SetRootPassword(body, project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.SetRootPassword failed.", ex); } }
/// <summary> /// Deletes all client certificates and generates a new server SSL certificate for a Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta3/reference/instances/resetSslConfig /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Cloud SQL instance ID. This does not include the project ID.</param> /// <returns>InstancesResetSslConfigResponseResponse</returns> public static InstancesResetSslConfigResponse ResetSslConfig(SqladminService service, string project, string instance) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } // Make the request. return(service.Instances.ResetSslConfig(project, instance).Execute()); } catch (Exception ex) { throw new Exception("Request Instances.ResetSslConfig failed.", ex); } }
/// <summary> /// Updates a resource containing information about a database inside a Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/databases/update /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Database instance ID. This does not include the project ID.</param> /// <param name="database">Name of the database to be updated in the instance.</param> /// <param name="body">A valid Sqladmin v1beta4 body.</param> /// <returns>OperationResponse</returns> public static Operation Update(SqladminService service, string project, string instance, string database, Database body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } if (database == null) { throw new ArgumentNullException(database); } // Make the request. return(service.Databases.Update(body, project, instance, database).Execute()); } catch (Exception ex) { throw new Exception("Request Databases.Update failed.", ex); } }
/// <summary> /// Deletes a user from a Cloud SQL instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/users/delete /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="instance">Database instance ID. This does not include the project ID.</param> /// <param name="host">Host of the user in the instance.</param> /// <param name="name">Name of the user in the instance.</param> /// <returns>OperationResponse</returns> public static Operation Delete(SqladminService service, string project, string instance, string host, string name) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (instance == null) { throw new ArgumentNullException(instance); } if (host == null) { throw new ArgumentNullException(host); } if (name == null) { throw new ArgumentNullException(name); } // Make the request. return(service.Users.Delete(project, instance, host, name).Execute()); } catch (Exception ex) { throw new Exception("Request Users.Delete failed.", ex); } }
/// <summary> /// Retrieves an instance operation that has been performed on an instance. /// Documentation https://developers.google.com/sqladmin/v1beta4/reference/operations/get /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <param name="project">Project ID of the project that contains the instance.</param> /// <param name="operation">Instance operation ID.</param> /// <returns>OperationResponse</returns> public static Operation Get(SqladminService service, string project, string operation) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (project == null) { throw new ArgumentNullException(project); } if (operation == null) { throw new ArgumentNullException(operation); } // Make the request. return(service.Operations.Get(project, operation).Execute()); } catch (Exception ex) { throw new Exception("Request Operations.Get failed.", ex); } }
/// <summary> /// Lists all database flags that can be set for Google Cloud SQL instances. /// Documentation https://developers.google.com/sqladmin/v1beta3/reference/flags/list /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Sqladmin service.</param> /// <returns>FlagsListResponseResponse</returns> public static FlagsListResponse List(SqladminService service) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } // Make the request. return(service.Flags.List().Execute()); } catch (Exception ex) { throw new Exception("Request Flags.List failed.", ex); } }