Class: RMC::Item::StoragePool

Inherits:
Object
  • Object
show all
Defined in:
lib/rmc/item/storage_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#connectionObject

Returns the value of attribute connection.



6
7
8
# File 'lib/rmc/item/storage_pool.rb', line 6

def connection
  @connection
end

#createdAtObject (readonly)

Returns the value of attribute createdAt.



11
12
13
# File 'lib/rmc/item/storage_pool.rb', line 11

def createdAt
  @createdAt
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/rmc/item/storage_pool.rb', line 8

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/rmc/item/storage_pool.rb', line 9

def name
  @name
end

#protocolObject (readonly)

Returns the value of attribute protocol.



14
15
16
# File 'lib/rmc/item/storage_pool.rb', line 14

def protocol
  @protocol
end

#statusObject (readonly)

Returns the value of attribute status.



10
11
12
# File 'lib/rmc/item/storage_pool.rb', line 10

def status
  @status
end

#storageSystemIdObject (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

#deleteObject



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_hostsObject



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