Class: HP::Cloud::VolumeAttachment
- Inherits:
-
Object
- Object
- HP::Cloud::VolumeAttachment
- Defined in:
- lib/hpcloud/volume_attachment.rb
Instance Attribute Summary collapse
-
#cstatus ⇒ Object
Returns the value of attribute cstatus.
-
#device ⇒ Object
Returns the value of attribute device.
-
#id ⇒ Object
Returns the value of attribute id.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#name ⇒ Object
Returns the value of attribute name.
-
#server ⇒ Object
Returns the value of attribute server.
-
#serverId ⇒ Object
Returns the value of attribute serverId.
-
#volumeId ⇒ Object
Returns the value of attribute volumeId.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(va = nil) ⇒ VolumeAttachment
constructor
A new instance of VolumeAttachment.
- #is_valid? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(va = nil) ⇒ VolumeAttachment
Returns a new instance of VolumeAttachment.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/hpcloud/volume_attachment.rb', line 33 def initialize(va = nil) @cstatus = CliStatus.new @fog_va = va if va.nil? return end @id = va["id"] @device = va["device"] @serverId = va["serverId"] @volumeId = va["volumeId"] @name = va["name"] @server = va["server"] end |
Instance Attribute Details
#cstatus ⇒ Object
Returns the value of attribute cstatus.
25 26 27 |
# File 'lib/hpcloud/volume_attachment.rb', line 25 def cstatus @cstatus end |
#device ⇒ Object
Returns the value of attribute device.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def device @device end |
#id ⇒ Object
Returns the value of attribute id.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def id @id end |
#meta ⇒ Object
Returns the value of attribute meta.
27 28 29 |
# File 'lib/hpcloud/volume_attachment.rb', line 27 def @meta end |
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def name @name end |
#server ⇒ Object
Returns the value of attribute server.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def server @server end |
#serverId ⇒ Object
Returns the value of attribute serverId.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def serverId @serverId end |
#volumeId ⇒ Object
Returns the value of attribute volumeId.
26 27 28 |
# File 'lib/hpcloud/volume_attachment.rb', line 26 def volumeId @volumeId end |
Class Method Details
.get_keys ⇒ Object
29 30 31 |
# File 'lib/hpcloud/volume_attachment.rb', line 29 def self.get_keys() return [ "id", "name", "server", "device" ] end |
Instance Method Details
#is_valid? ⇒ Boolean
53 54 55 |
# File 'lib/hpcloud/volume_attachment.rb', line 53 def is_valid? return @cstatus.is_success? end |
#to_hash ⇒ Object
47 48 49 50 51 |
# File 'lib/hpcloud/volume_attachment.rb', line 47 def to_hash hash = {} instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } hash end |