Sha256: 342a3a5104519e4deeb5b96aea03a22280a699d25f812c450c516a573d4e994b
Contents?: true
Size: 1.2 KB
Versions: 38
Compression:
Stored size: 1.2 KB
Contents
class Ey::Core::Client::DatabaseServerSnapshot < Ey::Core::Model extend Ey::Core::Associations identity :id attribute :deleted_at, type: :time attribute :engine attribute :engine_version attribute :location attribute :provisioned_at, type: :time attribute :provisioned_id attribute :storage, type: :integer has_one :provider has_one :database_server has_one :database_service attr_accessor :name def save! if new_record? create_params = if collection.url { "url" => collection.url } elsif self.database_service { "database_service" => self.database_service.identity } else requires_one :database_server, :database_service { "database_service" => self.database_server.database_service.identity } end connection.requests.new( connection.create_database_service_snapshot(create_params.merge("name" => self.name)).body["request"] ) end end def destroy! connection.requests.new( connection.destroy_database_server_snapshot("id" => self.identity).body["request"] ) end end
Version data entries
38 entries across 38 versions & 2 rubygems