Sha256: d079c85dcd83d6f0126c0746fcbd64f8f378d22070cc31628d3b73ea2a804c0f

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

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

      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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-1.36.0 lib/fog/digitalocean/models/compute_v2/ssh_key.rb
fog-1.35.0 lib/fog/digitalocean/models/compute_v2/ssh_key.rb