Class: Radfish::Volume

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, controller:, id: nil, name: nil, capacity_bytes: nil, raid_type: nil, volume_type: nil, drives: nil, encrypted: nil, lock_status: nil, stripe_size: nil, operation_percent_complete: nil, operation_name: nil, write_cache_policy: nil, read_cache_policy: nil, fastpath: nil, health: nil, adapter_data: nil) ⇒ Volume

Returns a new instance of Volume.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/radfish/volume.rb', line 12

def initialize(client:, controller:, id: nil, name: nil, capacity_bytes: nil,
               raid_type: nil, volume_type: nil, drives: nil, encrypted: nil,
               lock_status: nil, stripe_size: nil,
               operation_percent_complete: nil, operation_name: nil,
               write_cache_policy: nil, read_cache_policy: nil,
               fastpath: nil,
               health: nil, adapter_data: nil)
  @client = client
  @controller = controller
  @id = id
  @name = name
  @capacity_bytes = capacity_bytes
  @raid_type = raid_type
  @volume_type = volume_type
  @drives = Array(drives) # normalized list of drive reference ids (e.g., @odata.id)
  @encrypted = encrypted
  @lock_status = lock_status
  @stripe_size = stripe_size
  @operation_percent_complete = operation_percent_complete
  @operation_name = operation_name
  @write_cache_policy = write_cache_policy
  @read_cache_policy = read_cache_policy
  @fastpath = fastpath
  @health = health
  @adapter_data = adapter_data
end

Instance Attribute Details

#adapter_dataObject (readonly)

Canonical, normalized attributes only.



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

def adapter_data
  @adapter_data
end

#capacity_bytesObject (readonly)

Canonical, normalized attributes only.



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

def capacity_bytes
  @capacity_bytes
end

#controllerObject (readonly)

Canonical, normalized attributes only.



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

def controller
  @controller
end

#drivesObject (readonly)

Canonical, normalized attributes only.



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

def drives
  @drives
end

#encryptedObject (readonly)

Canonical, normalized attributes only.



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

def encrypted
  @encrypted
end

#fastpathObject (readonly)

Canonical, normalized attributes only.



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

def fastpath
  @fastpath
end

#healthObject (readonly)

Canonical, normalized attributes only.



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

def health
  @health
end

#idObject (readonly)

Canonical, normalized attributes only.



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

def id
  @id
end

#lock_statusObject (readonly)

Canonical, normalized attributes only.



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

def lock_status
  @lock_status
end

#nameObject (readonly)

Canonical, normalized attributes only.



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

def name
  @name
end

#operation_nameObject (readonly)

Canonical, normalized attributes only.



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

def operation_name
  @operation_name
end

#operation_percent_completeObject (readonly)

Canonical, normalized attributes only.



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

def operation_percent_complete
  @operation_percent_complete
end

#raid_typeObject (readonly)

Canonical, normalized attributes only.



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

def raid_type
  @raid_type
end

#read_cache_policyObject (readonly)

Canonical, normalized attributes only.



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

def read_cache_policy
  @read_cache_policy
end

#stripe_sizeObject (readonly)

Canonical, normalized attributes only.



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

def stripe_size
  @stripe_size
end

#volume_typeObject (readonly)

Canonical, normalized attributes only.



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

def volume_type
  @volume_type
end

#write_cache_policyObject (readonly)

Canonical, normalized attributes only.



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

def write_cache_policy
  @write_cache_policy
end

Instance Method Details

#to_hObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/radfish/volume.rb', line 43

def to_h
  {
    id: id,
    name: name,
    capacity_bytes: capacity_bytes,
    raid_type: raid_type,
    volume_type: volume_type,
    drives: drives,
    encrypted: encrypted,
    lock_status: lock_status,
    stripe_size: stripe_size,
    operation_percent_complete: operation_percent_complete,
    operation_name: operation_name,
    write_cache_policy: write_cache_policy,
    read_cache_policy: read_cache_policy,
    fastpath: fastpath,
    health: health
  }.compact
end