class Brightbox::Volume
Public Class Methods
Source
# File lib/brightbox-cli/volume.rb, line 9 def self.create(options) new(conn.volumes.create(options)) end
Source
# File lib/brightbox-cli/volume.rb, line 17 def self.default_field_order %i[ id type size status server boot name ] end
Source
# File lib/brightbox-cli/volume.rb, line 29 def self.detailed_fields %i[ id name description type size status created_at encrypted serial locked filesystem_label filesystem_type image source source_type server boot delete_with_server zone ] end
Source
# File lib/brightbox-cli/volume.rb, line 13 def self.get(id) conn.volumes.get(id) end
Source
# File lib/brightbox-cli/volume.rb, line 3 def self.require_account?; true; end
Public Instance Methods
Source
# File lib/brightbox-cli/volume.rb, line 53 def attach(server:, boot: false) self.class.conn.attach_volume(id, server: server, boot: boot) reload self end
Source
# File lib/brightbox-cli/volume.rb, line 59 def attributes super.merge( id: fog_model.id, image: image_id, locked: locked?, server: server_id, status: state, type: storage_type, zone: zone_id ) end
Calls superclass method
Brightbox::Api#attributes
Source
# File lib/brightbox-cli/volume.rb, line 71 def update(options) self.class.conn.update_volume(id, options) reload self end