Permalink
Browse files

[ecloud|compute] Updates reference to service

  • Loading branch information...
tokengeek committed Dec 22, 2012
1 parent a510d34 commit c9356efe455a1f369d26d21d4189f893f3d6c7d7
Showing with 249 additions and 249 deletions.
  1. +3 −3 lib/fog/ecloud/generate_collection.rb
  2. +5 −5 lib/fog/ecloud/models/compute/admin_organization.rb
  3. +1 −1 lib/fog/ecloud/models/compute/admin_organizations.rb
  4. +2 −2 lib/fog/ecloud/models/compute/api_keys.rb
  5. +3 −3 lib/fog/ecloud/models/compute/association.rb
  6. +2 −2 lib/fog/ecloud/models/compute/associations.rb
  7. +2 −2 lib/fog/ecloud/models/compute/authentication_levels.rb
  8. +7 −7 lib/fog/ecloud/models/compute/backup_internet_service.rb
  9. +3 −3 lib/fog/ecloud/models/compute/backup_internet_services.rb
  10. +2 −2 lib/fog/ecloud/models/compute/catalog.rb
  11. +2 −2 lib/fog/ecloud/models/compute/catalog_configurations.rb
  12. +1 −1 lib/fog/ecloud/models/compute/catalog_item.rb
  13. +10 −10 lib/fog/ecloud/models/compute/compute_pool.rb
  14. +2 −2 lib/fog/ecloud/models/compute/compute_pools.rb
  15. +2 −2 lib/fog/ecloud/models/compute/cpu_usage_detail_summary.rb
  16. +18 −18 lib/fog/ecloud/models/compute/environment.rb
  17. +2 −2 lib/fog/ecloud/models/compute/environments.rb
  18. +1 −1 lib/fog/ecloud/models/compute/firewall_acl.rb
  19. +2 −2 lib/fog/ecloud/models/compute/firewall_acls.rb
  20. +6 −6 lib/fog/ecloud/models/compute/group.rb
  21. +2 −2 lib/fog/ecloud/models/compute/groups.rb
  22. +2 −2 lib/fog/ecloud/models/compute/guest_processes.rb
  23. +2 −2 lib/fog/ecloud/models/compute/hardware_configurations.rb
  24. +16 −16 lib/fog/ecloud/models/compute/internet_service.rb
  25. +3 −3 lib/fog/ecloud/models/compute/internet_services.rb
  26. +2 −2 lib/fog/ecloud/models/compute/ip_addresses.rb
  27. +1 −1 lib/fog/ecloud/models/compute/layout.rb
  28. +2 −2 lib/fog/ecloud/models/compute/layouts.rb
  29. +1 −1 lib/fog/ecloud/models/compute/location.rb
  30. +2 −2 lib/fog/ecloud/models/compute/locations.rb
  31. +2 −2 lib/fog/ecloud/models/compute/login_banners.rb
  32. +2 −2 lib/fog/ecloud/models/compute/memory_usage_detail_summary.rb
  33. +4 −4 lib/fog/ecloud/models/compute/monitor.rb
  34. +2 −2 lib/fog/ecloud/models/compute/monitors.rb
  35. +4 −4 lib/fog/ecloud/models/compute/network.rb
  36. +2 −2 lib/fog/ecloud/models/compute/networks.rb
  37. +5 −5 lib/fog/ecloud/models/compute/node.rb
  38. +3 −3 lib/fog/ecloud/models/compute/nodes.rb
  39. +2 −2 lib/fog/ecloud/models/compute/operating_system_families.rb
  40. +1 −1 lib/fog/ecloud/models/compute/operating_system_family.rb
  41. +1 −1 lib/fog/ecloud/models/compute/operating_systems.rb
  42. +16 −16 lib/fog/ecloud/models/compute/organization.rb
  43. +3 −3 lib/fog/ecloud/models/compute/organizations.rb
  44. +2 −2 lib/fog/ecloud/models/compute/password_complexity_rules.rb
  45. +2 −2 lib/fog/ecloud/models/compute/physical_devices.rb
  46. +1 −1 lib/fog/ecloud/models/compute/public_ip.rb
  47. +4 −4 lib/fog/ecloud/models/compute/public_ips.rb
  48. +2 −2 lib/fog/ecloud/models/compute/rnat.rb
  49. +2 −2 lib/fog/ecloud/models/compute/rnats.rb
  50. +2 −2 lib/fog/ecloud/models/compute/roles.rb
  51. +7 −7 lib/fog/ecloud/models/compute/row.rb
  52. +4 −4 lib/fog/ecloud/models/compute/rows.rb
  53. +35 −35 lib/fog/ecloud/models/compute/server.rb
  54. +2 −2 lib/fog/ecloud/models/compute/server_configuration_options.rb
  55. +6 −6 lib/fog/ecloud/models/compute/servers.rb
  56. +2 −2 lib/fog/ecloud/models/compute/ssh_keys.rb
  57. +2 −2 lib/fog/ecloud/models/compute/storage_usage_detail_summary.rb
  58. +2 −2 lib/fog/ecloud/models/compute/support_tickets.rb
  59. +2 −2 lib/fog/ecloud/models/compute/tags.rb
  60. +3 −3 lib/fog/ecloud/models/compute/tasks.rb
  61. +2 −2 lib/fog/ecloud/models/compute/templates.rb
  62. +5 −5 lib/fog/ecloud/models/compute/trusted_network_group.rb
  63. +2 −2 lib/fog/ecloud/models/compute/trusted_network_groups.rb
  64. +2 −2 lib/fog/ecloud/models/compute/user.rb
  65. +2 −2 lib/fog/ecloud/models/compute/users.rb
