Sha256: a668044cb1b77f715218961b0c81e9891ebf47ee75e7957aed82e85bfa1c18b4

Contents?: true

Size: 653 Bytes

Versions: 7

Compression:

Stored size: 653 Bytes

Contents

module Fog
  module Compute
    class DigitalOcean
      class SshKey < Fog::Model
        identity :id
        attribute :fingerprint
        attribute :public_key
        attribute :name

        def save
          requires :name, :public_key
          merge_attributes(service.create_ssh_key(name, public_key).body['ssh_key'])
          true
        end

        def destroy
          requires :id
          service.delete_ssh_key id
        end

        def update
          requires :id, :name
          data = service.update_server(id, name)
          merge_attributes(data.body['ssh_key'])
          true
        end

      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
fog-digitalocean-0.4.0 lib/fog/compute/digitalocean/models/ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/models/compute/ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/models/compute/ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/models/compute/ssh_key.rb
fog-digitalocean-0.3.0 lib/fog/digitalocean/models/compute/ssh_key.rb
fog-digitalocean-0.2.0 lib/fog/digitalocean/models/compute/ssh_key.rb
fog-digitalocean-0.1.0 lib/fog/digitalocean/models/compute/ssh_key.rb