diff --git a/lib/fog/ninefold/models/compute/address.rb b/lib/fog/ninefold/models/compute/address.rb index 9c50fa7bd..8dd50e1b8 100644 --- a/lib/fog/ninefold/models/compute/address.rb +++ b/lib/fog/ninefold/models/compute/address.rb @@ -35,19 +35,19 @@ module Fog def destroy requires :identity - self.jobid = extract_job_id(connection.disassociate_ip_address(:id => identity)) + self.jobid = extract_job_id(service.disassociate_ip_address(:id => identity)) true end def enable_static_nat(server) server.kind_of?(Integer) ? serverid = server : serverid = server.identity - res = connection.enable_static_nat(:virtualmachineid => serverid, :ipaddressid => identity) + res = service.enable_static_nat(:virtualmachineid => serverid, :ipaddressid => identity) reload to_boolean(res['success']) end def disable_static_nat() - self.jobid = extract_job_id(connection.disable_static_nat(:ipaddressid => identity)) + self.jobid = extract_job_id(service.disable_static_nat(:ipaddressid => identity)) true end @@ -59,7 +59,7 @@ module Fog end def ready? - if jobid && connection.query_async_job_result(:jobid => jobid)['jobstatus'] == 0 + if jobid && service.query_async_job_result(:jobid => jobid)['jobstatus'] == 0 false else # No running job, we are ready. Refresh data. reload @@ -77,7 +77,7 @@ module Fog :account => account, :domainid => domainid }.delete_if {|k,v| v.nil? || v == "" } - data = connection.associate_ip_address(options) + data = service.associate_ip_address(options) merge_attributes(data) true end diff --git a/lib/fog/ninefold/models/compute/addresses.rb b/lib/fog/ninefold/models/compute/addresses.rb index a1b7e1982..15f7e7880 100644 --- a/lib/fog/ninefold/models/compute/addresses.rb +++ b/lib/fog/ninefold/models/compute/addresses.rb @@ -10,13 +10,13 @@ module Fog model Fog::Compute::Ninefold::Address def all - data = connection.list_public_ip_addresses + data = service.list_public_ip_addresses load(data) end def get(identifier) return nil if identifier.nil? || identifier == "" - data = connection.list_public_ip_addresses(:id => identifier) + data = service.list_public_ip_addresses(:id => identifier) if data.empty? nil else diff --git a/lib/fog/ninefold/models/compute/flavors.rb b/lib/fog/ninefold/models/compute/flavors.rb index d678e5e4d..4212ab350 100644 --- a/lib/fog/ninefold/models/compute/flavors.rb +++ b/lib/fog/ninefold/models/compute/flavors.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Ninefold::Flavor def all - data = connection.list_service_offerings + data = service.list_service_offerings load(data) end def get(identifier) - data = connection.list_service_offerings(:id => identifier) + data = service.list_service_offerings(:id => identifier) if data.empty? nil else diff --git a/lib/fog/ninefold/models/compute/images.rb b/lib/fog/ninefold/models/compute/images.rb index 5258c920a..41ea91343 100644 --- a/lib/fog/ninefold/models/compute/images.rb +++ b/lib/fog/ninefold/models/compute/images.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Ninefold::Image def all(offering = 'executable') - data = connection.list_templates(:templatefilter => offering) + data = service.list_templates(:templatefilter => offering) load(data) end def get(identifier, offering = 'executable') - data = connection.list_templates(:templatefilter => offering, :id => identifier) + data = service.list_templates(:templatefilter => offering, :id => identifier) if data.empty? nil else diff --git a/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb b/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb index 4fa74fd43..3853c4237 100644 --- a/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb +++ b/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb @@ -25,12 +25,12 @@ module Fog def destroy requires :identity - self.jobid = extract_job_id(connection.delete_ip_forwarding_rule(:id => identity)) + self.jobid = extract_job_id(service.delete_ip_forwarding_rule(:id => identity)) true end def ready? - if jobid && connection.query_async_job_result(:jobid => jobid)['jobstatus'] == 0 + if jobid && service.query_async_job_result(:jobid => jobid)['jobstatus'] == 0 false else # No running job, we are ready. Refresh data. reload @@ -58,7 +58,7 @@ module Fog :startport => startport, :endport => endport }.delete_if {|k,v| v.nil? || v == "" } - data = connection.create_ip_forwarding_rule(options) + data = service.create_ip_forwarding_rule(options) merge_attributes(data) true end diff --git a/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb b/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb index af835e54c..ae0826cdc 100644 --- a/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb +++ b/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb @@ -10,13 +10,13 @@ module Fog model Fog::Compute::Ninefold::IpForwardingRule def all - data = connection.list_ip_forwarding_rules + data = service.list_ip_forwarding_rules load(data) end def get(identifier) return nil if identifier.nil? || identifier == "" - data = connection.list_ip_forwarding_rules(:id => identifier) + data = service.list_ip_forwarding_rules(:id => identifier) if data.empty? nil else diff --git a/lib/fog/ninefold/models/compute/server.rb b/lib/fog/ninefold/models/compute/server.rb index 46fbb087d..42d709b36 100644 --- a/lib/fog/ninefold/models/compute/server.rb +++ b/lib/fog/ninefold/models/compute/server.rb @@ -82,43 +82,43 @@ module Fog def reboot requires :identity - self.jobid = extract_job_id(connection.reboot_virtual_machine(:id => identity)) + self.jobid = extract_job_id(service.reboot_virtual_machine(:id => identity)) puts "jobid: " + jobid.to_s true end def start requires :identity - self.jobid = extract_job_id(connection.start_virtual_machine(:id => identity)) + self.jobid = extract_job_id(service.start_virtual_machine(:id => identity)) true end def stop requires :identity - self.jobid = extract_job_id(connection.stop_virtual_machine(:id => identity)) + self.jobid = extract_job_id(service.stop_virtual_machine(:id => identity)) true end def destroy requires :identity - self.jobid = extract_job_id(connection.destroy_virtual_machine(:id => identity)) + self.jobid = extract_job_id(service.destroy_virtual_machine(:id => identity)) true end def flavor requires :flavor_id - connection.flavors.get(flavor_id) + service.flavors.get(flavor_id) end def image requires :image_id - connection.images.get(image_id) + service.images.get(image_id) end def ready? if jobid # we do this by polling the last job id status. - res = connection.query_async_job_result(:jobid => jobid) + res = service.query_async_job_result(:jobid => jobid) if res['jobstatus'] == 0 false else @@ -138,7 +138,7 @@ module Fog unless networkids # No network specified, use first in this zone. - networks = connection.list_networks(:zoneid => zoneid) + networks = service.list_networks(:zoneid => zoneid) if networks.empty? raise "No networks. Please create one, or specify a network ID" else @@ -164,7 +164,7 @@ module Fog :size => size, :userdata => userdata }.delete_if {|k,v| v.nil? || v == "" } - data = connection.deploy_virtual_machine(options) + data = service.deploy_virtual_machine(options) merge_attributes(data) true end diff --git a/lib/fog/ninefold/models/compute/servers.rb b/lib/fog/ninefold/models/compute/servers.rb index 01e2ec109..6293bbde2 100644 --- a/lib/fog/ninefold/models/compute/servers.rb +++ b/lib/fog/ninefold/models/compute/servers.rb @@ -10,13 +10,13 @@ module Fog model Fog::Compute::Ninefold::Server def all - data = connection.list_virtual_machines + data = service.list_virtual_machines load(data) end def get(identifier) return nil if identifier.nil? || identifier == "" - data = connection.list_virtual_machines(:id => identifier) + data = service.list_virtual_machines(:id => identifier) if data.empty? nil else