1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[go_grid|compute] Updates reference to service

This commit is contained in:
Paul Thornthwaite 2012-12-22 23:26:52 +00:00
parent 0c5395b0d6
commit b82eb763f6
6 changed files with 16 additions and 16 deletions

View file

@ -36,7 +36,7 @@ module Fog
def destroy
requires :id
connection.grid_server_delete(id)
service.grid_server_delete(id)
true
end
@ -48,7 +48,7 @@ module Fog
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
requires :server_id
data = connection.grid_server_add(server_id, 'name' => name)
data = service.grid_server_add(server_id, 'name' => name)
merge_attributes(data.body['image'])
true
end

View file

@ -12,7 +12,7 @@ module Fog
attribute :server
def all
data = connection.grid_image_list.body['list']
data = service.grid_image_list.body['list']
load(data)
if server
self.replace(self.select {|image| image.server_id == server.id})
@ -20,7 +20,7 @@ module Fog
end
def get(image_id)
response = connection.grid_image_get.body['list'][image_id]
response = service.grid_image_get.body['list'][image_id]
new(data)
rescue Fog::Compute::GoGrid::NotFound
nil

View file

@ -10,7 +10,7 @@ module Fog
attribute :server_id
attribute :applicationtype
attribute :username
attribute :username
attribute :password_id, :aliases => 'id'
attribute :password
attribute :server
@ -21,13 +21,13 @@ module Fog
def destroy
requires :id
connection.grid_server_destroy(id)
service.grid_server_destroy(id)
true
end
def image
requires :image_id
connection.grid_image_get(image_id)
service.grid_image_get(image_id)
end
def ready?
@ -37,7 +37,7 @@ module Fog
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
requires :password_id
data = connection.support_password_list()
data = service.support_password_list()
merge_attributes(data.body)
true
end

View file

@ -10,7 +10,7 @@ module Fog
model Fog::Compute::GoGrid::Password
def all
data = connection.support_password_list.body['list']
data = service.support_password_list.body['list']
load(data)
end
@ -21,8 +21,8 @@ module Fog
end
def get(id)
#if server_id && server = connection.grid_server_get(server_id).body['list']
if id && server = connection.support_password_get(id).body['list']
#if server_id && server = service.grid_server_get(server_id).body['list']
if id && server = service.support_password_get(id).body['list']
new(server)
end
rescue Fog::Compute::GoGrid::NotFound

View file

@ -27,13 +27,13 @@ module Fog
def destroy
requires :id
connection.grid_server_delete(id)
service.grid_server_delete(id)
true
end
def image
requires :image_id
connection.grid_image_get(:image => image_id)
service.grid_image_get(:image => image_id)
end
def private_ip_address
@ -65,7 +65,7 @@ module Fog
'image' => image_id
}
options = options.reject {|key, value| value.nil?}
data = connection.grid_server_add(image, public_ip_address, name, memory, options)
data = service.grid_server_add(image, public_ip_address, name, memory, options)
merge_attributes(data.body)
true
end

View file

@ -10,7 +10,7 @@ module Fog
model Fog::Compute::GoGrid::Server
def all
data = connection.grid_server_list.body['list']
data = service.grid_server_list.body['list']
load(data)
end
@ -22,7 +22,7 @@ module Fog
end
def get(server_id)
if server_id && server = connection.grid_server_get(server_id).body['list'].first
if server_id && server = service.grid_server_get(server_id).body['list'].first
new(server)
end
rescue Fog::Compute::GoGrid::NotFound