mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[voxel|compute] Updates reference to service
This commit is contained in:
parent
00068859b9
commit
b24877b9ed
3 changed files with 9 additions and 9 deletions
|
@ -10,12 +10,12 @@ module Fog
|
|||
model Fog::Compute::Voxel::Image
|
||||
|
||||
def all
|
||||
data = connection.images_list.body['images']
|
||||
data = service.images_list.body['images']
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(image_id)
|
||||
data = connection.images_list(image_id).body['images']
|
||||
data = service.images_list(image_id).body['images']
|
||||
|
||||
if data.empty?
|
||||
nil
|
||||
|
|
|
@ -22,13 +22,13 @@ module Fog
|
|||
|
||||
def destroy
|
||||
requires :id
|
||||
connection.voxcloud_delete(id)
|
||||
service.voxcloud_delete(id)
|
||||
true
|
||||
end
|
||||
|
||||
def image
|
||||
requires :image_id
|
||||
connection.images.get(image_id)
|
||||
service.images.get(image_id)
|
||||
end
|
||||
|
||||
def ready?
|
||||
|
@ -45,19 +45,19 @@ module Fog
|
|||
|
||||
def reboot
|
||||
requires :id
|
||||
connection.devices_power(id, :reboot)
|
||||
service.devices_power(id, :reboot)
|
||||
true
|
||||
end
|
||||
|
||||
def state
|
||||
@state ||= connection.voxcloud_status(id).body['devices'].first['status']
|
||||
@state ||= service.voxcloud_status(id).body['devices'].first['status']
|
||||
end
|
||||
|
||||
def save
|
||||
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
|
||||
requires :name, :image_id, :processing_cores, :facility, :disk_size
|
||||
|
||||
data = connection.voxcloud_create({
|
||||
data = service.voxcloud_create({
|
||||
:disk_size => disk_size,
|
||||
:facility => facility,
|
||||
:hostname => name,
|
||||
|
|
|
@ -9,12 +9,12 @@ module Fog
|
|||
model Fog::Compute::Voxel::Server
|
||||
|
||||
def all
|
||||
data = connection.devices_list.body['devices'].select {|device| device['type']['id'] == '3'}
|
||||
data = service.devices_list.body['devices'].select {|device| device['type']['id'] == '3'}
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(device_id)
|
||||
if device_id && server = connection.devices_list(device_id).body['devices']
|
||||
if device_id && server = service.devices_list(device_id).body['devices']
|
||||
new(server.first)
|
||||
end
|
||||
rescue Fog::Service::Error => error
|
||||
|
|
Loading…
Add table
Reference in a new issue