Class: Fog::Compute::Ecloud::SshKey

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/compute/ecloud/models/ssh_key.rb

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Instance Method Details

#deleteObject Also known as: destroy



14
15
16
# File 'lib/fog/compute/ecloud/models/ssh_key.rb', line 14

def delete
  service.ssh_key_delete(href).body
end

#edit(options = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/compute/ecloud/models/ssh_key.rb', line 19

def edit(options = {})
  # Make sure we only pass what we should
  new_options = {}
  new_options[:uri] = href
  if options[:Name].nil?
    new_options[:Name] = name
  else
    new_options[:Name] = options[:Name]
  end
  if options[:Default].nil?
    new_options[:Default] = default
  else
    new_options[:Default] = options[:Default]
  end

  service.ssh_key_edit(new_options)
end

#idObject



37
38
39
# File 'lib/fog/compute/ecloud/models/ssh_key.rb', line 37

def id
  href.scan(/\d+/)[0]
end