@@ -20,7 +20,7 @@ def camelize
methods = options[:methods].map do |m|
m = <<METHOD
def #{m[0]}
- @#{m[0]} = Fog::Compute::Ecloud::#{m[0].camelize}.new(:connection => connection, :href => "#{m[1]}")
+ @#{m[0]} = Fog::Compute::Ecloud::#{m[0].camelize}.new(:service => service, :href => "#{m[1]}")
end
METHOD
end.join("\n ")
@@ -51,12 +51,12 @@ class #{options[:collection].camelize} < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::#{options[:model].camelize}
def all
- data = connection.get_#{options[:collection]}(href).body
+ data = service.get_#{options[:collection]}(href).body
load(data)
end
def get(uri)
- if data = connection.get_#{options[:model]}(uri)
+ if data = service.get_#{options[:model]}(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -11,19 +11,19 @@ class AdminOrganization < Fog::Ecloud::Model
attribute :support_access, :aliases => :SupportAccess
def ssh_keys
- @ssh_keys = Fog::Compute::Ecloud::SshKeys.new(:connection => connection, :href => "/cloudapi/ecloud/admin/sshKeys/organizations/#{organization.id}")
+ @ssh_keys = Fog::Compute::Ecloud::SshKeys.new(:service => service, :href => "/cloudapi/ecloud/admin/sshKeys/organizations/#{organization.id}")
end
def password_complexity_rules
- @password_complexity_rules = Fog::Compute::Ecloud::PasswordComplexityRules.new(:connection => connection, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/passwordComplexityRules")
+ @password_complexity_rules = Fog::Compute::Ecloud::PasswordComplexityRules.new(:service => service, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/passwordComplexityRules")
end
def login_banner
- @login_banner = Fog::Compute::Ecloud::LoginBanner.new(:connection => connection, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/loginBanner")
+ @login_banner = Fog::Compute::Ecloud::LoginBanner.new(:service => service, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/loginBanner")
end
def authentication_levels
- @authentication_levels = Fog::Compute::Ecloud::AuthenticationLevels.new(:connection => connection, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/authenticationLevels")
+ @authentication_levels = Fog::Compute::Ecloud::AuthenticationLevels.new(:service => service, :href => "/cloudapi/ecloud/admin/organizations/#{organization.id}/authenticationLevels")
end
def id
@@ -34,7 +34,7 @@ def organization
@organization ||= begin
reload unless other_links
organization_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.organization"}
- self.connection.organizations.new(organization_link)
+ self.service.organizations.new(organization_link)
end
end
end
@@ -10,7 +10,7 @@ class AdminOrganizations < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::AdminOrganization
def get(uri)
- if data = connection.get_admin_organization(uri)
+ if data = service.get_admin_organization(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -10,12 +10,12 @@ class ApiKeys < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::ApiKey
def all
- data = connection.get_api_keys(href).body
+ data = service.get_api_keys(href).body
load(data)
end
def get(uri)
- if data = connection.get_api_key(uri)
+ if data = service.get_api_key(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -10,10 +10,10 @@ class Association < Fog::Ecloud::Model
attribute :ip_address, :aliases => :IpAddress
def delete
- data = connection.rnat_associations_delete(href).body
- task = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => href)[0]
+ data = service.rnat_associations_delete(href).body
+ task = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => href)[0]
end
-
+
def id
href.scan(/\d+/)[0]
end
@@ -10,7 +10,7 @@ class Associations < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::Association
def all
- data = connection.get_associations(href).body
+ data = service.get_associations(href).body
if data[:Associations]
data = data[:Associations]
if data.is_a?(String) && data.empty?
@@ -23,7 +23,7 @@ def all
end
def get(uri)
- if data = connection.get_association(uri)
+ if data = service.get_association(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -10,12 +10,12 @@ class AuthenticationLevels < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::AuthenticationLevel
def all
- data = connection.get_authentication_levels(href).body
+ data = service.get_authentication_levels(href).body
load(data)
end
def get(uri)
- if data = connection.get_authentication_level(uri)
+ if data = service.get_authentication_level(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -8,32 +8,32 @@ class BackupInternetService < Fog::Ecloud::Model
attribute :type, :aliases => :Type
attribute :other_links, :aliases => :Links
attribute :protocol, :aliases => :Protocol
- attribute :enabled, :aliases => :Enabled, :type => :boolean
+ attribute :enabled, :aliases => :Enabled, :type => :boolean
attribute :description, :aliases => :Description
attribute :persistence, :aliases => :Persistence
attribute :redirect_url, :aliases => :RedirectUrl
def tasks
- @tasks = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => href)
+ @tasks = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => href)
end
def internet_services
- @internet_services = Fog::Compute::Ecloud::InternetServices.new(:connection => connection, :href => href)
+ @internet_services = Fog::Compute::Ecloud::InternetServices.new(:service => service, :href => href)
end
def node_services
- @node_services = Fog::Compute::Ecloud::NodeServices.new(:connection => connection, :href => href)
+ @node_services = Fog::Compute::Ecloud::NodeServices.new(:service => service, :href => href)
end
def edit(options)
options[:uri] = href
- data = connection.backup_internet_service_edit(options).body
+ data = service.backup_internet_service_edit(options).body
object = collection.from_data(data)
end
def delete
- data = connection.backup_internet_service_delete(href).body
- task = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => data[:href])[0]
+ data = service.backup_internet_service_delete(href).body
+ task = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => data[:href])[0]
end
def id
@@ -10,12 +10,12 @@ class BackupInternetServices < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::BackupInternetService
def all
- data = connection.get_backup_internet_services(href).body
+ data = service.get_backup_internet_services(href).body
load(data)
end
def get(uri)
- if data = connection.get_backup_internet_service(uri)
+ if data = service.get_backup_internet_service(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -29,7 +29,7 @@ def from_data(data)
def create(options)
options[:uri] = href + "/action/createBackupInternetService"
options[:enabled] ||= true
- data = connection.backup_internet_service_create(options)
+ data = service.backup_internet_service_create(options)
new(data)
end
@@ -10,7 +10,7 @@ class Catalog < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::CatalogItem
def all
- data = connection.get_catalog(href).body#[:Locations][:Location][:Catalog][:CatalogEntry]
+ data = service.get_catalog(href).body#[:Locations][:Location][:Catalog][:CatalogEntry]
if data[:Locations][:Location].is_a?(Hash)
data = [] if data[:Locations][:Location][:Catalog].is_a?(String) && data[:Locations][:Location][:Catalog].empty?
load(data)
@@ -28,7 +28,7 @@ def all
end
def get(uri)
- if data = connection.get_catalog_item(uri)
+ if data = service.get_catalog_item(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -10,12 +10,12 @@ class CatalogConfigurations < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::CatalogConfiguration
def all
- data = connection.get_catalog_configurations(href).body
+ data = service.get_catalog_configurations(href).body
load(data)
end
def get(uri)
- if data = connection.get_catalog_configuration(uri)
+ if data = service.get_catalog_configuration(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -12,7 +12,7 @@ class CatalogItem < Fog::Ecloud::Model
attribute :files, :aliases => :Files
def configuration
- @configuration = Fog::Compute::Ecloud::CatalogConfigurations.new(:connection => connection, :href => "/cloudapi/ecloud/admin/catalog/#{id}/configuration")
+ @configuration = Fog::Compute::Ecloud::CatalogConfigurations.new(:service => service, :href => "/cloudapi/ecloud/admin/catalog/#{id}/configuration")
end
def id
@@ -15,50 +15,50 @@ class ComputePool < Fog::Ecloud::Model
attribute :memory_burst, :aliases => :MemoryBurst
def servers
- @servers ||= Fog::Compute::Ecloud::Servers.new( :connection => connection, :href => "/cloudapi/ecloud/virtualMachines/computePools/#{id}" )
+ @servers ||= Fog::Compute::Ecloud::Servers.new( :service => service, :href => "/cloudapi/ecloud/virtualMachines/computePools/#{id}" )
end
def layout
- @layout ||= Fog::Compute::Ecloud::Layouts.new(:connection => connection, :href => "/cloudapi/ecloud/layout/computePools/#{id}").first
+ @layout ||= Fog::Compute::Ecloud::Layouts.new(:service => service, :href => "/cloudapi/ecloud/layout/computePools/#{id}").first
end
def cpu_usage
# time ? query = "/details?time=#{Time.parse(time).utc.strftime('%Y-%m-%dT%H:%M:%SZ')}" : query = ""
- @cpu_usage ||= Fog::Compute::Ecloud::CpuUsageDetailSummary.new(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/cpu")
+ @cpu_usage ||= Fog::Compute::Ecloud::CpuUsageDetailSummary.new(:service => service, :href => "/cloudapi/ecloud/computePools/#{id}/usage/cpu")
end
def memory_usage
# time ? query = "/details?time=#{Time.parse(time).utc.strftime('%Y-%m-%dT%H:%M:%SZ')}" : query = ""
- @memory_usage ||= Fog::Compute::Ecloud::MemoryUsageDetailSummary.new(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/memory")
+ @memory_usage ||= Fog::Compute::Ecloud::MemoryUsageDetailSummary.new(:service => service, :href => "/cloudapi/ecloud/computePools/#{id}/usage/memory")
end
def storage_usage
- @storage_usage ||= Fog::Compute::Ecloud::StorageUsageDetailSummary.new(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/storage")
+ @storage_usage ||= Fog::Compute::Ecloud::StorageUsageDetailSummary.new(:service => service, :href => "/cloudapi/ecloud/computePools/#{id}/usage/storage")
end
def operating_system_families
- @operating_system_families ||= Fog::Compute::Ecloud::OperatingSystemFamilies.new(:connection => connection, :href => "/cloudapi/ecloud/operatingSystemFamilies/computePools/#{id}")
+ @operating_system_families ||= Fog::Compute::Ecloud::OperatingSystemFamilies.new(:service => service, :href => "/cloudapi/ecloud/operatingSystemFamilies/computePools/#{id}")
end
def templates
- @templates ||= self.connection.templates(:href => "/cloudapi/ecloud/templates/computePools/#{id}")
+ @templates ||= self.service.templates(:href => "/cloudapi/ecloud/templates/computePools/#{id}")
end
def detached_disks
- @detached_disks ||= self.connection.detached_disks(:href => "/cloudapi/ecloud/detacheddisks/computepools/#{id}")
+ @detached_disks ||= self.service.detached_disks(:href => "/cloudapi/ecloud/detacheddisks/computepools/#{id}")
end
def environment
@environment ||= begin
reload unless other_links
environment_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.environment"}
- self.connection.environments.get(environment_link[:href])
+ self.service.environments.get(environment_link[:href])
end
end
def edit(options)
options[:uri] = href
- data = connection.compute_pool_edit(options).body
+ data = service.compute_pool_edit(options).body
pool = collection.from_data(data)
end
@@ -13,12 +13,12 @@ class ComputePools < Fog::Ecloud::Collection
def all
check_href!(:message => "the Compute Pool href of the Environment you want to enumerate")
- data = connection.get_compute_pools(href).body[:ComputePool]
+ data = service.get_compute_pools(href).body[:ComputePool]
load(data)
end
def get(uri)
- if data = connection.get_compute_pool(uri)
+ if data = service.get_compute_pool(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
@@ -10,12 +10,12 @@ class CpuUsageDetailSummary < Fog::Ecloud::Collection
model Fog::Compute::Ecloud::CpuUsageDetail
def all
- data = connection.get_cpu_usage_detail_summary(href).body[:CpuUsageDetailSummary][:CpuUsageDetail]
+ data = service.get_cpu_usage_detail_summary(href).body[:CpuUsageDetailSummary][:CpuUsageDetail]
load(data)
end
def get(uri)
- if data = connection.get_cpu_usage_detail(uri)
+ if data = service.get_cpu_usage_detail(uri)
new(data.body)
end
rescue Fog::Errors::NotFound
Oops, something went wrong.

0 comments on commit c9356ef

Please sign in to comment.