Class: OpenStack::Volume::Volume

Inherits:
Object
  • Object
show all
Defined in:
lib/openstack/volume/volume.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(volume_info) ⇒ Volume

Returns a new instance of Volume.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/openstack/volume/volume.rb', line 17

def initialize(volume_info)
  @id  = volume_info["id"]
  @display_name  = volume_info["display_name"] || volume_info["displayName"]
  @display_description  = volume_info["display_description"] || volume_info["displayDescription"]
  @size  = volume_info["size"]
  @volume_type  = volume_info["volume_type"] || volume_info["volumeType"]
  @metadata  = volume_info["metadata"]
  @availability_zone  = volume_info["availability_zone"] || volume_info["availabilityZone"]
  @snapshot_id  = volume_info["snapshot_id"] || volume_info["snapshotId"]
  @attachments  = volume_info["attachments"]
  @created_at  = volume_info["created_at"] || volume_info["createdAt"]
  @status = volume_info["status"]
end

Instance Attribute Details

#attachmentsObject (readonly)

Returns the value of attribute attachments.



13
14
15
# File 'lib/openstack/volume/volume.rb', line 13

def attachments
  @attachments
end

#availability_zoneObject (readonly)

Returns the value of attribute availability_zone.



11
12
13
# File 'lib/openstack/volume/volume.rb', line 11

def availability_zone
  @availability_zone
end

#created_atObject (readonly)

Returns the value of attribute created_at.



14
15
16
# File 'lib/openstack/volume/volume.rb', line 14

def created_at
  @created_at
end

#display_descriptionObject (readonly)

Returns the value of attribute display_description.



7
8
9
# File 'lib/openstack/volume/volume.rb', line 7

def display_description
  @display_description
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



6
7
8
# File 'lib/openstack/volume/volume.rb', line 6

def display_name
  @display_name
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/openstack/volume/volume.rb', line 5

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



10
11
12
# File 'lib/openstack/volume/volume.rb', line 10

def 
  @metadata
end

#sizeObject (readonly)

Returns the value of attribute size.



8
9
10
# File 'lib/openstack/volume/volume.rb', line 8

def size
  @size
end

#snapshot_idObject (readonly)

Returns the value of attribute snapshot_id.



12
13
14
# File 'lib/openstack/volume/volume.rb', line 12

def snapshot_id
  @snapshot_id
end

#statusObject (readonly)

Returns the value of attribute status.



15
16
17
# File 'lib/openstack/volume/volume.rb', line 15

def status
  @status
end

#volume_typeObject (readonly)

Returns the value of attribute volume_type.



9
10
11
# File 'lib/openstack/volume/volume.rb', line 9

def volume_type
  @volume_type
end