Sha256: 550c1f2bacf9bc8946a219e6abe186de8af811dd8d7c2129e52afeda57e50113
Contents?: true
Size: 845 Bytes
Versions: 54
Compression:
Stored size: 845 Bytes
Contents
class Ey::Core::Client::Keypair < Ey::Core::Model extend Ey::Core::Associations identity :id attribute :name attribute :fingerprint attribute :public_key has_one :user has_one :application def deploy(environment) connection.keypair_deployments.create(keypair: self, environment: environment) end def destroy! connection.requests.new(self.connection.destroy_keypair("id" => self.id).body["request"]) end def save! requires :name, :public_key params = { "url" => self.collection.url, "user" => self.user_id, "keypair" => { "name" => self.name, "public_key" => self.public_key, }, } if new_record? merge_attributes(self.connection.create_keypair(params).body["keypair"]) else raise NotImplementedError # update end end end
Version data entries
54 entries across 54 versions & 3 rubygems