Class: DeltacloudVM::Client::Key

Inherits:
Base
  • Object
show all
Defined in:
lib/deltacloud_vm/client/models/key.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #name, #obj_id, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#client, #connection, convert, #entrypoint, from_collection, #id, #initialize, #original_body, #to_s, #update_instance_variables!, validate_attrs!

Methods included from Helpers::XmlHelper

#extract_xml_body

Methods included from Methods::Api

#api_uri, #current_driver, #current_provider, #feature?, #features, #must_support!, #path, #support?, #supported_collections, #version

Methods included from Helpers::Model

#error, #from_collection, #from_resource, #model

Constructor Details

This class inherits a constructor from DeltacloudVM::Client::Base

Instance Attribute Details

#fingerprintObject (readonly)

Returns the value of attribute fingerprint.



27
28
29
# File 'lib/deltacloud_vm/client/models/key.rb', line 27

def fingerprint
  @fingerprint
end

#passwordObject (readonly)

Returns the value of attribute password.



25
26
27
# File 'lib/deltacloud_vm/client/models/key.rb', line 25

def password
  @password
end

#public_keyObject (readonly)

Returns the value of attribute public_key.



26
27
28
# File 'lib/deltacloud_vm/client/models/key.rb', line 26

def public_key
  @public_key
end

#stateObject (readonly)

Custom attributes:



23
24
25
# File 'lib/deltacloud_vm/client/models/key.rb', line 23

def state
  @state
end

#usernameObject (readonly)

Returns the value of attribute username.



24
25
26
# File 'lib/deltacloud_vm/client/models/key.rb', line 24

def username
  @username
end

Class Method Details

.parse(xml_body) ⇒ Object

Parse the Key entity from XML body

  • xml_body -> DeltacloudVM API XML representation of the key



42
43
44
45
46
47
48
49
50
# File 'lib/deltacloud_vm/client/models/key.rb', line 42

def self.parse(xml_body)
  {
    :state => xml_body.text_at(:state),
    :username => xml_body.text_at(:username),
    :password => xml_body.text_at(:password),
    :fingerprint => xml_body.text_at(:fingerprint),
    :public_key => xml_body.text_at(:pem)
  }
end

Instance Method Details

#destroy!Object



34
35
36
# File 'lib/deltacloud_vm/client/models/key.rb', line 34

def destroy!
  destroy_key(_id)
end

#pemObject

Key model methods



30
31
32
# File 'lib/deltacloud_vm/client/models/key.rb', line 30

def pem
  @public_key
end