Class: VagrantPlugins::Openstack::Domain::Volume

Inherits:
Item
  • Object
show all
Defined in:
lib/vagrant-openstack-illuin-provider/client/domain.rb

Instance Attribute Summary collapse

Attributes inherited from Item

#id, #name

Instance Method Summary collapse

Methods inherited from Item

#==

Constructor Details

#initialize(id, name, size, status, bootable, instance_id, device) ⇒ Volume

rubocop:disable Metrics/ParameterLists



114
115
116
117
118
119
120
121
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 114

def initialize(id, name, size, status, bootable, instance_id, device)
  @size = size
  @status = status
  @bootable = bootable
  @instance_id = instance_id
  @device = device
  super(id, name)
end

Instance Attribute Details

#bootableObject

Whether volume is bootable or not



101
102
103
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 101

def bootable
  @bootable
end

#deviceObject

device (e.g. /dev/sdb) if attached



111
112
113
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 111

def device
  @device
end

#instance_idObject

instance id volume is attached to



106
107
108
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 106

def instance_id
  @instance_id
end

#sizeObject

Size in Gigaoctet



91
92
93
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 91

def size
  @size
end

#statusObject

Status (e.g. ‘Available’, ‘In-use’)



96
97
98
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 96

def status
  @status
end

Instance Method Details

#to_sObject

rubocop:enable Metrics/ParameterLists



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/vagrant-openstack-illuin-provider/client/domain.rb', line 124

def to_s
  {
    id: @id,
    name: @name,
    size: @size,
    status: @status,
    bootable: @bootable,
    instance_id: @instance_id,
    device: @device
  }.to_json
end