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

[stormondemand|compute] change all keys for response data into strings

This commit is contained in:
Eric Wong 2013-05-23 07:39:21 +08:00
parent 89c569fee2
commit a42625e402
7 changed files with 15 additions and 15 deletions

View file

@ -16,7 +16,7 @@ module Fog
def available(name)
avail = service.check_balancer_available(:name => name).body
avail[:available].to_i == 1 ? true : false
avail['available'].to_i == 1 ? true : false
end
def create(options)
@ -30,11 +30,11 @@ module Fog
end
def possible_nodes(options={})
service.get_balancer_possible_nodes(options).body[:items]
service.get_balancer_possible_nodes(options).body['items']
end
def strategies
service.get_balancer_strategies.body[:strategies]
service.get_balancer_strategies.body['strategies']
end
end

View file

@ -14,11 +14,11 @@ module Fog
def basic_options(server_id)
res = service.get_firewall_basic_options(:uniq_id => server_id).body
res[:options]
res['options']
end
def rules(server_id)
service.get_firewall_rules(:uniq_id => server_id).body[:rules]
service.get_firewall_rules(:uniq_id => server_id).body['rules']
end
def update(options)

View file

@ -19,16 +19,16 @@ module Fog
end
def all(options={})
data = service.list_network_ips(options).body[:items]
data = service.list_network_ips(options).body['items']
load(data)
end
def get_public_accounts(options={})
service.list_ip_public_accounts(options).body[:items]
service.list_ip_public_accounts(options).body['items']
end
def all_public(options={})
data = service.list_network_public_ips(options).body[:items]
data = service.list_network_public_ips(options).body['items']
load(data)
end

View file

@ -19,7 +19,7 @@ module Fog
end
def get_assignments(options={})
service.get_assignments(options).body[:items]
service.get_assignments(options).body['items']
end
end

View file

@ -15,22 +15,22 @@ module Fog
end
def get(server_id)
service.get_private_ip(:uniq_id => server_id).body[:ip]
service.get_private_ip(:uniq_id => server_id).body['ip']
end
def attach(server_id)
res = service.attach_server_to_private_ip(:uniq_id => server_id).body
res[:attached].to_i == 1 ? true : false
res['attached'].to_i == 1 ? true : false
end
def detach(server_id)
r = service.detach_server_from_private_ip(:uniq_id => server_id).body
r[:detached].to_i == 1 ? true : false
r['detached'].to_i == 1 ? true : false
end
def attached?(server_id)
r = service.check_server_attached(:uniq_id => server_id).body
r[:is_attached].to_i == 1 ? true : false
r['is_attached'].to_i == 1 ? true : false
end
end

View file

@ -18,7 +18,7 @@ module Fog
end
def all(options={})
r = service.list_rulesets(options).body[:item]
r = service.list_rulesets(options).body['item']
load(r)
end

View file

@ -63,7 +63,7 @@ module Fog
def history(options={})
requires :identity
res = service.server_history({:uniq_id => identity}.merge!(options))
res[:items]
res['items']
end
def shutdown(options={})