Sha256: 9c2a22d825ca7273f196f0ada85e904150003ebfffffd84d4ca3a3aefa315bc2

Contents?: true

Size: 780 Bytes

Versions: 12

Compression:

Stored size: 780 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
  	class OracleCloud
	    class SshKey < Fog::Model
	      identity  :uri

	      attribute :enabled
	      attribute :key
	      attribute :name
	  
 				def save
         	identity ? update : create
        end

        def create
        	requires :enabled, :name, :key
          
          data = service.create_ssh_key(name, enabled, key)
          merge_attributes(data.body)
        end

        def update
        	requires :enabled, :name, :key, :uri
        	data = service.update_ssh_key(name, enabled, key)
        	merge_attributes(data.body)
        end

        def destroy
        	requires :name
        	service.delete_ssh_key(name)
        end
	    end
	  end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.12 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.2 lib/fog/oraclecloud/models/compute/ssh_key.rb
fog-oraclecloud-0.1.1 lib/fog/oraclecloud/models/compute/ssh_key.rb