Class: Squall::Disk
Overview
OnApp Disk
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) add_schedule(id, options = {})
Add autobackup schedule to a disk.
-
- (Object) auto_backup_off(id)
Disable autobackups for a disk.
-
- (Object) auto_backup_on(id)
Enable autobackups for a disk.
-
- (Object) backups(id)
List backups available for a disk.
-
- (Object) build(id)
Builds a disk.
-
- (Object) create(id, options = {})
Creates a new Disk.
-
- (Object) delete(id)
Delete a disk.
-
- (Object) edit(id, options = {})
Updates an existing disk.
-
- (Object) iops_usage(id)
View Input/Output statistics for a disk.
-
- (Object) list
List all disks.
-
- (Object) migrate(vm_id, id, options = {})
Migrates a VM disk to another data store.
-
- (Object) schedules(id)
Get the list of schedules for a disk.
-
- (Object) unlock(id)
Unlock a disk.
-
- (Object) vm_disk_list(id)
List all disks available for a particular VM.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) add_schedule(id, options = {})
Add autobackup schedule to a disk
151 152 153 |
# File 'lib/squall/disk.rb', line 151 def add_schedule(id, = {}) request(:post, "/settings/disks/#{id}/schedules.json", default_params()) end |
- (Object) auto_backup_off(id)
Disable autobackups for a disk
119 120 121 122 |
# File 'lib/squall/disk.rb', line 119 def auto_backup_off(id) response = request(:post, "/settings/disks/#{id}/autobackup_disable.json") response['disk'] end |
- (Object) auto_backup_on(id)
Enable autobackups for a disk.
109 110 111 112 |
# File 'lib/squall/disk.rb', line 109 def auto_backup_on(id) response = request(:post, "/settings/disks/#{id}/autobackup_enable.json") response['disk'] end |
- (Object) backups(id)
List backups available for a disk.
160 161 162 163 |
# File 'lib/squall/disk.rb', line 160 def backups(id) response = request(:get, "/settings/disks/#{id}/backups.json") response.collect { |i| i['backup'] } end |
- (Object) build(id)
Builds a disk.
89 90 91 92 |
# File 'lib/squall/disk.rb', line 89 def build(id) response = request(:post, "/settings/disks/#{id}/build.json") response['disk'] end |
- (Object) create(id, options = {})
Creates a new Disk.
47 48 49 |
# File 'lib/squall/disk.rb', line 47 def create(id, = {}) request(:post, "/virtual_machines/#{id}/disks.json", default_params()) end |
- (Object) delete(id)
Delete a disk.
170 171 172 |
# File 'lib/squall/disk.rb', line 170 def delete(id) request(:delete, "/settings/disks/#{id}.json") end |
- (Object) edit(id, options = {})
Updates an existing disk.
58 59 60 |
# File 'lib/squall/disk.rb', line 58 def edit(id, = {}) request(:put, "/settings/disks/#{id}.json", default_params()) end |
- (Object) iops_usage(id)
View Input/Output statistics for a disk.
79 80 81 82 |
# File 'lib/squall/disk.rb', line 79 def iops_usage(id) response = request(:get, "/settings/disks/#{id}/usage.json") response.collect { |i| i['disk_hourly_stat'] } end |
- (Object) list
List all disks.
7 8 9 10 |
# File 'lib/squall/disk.rb', line 7 def list response = request(:get, "/settings/disks.json") response.collect { |i| i['disk'] } end |
- (Object) migrate(vm_id, id, options = {})
Migrates a VM disk to another data store.
70 71 72 |
# File 'lib/squall/disk.rb', line 70 def migrate(vm_id, id, = {}) request(:post, "/virtual_machines/#{vm_id}/disks/#{id}/migrate.json", default_params()) end |
- (Object) schedules(id)
Get the list of schedules for a disk.
129 130 131 132 |
# File 'lib/squall/disk.rb', line 129 def schedules(id) response = request(:get, "/settings/disks/#{id}/schedules.json") response.collect { |i| i['schedule'] } end |
- (Object) unlock(id)
Unlock a disk.
99 100 101 102 |
# File 'lib/squall/disk.rb', line 99 def unlock(id) response = request(:post, "/settings/disks/#{id}/unlock.json") response['disk'] end |
- (Object) vm_disk_list(id)
List all disks available for a particular VM.
17 18 19 20 |
# File 'lib/squall/disk.rb', line 17 def vm_disk_list(id) response = request(:get, "/virtual_machines/#{id}/disks.json") response.collect { |i| i['disk'] } end |