mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[glesys|compute] Updates reference to service
This commit is contained in:
parent
59bed55aa0
commit
2135e583b5
6 changed files with 27 additions and 27 deletions
|
@ -15,12 +15,12 @@ module Fog
|
|||
attribute :ip
|
||||
|
||||
def list_own
|
||||
connection.list_own
|
||||
service.list_own
|
||||
end
|
||||
|
||||
def list_free
|
||||
requires :version, :datacenter, :platform
|
||||
connection.ip_list_free(
|
||||
service.ip_list_free(
|
||||
:ipversion => version,
|
||||
:platform => platform,
|
||||
:datacenter => datacenter
|
||||
|
@ -29,7 +29,7 @@ module Fog
|
|||
|
||||
def details
|
||||
requires :version, :ip
|
||||
connection.ip_details(
|
||||
service.ip_details(
|
||||
:ipversion => version,
|
||||
:ipaddress => ip
|
||||
)
|
||||
|
@ -37,7 +37,7 @@ module Fog
|
|||
|
||||
def take
|
||||
requires :version, :ip
|
||||
connection.ip_take(
|
||||
service.ip_take(
|
||||
:ipversion => version,
|
||||
:ipaddress => ip
|
||||
)
|
||||
|
@ -45,7 +45,7 @@ module Fog
|
|||
|
||||
def release
|
||||
requires :version, :ip
|
||||
connection.ip_release(
|
||||
service.ip_release(
|
||||
:ipversion => version,
|
||||
:ipaddress => ip
|
||||
)
|
||||
|
@ -53,7 +53,7 @@ module Fog
|
|||
|
||||
def add
|
||||
requires :serverid, :version, :ip
|
||||
connection.ip_add(
|
||||
service.ip_add(
|
||||
:serverid => serverid,
|
||||
:ipversion => version,
|
||||
:ipaddress => ip
|
||||
|
@ -62,7 +62,7 @@ module Fog
|
|||
|
||||
def remove
|
||||
requires :serverid, :version, :ip
|
||||
connection.ip_remove(
|
||||
service.ip_remove(
|
||||
:serverid => serverid,
|
||||
:ipversion => version,
|
||||
:ipaddress => ip
|
||||
|
|
|
@ -12,22 +12,22 @@ module Fog
|
|||
attribute :serverid
|
||||
|
||||
def all
|
||||
data = connection.ip_list_own.body['response']['iplist']
|
||||
data = service.ip_list_own.body['response']['iplist']
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(identifier)
|
||||
return nil if identifier.nil? || identifier == ""
|
||||
|
||||
self.new( :serverid => identifier )
|
||||
|
||||
data = connection.ip_list_own(:serverid => identifier).body['response']
|
||||
self.new( :serverid => identifier )
|
||||
|
||||
data = service.ip_list_own(:serverid => identifier).body['response']
|
||||
if data['iplist'].empty?
|
||||
nil
|
||||
nil
|
||||
else
|
||||
new(data['iplist'].first)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def new(attributes = {})
|
||||
super({ :serverid => serverid }.merge!(attributes))
|
||||
|
|
|
@ -32,22 +32,22 @@ module Fog
|
|||
|
||||
def start
|
||||
requires :identity
|
||||
connection.start(:serverid => identity)
|
||||
service.start(:serverid => identity)
|
||||
end
|
||||
|
||||
def stop
|
||||
requires :identity
|
||||
connection.stop(:serverid => identity)
|
||||
service.stop(:serverid => identity)
|
||||
end
|
||||
|
||||
def reboot
|
||||
requires :identity
|
||||
connection.reboot(:serverid => identity)
|
||||
service.reboot(:serverid => identity)
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :identity
|
||||
connection.destroy(:serverid => identity, :keepip => keepip)
|
||||
service.destroy(:serverid => identity, :keepip => keepip)
|
||||
end
|
||||
|
||||
def save
|
||||
|
@ -64,8 +64,8 @@ module Fog
|
|||
:cpucores => cpucores || "1",
|
||||
:rootpassword => rootpassword,
|
||||
:transfer => transfer || "500",
|
||||
}
|
||||
data = connection.create(options)
|
||||
}
|
||||
data = service.create(options)
|
||||
merge_attributes(data.body['response']['server'])
|
||||
data.status == 200 ? true : false
|
||||
end
|
||||
|
|
|
@ -10,16 +10,16 @@ module Fog
|
|||
model Fog::Compute::Glesys::Server
|
||||
|
||||
def all
|
||||
data = connection.list_servers.body['response']['servers']
|
||||
load(data)
|
||||
data = service.list_servers.body['response']['servers']
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(identifier)
|
||||
return nil if identifier.nil? || identifier == ""
|
||||
|
||||
begin
|
||||
details = connection.server_details(identifier).body['response']
|
||||
status = connection.server_status(identifier).body['response']
|
||||
details = service.server_details(identifier).body['response']
|
||||
status = service.server_status(identifier).body['response']
|
||||
|
||||
if details.empty? || status.empty?
|
||||
nil
|
||||
|
|
|
@ -16,7 +16,7 @@ module Fog
|
|||
attribute :min_disk_size
|
||||
|
||||
def list
|
||||
connection.template_list
|
||||
service.template_list
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -10,8 +10,8 @@ module Fog
|
|||
model Fog::Glesys::Compute::Template
|
||||
|
||||
def all
|
||||
openvz = connection.template_list.body['response']['templates']['OpenVZ']
|
||||
xen = connection.template_list.body['response']['templates']['Xen']
|
||||
openvz = service.template_list.body['response']['templates']['OpenVZ']
|
||||
xen = service.template_list.body['response']['templates']['Xen']
|
||||
|
||||
load(xen+openvz)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue