Class: RMC::Item::StoragePool
- Inherits:
-
Object
- Object
- RMC::Item::StoragePool
- Defined in:
- lib/rmc/item/storage_pool.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#createdAt ⇒ Object
readonly
Returns the value of attribute createdAt.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#storageSystemId ⇒ Object
readonly
Returns the value of attribute storageSystemId.
Instance Method Summary collapse
- #delete ⇒ Object
- #get_hosts ⇒ Object
-
#initialize(connection, data) ⇒ StoragePool
constructor
A new instance of StoragePool.
Constructor Details
#initialize(connection, data) ⇒ StoragePool
Returns a new instance of StoragePool.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rmc/item/storage_pool.rb', line 16 def initialize(connection, data) @connection = connection @id = data['id'] @name = data['name'] @status = data['status'] @createdAt = data['createdAt'] @storageSystemId = data['storageSystemId'] @protocol = data['protocol'] end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
6 7 8 |
# File 'lib/rmc/item/storage_pool.rb', line 6 def connection @connection end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
11 12 13 |
# File 'lib/rmc/item/storage_pool.rb', line 11 def createdAt @createdAt end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/rmc/item/storage_pool.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/rmc/item/storage_pool.rb', line 9 def name @name end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
14 15 16 |
# File 'lib/rmc/item/storage_pool.rb', line 14 def protocol @protocol end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/rmc/item/storage_pool.rb', line 10 def status @status end |
#storageSystemId ⇒ Object (readonly)
Returns the value of attribute storageSystemId.
13 14 15 |
# File 'lib/rmc/item/storage_pool.rb', line 13 def storageSystemId @storageSystemId end |
Instance Method Details
#delete ⇒ Object
42 43 44 45 46 47 |
# File 'lib/rmc/item/storage_pool.rb', line 42 def delete @connection.request( :url => "/storage-pools/#{@id}", :method => :delete, ) end |
#get_hosts ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rmc/item/storage_pool.rb', line 29 def get_hosts response = @connection.request( :url => "/storage-pools/#{@id}/hosts", ) hosts = [] response['hosts'].each do |_data| hosts << RMC::Item::Host.new(@connection, _data) end hosts end |