class Fog::Google::SQL::SslCert
A SSL certificate resource
@see developers.google.com/cloud-sql/docs/admin-api/v1beta3/sslCerts
Public Instance Methods
destroy(options = {})
click to toggle source
Deletes a SSL certificate. The change will not take effect until the instance is restarted.
@param [Hash] options Method options @option options [Boolean] :async If the operation must be performed asynchronously (true by default) @return [Fog::Google::SQL::Operation] A Operation resource
# File lib/fog/google/models/sql/ssl_cert.rb, line 32 def destroy(options = {}) requires :instance, :identity data = service.delete_ssl_cert(instance, identity) operation = Fog::Google::SQL::Operations.new(:service => service).get(instance, data.body["operation"]) operation.wait_for { ready? } unless options.fetch(:async, true) operation end
reload()
click to toggle source
Reloads a SSL certificate
@return [Fog::Google::SQL::SslCert] SSL certificate resource
# File lib/fog/google/models/sql/ssl_cert.rb, line 45 def reload requires :instance, :identity data = collection.get(instance, identity) merge_attributes(data.attributes) self end
save()
click to toggle source
Creates a SSL certificate. The new certificate will not be usable until the instance is restarted.
@raise [Fog::Errors::Error] If SSL certificate already exists
# File lib/fog/google/models/sql/ssl_cert.rb, line 57 def save requires :instance, :common_name raise Fog::Errors::Error.new("Resaving an existing object may create a duplicate") if persisted? data = service.insert_ssl_cert(instance, common_name).body merge_attributes(data["clientCert"]["certInfo"]) self.server_ca_cert = Fog::Google::SQL::SslCert.new(data["serverCaCert"]) self.cert_private_key = data["clientCert"]["certPrivateKey"] self end