Class: VagrantPlugins::Deltacloud::Domain::Volume

Inherits:
Item
  • Object
show all
Defined in:
lib/vagrant-deltacloud-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 Style/ParameterLists



121
122
123
124
125
126
127
128
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 121

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



108
109
110
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 108

def bootable
  @bootable
end

#deviceObject

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



118
119
120
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 118

def device
  @device
end

#instance_idObject

instance id volume is attached to



113
114
115
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 113

def instance_id
  @instance_id
end

#sizeObject

Size in Gigaoctet



98
99
100
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 98

def size
  @size
end

#statusObject

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



103
104
105
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 103

def status
  @status
end

Instance Method Details

#to_sObject

rubocop:enable Style/ParameterLists



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/vagrant-deltacloud-provider/client/domain.rb', line 131

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