From 063678f840c249b116e4d1f46c7d43bc30f07f1e Mon Sep 17 00:00:00 2001 From: Rodrigo Estebanez Date: Tue, 27 Aug 2013 11:19:54 +0200 Subject: [PATCH] Rename Vcloudng to VcloudDirector --- lib/fog.rb | 2 +- lib/fog/compute.rb | 6 +- lib/fog/{vcloudng.rb => vcloud_director.rb} | 2 +- .../{vcloudng => vcloud_director}/compute.rb | 35 +++--- .../documentation.md | 104 +++++++++--------- .../generators/compute/customization.rb | 2 +- .../generators/compute/disks.rb | 2 +- .../generators/compute/metadata.rb | 2 +- .../generators/compute/vm_network.rb | 2 +- .../models/compute/catalog.rb | 2 +- .../models/compute/catalog_item.rb | 2 +- .../models/compute/catalog_items.rb | 6 +- .../models/compute/catalogs.rb | 8 +- .../models/compute/disk.rb | 8 +- .../models/compute/disks.rb | 8 +- .../models/compute/network.rb | 2 +- .../models/compute/networks.rb | 6 +- .../models/compute/organization.rb | 2 +- .../models/compute/organizations.rb | 6 +- .../models/compute/tag.rb | 4 +- .../models/compute/tags.rb | 21 +--- .../models/compute/task.rb | 2 +- .../models/compute/tasks.rb | 8 +- .../models/compute/vapp.rb | 2 +- .../models/compute/vapps.rb | 6 +- .../models/compute/vdc.rb | 2 +- .../models/compute/vdcs.rb | 6 +- .../models/compute/vm.rb | 4 +- .../models/compute/vm_customization.rb | 4 +- .../models/compute/vm_customizations.rb | 17 +++ .../models/compute/vm_network.rb | 4 +- .../models/compute/vm_networks.rb | 8 +- .../models/compute/vms.rb | 6 +- .../parsers/compute/disks.rb | 4 +- .../parsers/compute/metadata.rb | 4 +- .../parsers/compute/network.rb | 4 +- .../parsers/compute/vm.rb | 4 +- .../parsers/compute/vm_customization.rb | 4 +- .../parsers/compute/vm_network.rb | 4 +- .../requests/compute/delete_metadata.rb | 4 +- .../requests/compute/get_catalog.rb | 2 +- .../requests/compute/get_catalog_item.rb | 2 +- .../requests/compute/get_href.rb | 2 +- .../requests/compute/get_metadata.rb | 6 +- .../requests/compute/get_network.rb | 6 +- .../requests/compute/get_organization.rb | 2 +- .../requests/compute/get_organizations.rb | 2 +- .../requests/compute/get_request.rb | 2 +- .../requests/compute/get_task.rb | 2 +- .../requests/compute/get_tasks_list.rb | 2 +- .../requests/compute/get_vapp.rb | 2 +- .../requests/compute/get_vapp_template.rb | 2 +- .../requests/compute/get_vdc.rb | 2 +- .../requests/compute/get_vm_cpu.rb | 2 +- .../requests/compute/get_vm_customization.rb | 6 +- .../requests/compute/get_vm_disks.rb | 6 +- .../requests/compute/get_vm_memory.rb | 2 +- .../requests/compute/get_vm_network.rb | 6 +- .../requests/compute/get_vms.rb | 6 +- .../requests/compute/helper.rb | 0 .../compute/instantiate_vapp_template.rb | 2 +- .../requests/compute/post_vm_metadata.rb | 6 +- .../requests/compute/post_vm_poweron.rb | 2 +- .../requests/compute/put_metadata_value.rb | 2 +- .../requests/compute/put_vm_cpu.rb | 2 +- .../requests/compute/put_vm_customization.rb | 6 +- .../requests/compute/put_vm_disks.rb | 6 +- .../requests/compute/put_vm_memory.rb | 2 +- .../requests/compute/put_vm_network.rb | 6 +- .../models/compute/vm_customizations.rb | 17 --- .../models/compute/catalog_items_test.rb | 12 +- .../models/compute/catalogs_test.rb | 12 +- .../models/compute/helper.rb | 14 +-- .../models/compute/organizations_tests.rb | 8 +- .../models/compute/vapp_life_cycle_tests.rb | 20 ++-- .../models/compute/vapp_tests.rb | 12 +- .../models/compute/vdcs_test.rb | 12 +- .../models/compute/vms_tests.rb | 26 ++--- .../models/tools/reduced_vcr_requests.rb | 0 .../vcr_cassettes/catalog_items_test_rb.yml | 0 .../vcr_cassettes/catalogs_test_rb.yml | 0 .../vcr_cassettes/organizations_tests_rb.yml | 0 .../vapp_life_cycle_tests_rb.yml | 0 .../vcr_cassettes/vapp_tests_rb.yml | 0 .../vcr_cassettes/vdcs_test_rb.yml | 0 .../vcr_cassettes/vms_tests_rb.yml | 0 86 files changed, 274 insertions(+), 284 deletions(-) rename lib/fog/{vcloudng.rb => vcloud_director.rb} (56%) rename lib/fog/{vcloudng => vcloud_director}/compute.rb (90%) rename lib/fog/{vcloudng => vcloud_director}/documentation.md (90%) rename lib/fog/{vcloudng => vcloud_director}/generators/compute/customization.rb (99%) rename lib/fog/{vcloudng => vcloud_director}/generators/compute/disks.rb (99%) rename lib/fog/{vcloudng => vcloud_director}/generators/compute/metadata.rb (98%) rename lib/fog/{vcloudng => vcloud_director}/generators/compute/vm_network.rb (99%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/catalog.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/catalog_item.rb (95%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/catalog_items.rb (85%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/catalogs.rb (83%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/disk.rb (84%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/disks.rb (88%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/network.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/networks.rb (83%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/organization.rb (95%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/organizations.rb (79%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/tag.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/tags.rb (63%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/task.rb (97%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/tasks.rb (68%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vapp.rb (97%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vapps.rb (85%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vdc.rb (97%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vdcs.rb (85%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vm.rb (95%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vm_customization.rb (93%) create mode 100644 lib/fog/vcloud_director/models/compute/vm_customizations.rb rename lib/fog/{vcloudng => vcloud_director}/models/compute/vm_network.rb (91%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vm_networks.rb (57%) rename lib/fog/{vcloudng => vcloud_director}/models/compute/vms.rb (79%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/disks.rb (95%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/metadata.rb (97%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/network.rb (98%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/vm.rb (97%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/vm_customization.rb (95%) rename lib/fog/{vcloudng => vcloud_director}/parsers/compute/vm_network.rb (98%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/delete_metadata.rb (83%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_catalog.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_catalog_item.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_href.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_metadata.rb (68%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_network.rb (67%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_organization.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_organizations.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_request.rb (92%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_task.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_tasks_list.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vapp.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vapp_template.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vdc.rb (93%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vm_cpu.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vm_customization.rb (67%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vm_disks.rb (70%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vm_memory.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vm_network.rb (68%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/get_vms.rb (68%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/helper.rb (100%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/instantiate_vapp_template.rb (99%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/post_vm_metadata.rb (77%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/post_vm_poweron.rb (94%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_metadata_value.rb (96%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_vm_cpu.rb (98%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_vm_customization.rb (76%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_vm_disks.rb (79%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_vm_memory.rb (98%) rename lib/fog/{vcloudng => vcloud_director}/requests/compute/put_vm_network.rb (77%) delete mode 100644 lib/fog/vcloudng/models/compute/vm_customizations.rb rename tests/{vcloudng => vcloud_director}/models/compute/catalog_items_test.rb (78%) rename tests/{vcloudng => vcloud_director}/models/compute/catalogs_test.rb (78%) rename tests/{vcloudng => vcloud_director}/models/compute/helper.rb (71%) rename tests/{vcloudng => vcloud_director}/models/compute/organizations_tests.rb (70%) rename tests/{vcloudng => vcloud_director}/models/compute/vapp_life_cycle_tests.rb (84%) rename tests/{vcloudng => vcloud_director}/models/compute/vapp_tests.rb (78%) rename tests/{vcloudng => vcloud_director}/models/compute/vdcs_test.rb (78%) rename tests/{vcloudng => vcloud_director}/models/compute/vms_tests.rb (80%) rename tests/{vcloudng => vcloud_director}/models/tools/reduced_vcr_requests.rb (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/catalog_items_test_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/catalogs_test_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/organizations_tests_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/vapp_life_cycle_tests_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/vapp_tests_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/vdcs_test_rb.yml (100%) rename tests/{vcloudng => vcloud_director}/vcr_cassettes/vms_tests_rb.yml (100%) diff --git a/lib/fog.rb b/lib/fog.rb index 99ee9e5cf..55df15726 100644 --- a/lib/fog.rb +++ b/lib/fog.rb @@ -37,7 +37,7 @@ require 'fog/serverlove' require 'fog/storm_on_demand' require 'fog/terremark' require 'fog/vcloud' -require 'fog/vcloudng' +require 'fog/vcloud_director' require 'fog/vmfusion' require 'fog/vsphere' require 'fog/voxel' diff --git a/lib/fog/compute.rb b/lib/fog/compute.rb index 43f9513e3..47ed95328 100644 --- a/lib/fog/compute.rb +++ b/lib/fog/compute.rb @@ -38,9 +38,9 @@ module Fog when :vcloud require 'fog/vcloud/compute' Fog::Vcloud::Compute.new(attributes) - when :vcloudng - require 'fog/vcloudng/compute' - Fog::Vcloudng::Compute.new(attributes) + when :vcloud_director + require 'fog/vcloud_director/compute' + Fog::VcloudDirector::Compute.new(attributes) else if self.providers.include?(provider) require "fog/#{provider}/compute" diff --git a/lib/fog/vcloudng.rb b/lib/fog/vcloud_director.rb similarity index 56% rename from lib/fog/vcloudng.rb rename to lib/fog/vcloud_director.rb index c7ae7f0e3..4103df079 100644 --- a/lib/fog/vcloudng.rb +++ b/lib/fog/vcloud_director.rb @@ -5,7 +5,7 @@ module Fog extend Fog::Provider - service(:compute, 'vcloudng/compute', 'Compute') + service(:compute, 'vcloud_director/compute', 'Compute') end end \ No newline at end of file diff --git a/lib/fog/vcloudng/compute.rb b/lib/fog/vcloud_director/compute.rb similarity index 90% rename from lib/fog/vcloudng/compute.rb rename to lib/fog/vcloud_director/compute.rb index aebf28cd9..4afa8fc8c 100644 --- a/lib/fog/vcloudng/compute.rb +++ b/lib/fog/vcloud_director/compute.rb @@ -1,8 +1,8 @@ -require 'fog/vcloudng' +require 'fog/vcloud_director' require 'fog/compute' -require 'fog/vcloudng/requests/compute/helper' +require 'fog/vcloud_director/requests/compute/helper' -class VcloudngParser < Fog::Parsers::Base +class VcloudDirectorParser < Fog::Parsers::Base def extract_attributes(attributes_xml) attributes = {} @@ -28,7 +28,7 @@ end module Fog module Compute - class Vcloudng < Fog::Service + class VcloudDirector < Fog::Service module Defaults PATH = '/api' @@ -42,15 +42,15 @@ module Fog end - requires :vcloudng_username, :vcloudng_password, :vcloudng_host + requires :vcloud_director_username, :vcloud_director_password, :vcloud_director_host - secrets :vcloudng_password + secrets :vcloud_director_password - model_path 'fog/vcloudng/models/compute' - model :organization - collection :organizations + model_path 'fog/vcloud_director/models/compute' model :catalog collection :catalogs + model :organization + collection :organizations model :catalog_item collection :catalog_items model :vdc @@ -71,8 +71,9 @@ module Fog collection :vm_networks model :tag # this is called metadata in vcloud collection :tags + - request_path 'fog/vcloudng/requests/compute' + request_path 'fog/vcloud_director/requests/compute' request :get_organizations request :get_organization request :get_catalog @@ -176,14 +177,14 @@ module Fog attr_reader :end_point def initialize(options={}) - @vcloudng_password = options[:vcloudng_password] - @vcloudng_username = options[:vcloudng_username] + @vcloud_director_password = options[:vcloud_director_password] + @vcloud_director_username = options[:vcloud_director_username] @connection_options = options[:connection_options] || {} - @host = options[:vcloudng_host] - @path = options[:path] || Fog::Compute::Vcloudng::Defaults::PATH + @host = options[:vcloud_director_host] + @path = options[:path] || Fog::Compute::VcloudDirector::Defaults::PATH @persistent = options[:persistent] || false - @port = options[:port] || Fog::Compute::Vcloudng::Defaults::PORT - @scheme = options[:scheme] || Fog::Compute::Vcloudng::Defaults::SCHEME + @port = options[:port] || Fog::Compute::VcloudDirector::Defaults::PORT + @scheme = options[:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @end_point = "#{@scheme}://#{@host}#{@path}/" end @@ -191,7 +192,7 @@ module Fog def auth_token response = @connection.request({ :expects => 200, - :headers => { 'Authorization' => "Basic #{Base64.encode64("#{@vcloudng_username}:#{@vcloudng_password}").delete("\r\n")}", + :headers => { 'Authorization' => "Basic #{Base64.encode64("#{@vcloud_director_username}:#{@vcloud_director_password}").delete("\r\n")}", 'Accept' => 'application/*+xml;version=1.5' }, :host => @host, diff --git a/lib/fog/vcloudng/documentation.md b/lib/fog/vcloud_director/documentation.md similarity index 90% rename from lib/fog/vcloudng/documentation.md rename to lib/fog/vcloud_director/documentation.md index 3f518a348..66324682c 100644 --- a/lib/fog/vcloudng/documentation.md +++ b/lib/fog/vcloud_director/documentation.md @@ -2,7 +2,7 @@ ### Introduction -Collection and Model representation in vcloudng fog provider +Collection and Model representation in vcloud_director fog provider ``` Organizations @@ -52,7 +52,7 @@ Lazy load isn't used with ```get``` and ```get_by_name``` methods are used ```ruby -vcloud = Fog::Compute::Vcloudng.new(vcloudng_username: "@org_name_", vcloudng_password: "", vcloudng_host: 'example.com', :connection_options => {:ssl_verify_peer => false, :connect_timeout => 200, :read_timeout => 200 } ) +vcloud = Fog::Compute::VcloudDirector.new(vcloud_director_username: "@org_name_", vcloud_director_password: "", vcloud_director_host: 'example.com', :connection_options => {:ssl_verify_peer => false, :connect_timeout => 200, :read_timeout => 200 } ) ``` ### Organizations @@ -66,9 +66,9 @@ Note that when listing, by default all the attrs but **id, name, type** and **hr vcloud.organizations ``` ``` - [ - [ - , - [ - 163840}] > [ - , - , - > vm.disks - 163840}] > [ - , - , - , - 163840}] > [ - , - , - , - @@ -738,7 +738,7 @@ vm = vapp.vms.get_by_name("DEVWEB") vm.tags.get_by_name('this_is_a_key') ``` ```ruby - @@ -784,8 +784,8 @@ org = vcloud.organizations.first org.networks ``` ```ruby - [ - [ - , - [ - , - , - {} } diff --git a/lib/fog/vcloudng/parsers/compute/network.rb b/lib/fog/vcloud_director/parsers/compute/network.rb similarity index 98% rename from lib/fog/vcloudng/parsers/compute/network.rb rename to lib/fog/vcloud_director/parsers/compute/network.rb index a4cbca703..e1e9af3c6 100644 --- a/lib/fog/vcloudng/parsers/compute/network.rb +++ b/lib/fog/vcloud_director/parsers/compute/network.rb @@ -61,9 +61,9 @@ module Fog module Parsers module Compute - module Vcloudng + module VcloudDirector - class Network < VcloudngParser + class Network < VcloudDirectorParser def reset @response = { :ip_ranges => [] } diff --git a/lib/fog/vcloudng/parsers/compute/vm.rb b/lib/fog/vcloud_director/parsers/compute/vm.rb similarity index 97% rename from lib/fog/vcloudng/parsers/compute/vm.rb rename to lib/fog/vcloud_director/parsers/compute/vm.rb index 805cedba2..095a3c9ee 100644 --- a/lib/fog/vcloudng/parsers/compute/vm.rb +++ b/lib/fog/vcloud_director/parsers/compute/vm.rb @@ -1,11 +1,11 @@ module Fog module Parsers module Compute - module Vcloudng + module VcloudDirector - class Vm < VcloudngParser + class Vm < VcloudDirectorParser def reset @vm = { :ip_address => '' } diff --git a/lib/fog/vcloudng/parsers/compute/vm_customization.rb b/lib/fog/vcloud_director/parsers/compute/vm_customization.rb similarity index 95% rename from lib/fog/vcloudng/parsers/compute/vm_customization.rb rename to lib/fog/vcloud_director/parsers/compute/vm_customization.rb index a5c2f07f0..e7ced15ef 100644 --- a/lib/fog/vcloudng/parsers/compute/vm_customization.rb +++ b/lib/fog/vcloud_director/parsers/compute/vm_customization.rb @@ -1,9 +1,9 @@ module Fog module Parsers module Compute - module Vcloudng + module VcloudDirector - class VmCustomization < VcloudngParser + class VmCustomization < VcloudDirectorParser def reset @response = { } diff --git a/lib/fog/vcloudng/parsers/compute/vm_network.rb b/lib/fog/vcloud_director/parsers/compute/vm_network.rb similarity index 98% rename from lib/fog/vcloudng/parsers/compute/vm_network.rb rename to lib/fog/vcloud_director/parsers/compute/vm_network.rb index 5d34feb39..5e68129af 100644 --- a/lib/fog/vcloudng/parsers/compute/vm_network.rb +++ b/lib/fog/vcloud_director/parsers/compute/vm_network.rb @@ -61,9 +61,9 @@ module Fog module Parsers module Compute - module Vcloudng + module VcloudDirector - class VmNetwork < VcloudngParser + class VmNetwork < VcloudDirectorParser def reset @response = { } diff --git a/lib/fog/vcloudng/requests/compute/delete_metadata.rb b/lib/fog/vcloud_director/requests/compute/delete_metadata.rb similarity index 83% rename from lib/fog/vcloudng/requests/compute/delete_metadata.rb rename to lib/fog/vcloud_director/requests/compute/delete_metadata.rb index 8e25f01c3..9dde8f3df 100644 --- a/lib/fog/vcloudng/requests/compute/delete_metadata.rb +++ b/lib/fog/vcloud_director/requests/compute/delete_metadata.rb @@ -1,10 +1,10 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def delete_metadata(vm_id, metadata_key) - require 'fog/vcloudng/parsers/compute/metadata' + require 'fog/vcloud_director/parsers/compute/metadata' request( :expects => 202, diff --git a/lib/fog/vcloudng/requests/compute/get_catalog.rb b/lib/fog/vcloud_director/requests/compute/get_catalog.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_catalog.rb rename to lib/fog/vcloud_director/requests/compute/get_catalog.rb index ef58a9dcb..49102c315 100644 --- a/lib/fog/vcloudng/requests/compute/get_catalog.rb +++ b/lib/fog/vcloud_director/requests/compute/get_catalog.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_catalog(catalog_uuid) diff --git a/lib/fog/vcloudng/requests/compute/get_catalog_item.rb b/lib/fog/vcloud_director/requests/compute/get_catalog_item.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_catalog_item.rb rename to lib/fog/vcloud_director/requests/compute/get_catalog_item.rb index dfc1c7f2f..806f9f4e0 100644 --- a/lib/fog/vcloudng/requests/compute/get_catalog_item.rb +++ b/lib/fog/vcloud_director/requests/compute/get_catalog_item.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_catalog_item(catalog_item_id) diff --git a/lib/fog/vcloudng/requests/compute/get_href.rb b/lib/fog/vcloud_director/requests/compute/get_href.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_href.rb rename to lib/fog/vcloud_director/requests/compute/get_href.rb index 681e6d1b8..36b99919c 100644 --- a/lib/fog/vcloudng/requests/compute/get_href.rb +++ b/lib/fog/vcloud_director/requests/compute/get_href.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_href(href) diff --git a/lib/fog/vcloudng/requests/compute/get_metadata.rb b/lib/fog/vcloud_director/requests/compute/get_metadata.rb similarity index 68% rename from lib/fog/vcloudng/requests/compute/get_metadata.rb rename to lib/fog/vcloud_director/requests/compute/get_metadata.rb index bb9bde2af..a50949e2d 100644 --- a/lib/fog/vcloudng/requests/compute/get_metadata.rb +++ b/lib/fog/vcloud_director/requests/compute/get_metadata.rb @@ -1,16 +1,16 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_metadata(vm_id) - require 'fog/vcloudng/parsers/compute/metadata' + require 'fog/vcloud_director/parsers/compute/metadata' request( :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::Metadata.new, + :parser => Fog::Parsers::Compute::VcloudDirector::Metadata.new, :path => "vApp/#{vm_id}/metadata/" ) end diff --git a/lib/fog/vcloudng/requests/compute/get_network.rb b/lib/fog/vcloud_director/requests/compute/get_network.rb similarity index 67% rename from lib/fog/vcloudng/requests/compute/get_network.rb rename to lib/fog/vcloud_director/requests/compute/get_network.rb index 45915c0e0..d95e02c14 100644 --- a/lib/fog/vcloudng/requests/compute/get_network.rb +++ b/lib/fog/vcloud_director/requests/compute/get_network.rb @@ -1,15 +1,15 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/parsers/compute/network' + require 'fog/vcloud_director/parsers/compute/network' def get_network(network_id) request( :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::Network.new, + :parser => Fog::Parsers::Compute::VcloudDirector::Network.new, :path => "network/#{network_id}" ) end diff --git a/lib/fog/vcloudng/requests/compute/get_organization.rb b/lib/fog/vcloud_director/requests/compute/get_organization.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_organization.rb rename to lib/fog/vcloud_director/requests/compute/get_organization.rb index 0ce88e836..de709d582 100644 --- a/lib/fog/vcloudng/requests/compute/get_organization.rb +++ b/lib/fog/vcloud_director/requests/compute/get_organization.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_organization(organization_id) diff --git a/lib/fog/vcloudng/requests/compute/get_organizations.rb b/lib/fog/vcloud_director/requests/compute/get_organizations.rb similarity index 93% rename from lib/fog/vcloudng/requests/compute/get_organizations.rb rename to lib/fog/vcloud_director/requests/compute/get_organizations.rb index 9be76f750..0163bdbc0 100644 --- a/lib/fog/vcloudng/requests/compute/get_organizations.rb +++ b/lib/fog/vcloud_director/requests/compute/get_organizations.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real diff --git a/lib/fog/vcloudng/requests/compute/get_request.rb b/lib/fog/vcloud_director/requests/compute/get_request.rb similarity index 92% rename from lib/fog/vcloudng/requests/compute/get_request.rb rename to lib/fog/vcloud_director/requests/compute/get_request.rb index f5991ae8f..2600c219b 100644 --- a/lib/fog/vcloudng/requests/compute/get_request.rb +++ b/lib/fog/vcloud_director/requests/compute/get_request.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_request(uri) diff --git a/lib/fog/vcloudng/requests/compute/get_task.rb b/lib/fog/vcloud_director/requests/compute/get_task.rb similarity index 93% rename from lib/fog/vcloudng/requests/compute/get_task.rb rename to lib/fog/vcloud_director/requests/compute/get_task.rb index 607af8a6f..ac3671539 100644 --- a/lib/fog/vcloudng/requests/compute/get_task.rb +++ b/lib/fog/vcloud_director/requests/compute/get_task.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_task(task_id) diff --git a/lib/fog/vcloudng/requests/compute/get_tasks_list.rb b/lib/fog/vcloud_director/requests/compute/get_tasks_list.rb similarity index 93% rename from lib/fog/vcloudng/requests/compute/get_tasks_list.rb rename to lib/fog/vcloud_director/requests/compute/get_tasks_list.rb index bfd1ddb42..3a07b7932 100644 --- a/lib/fog/vcloudng/requests/compute/get_tasks_list.rb +++ b/lib/fog/vcloud_director/requests/compute/get_tasks_list.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_tasks_list(tasks_list_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vapp.rb b/lib/fog/vcloud_director/requests/compute/get_vapp.rb similarity index 93% rename from lib/fog/vcloudng/requests/compute/get_vapp.rb rename to lib/fog/vcloud_director/requests/compute/get_vapp.rb index 128baf665..06da372b8 100644 --- a/lib/fog/vcloudng/requests/compute/get_vapp.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vapp.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vapp(vapp_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vapp_template.rb b/lib/fog/vcloud_director/requests/compute/get_vapp_template.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_vapp_template.rb rename to lib/fog/vcloud_director/requests/compute/get_vapp_template.rb index 92712ce2c..0a8f2c0e7 100644 --- a/lib/fog/vcloudng/requests/compute/get_vapp_template.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vapp_template.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vapp_template(vapp_template_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vdc.rb b/lib/fog/vcloud_director/requests/compute/get_vdc.rb similarity index 93% rename from lib/fog/vcloudng/requests/compute/get_vdc.rb rename to lib/fog/vcloud_director/requests/compute/get_vdc.rb index 31c5417eb..096c41db2 100644 --- a/lib/fog/vcloudng/requests/compute/get_vdc.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vdc.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vdc(vdc_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vm_cpu.rb b/lib/fog/vcloud_director/requests/compute/get_vm_cpu.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_vm_cpu.rb rename to lib/fog/vcloud_director/requests/compute/get_vm_cpu.rb index 9913824ee..a77119670 100644 --- a/lib/fog/vcloudng/requests/compute/get_vm_cpu.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vm_cpu.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vm_cpu(vm_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vm_customization.rb b/lib/fog/vcloud_director/requests/compute/get_vm_customization.rb similarity index 67% rename from lib/fog/vcloudng/requests/compute/get_vm_customization.rb rename to lib/fog/vcloud_director/requests/compute/get_vm_customization.rb index ab6888f77..e3e767037 100644 --- a/lib/fog/vcloudng/requests/compute/get_vm_customization.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vm_customization.rb @@ -1,15 +1,15 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/parsers/compute/vm_customization' + require 'fog/vcloud_director/parsers/compute/vm_customization' def get_vm_customization(vm_id) request( :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::VmCustomization.new, + :parser => Fog::Parsers::Compute::VcloudDirector::VmCustomization.new, :path => "vApp/#{vm_id}/guestCustomizationSection" ) end diff --git a/lib/fog/vcloudng/requests/compute/get_vm_disks.rb b/lib/fog/vcloud_director/requests/compute/get_vm_disks.rb similarity index 70% rename from lib/fog/vcloudng/requests/compute/get_vm_disks.rb rename to lib/fog/vcloud_director/requests/compute/get_vm_disks.rb index f66e2c1cd..51891cd5b 100644 --- a/lib/fog/vcloudng/requests/compute/get_vm_disks.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vm_disks.rb @@ -1,8 +1,8 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/parsers/compute/disks' + require 'fog/vcloud_director/parsers/compute/disks' def get_vm_disks(vm_id) @@ -10,7 +10,7 @@ module Fog :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::Disks.new, + :parser => Fog::Parsers::Compute::VcloudDirector::Disks.new, :path => "vApp/#{vm_id}/virtualHardwareSection/disks" ) end diff --git a/lib/fog/vcloudng/requests/compute/get_vm_memory.rb b/lib/fog/vcloud_director/requests/compute/get_vm_memory.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/get_vm_memory.rb rename to lib/fog/vcloud_director/requests/compute/get_vm_memory.rb index d5a753f95..99dd33df4 100644 --- a/lib/fog/vcloudng/requests/compute/get_vm_memory.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vm_memory.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vm_memory(vm_id) diff --git a/lib/fog/vcloudng/requests/compute/get_vm_network.rb b/lib/fog/vcloud_director/requests/compute/get_vm_network.rb similarity index 68% rename from lib/fog/vcloudng/requests/compute/get_vm_network.rb rename to lib/fog/vcloud_director/requests/compute/get_vm_network.rb index b51152ea5..d2474d98e 100644 --- a/lib/fog/vcloudng/requests/compute/get_vm_network.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vm_network.rb @@ -1,16 +1,16 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def get_vm_network(vm_id) - require 'fog/vcloudng/parsers/compute/vm_network' + require 'fog/vcloud_director/parsers/compute/vm_network' request( :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::VmNetwork.new, + :parser => Fog::Parsers::Compute::VcloudDirector::VmNetwork.new, :path => "vApp/#{vm_id}/networkConnectionSection/" ) end diff --git a/lib/fog/vcloudng/requests/compute/get_vms.rb b/lib/fog/vcloud_director/requests/compute/get_vms.rb similarity index 68% rename from lib/fog/vcloudng/requests/compute/get_vms.rb rename to lib/fog/vcloud_director/requests/compute/get_vms.rb index f9454cc27..0335f33ce 100644 --- a/lib/fog/vcloudng/requests/compute/get_vms.rb +++ b/lib/fog/vcloud_director/requests/compute/get_vms.rb @@ -1,15 +1,15 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/parsers/compute/vm' + require 'fog/vcloud_director/parsers/compute/vm' def get_vms(vapp_id) request( :expects => 200, :headers => { 'Accept' => 'application/*+xml;version=1.5' }, :method => 'GET', - :parser => Fog::Parsers::Compute::Vcloudng::Vm.new, + :parser => Fog::Parsers::Compute::VcloudDirector::Vm.new, :path => "vApp/#{vapp_id}" ) end diff --git a/lib/fog/vcloudng/requests/compute/helper.rb b/lib/fog/vcloud_director/requests/compute/helper.rb similarity index 100% rename from lib/fog/vcloudng/requests/compute/helper.rb rename to lib/fog/vcloud_director/requests/compute/helper.rb diff --git a/lib/fog/vcloudng/requests/compute/instantiate_vapp_template.rb b/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb similarity index 99% rename from lib/fog/vcloudng/requests/compute/instantiate_vapp_template.rb rename to lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb index b16fa5663..e5545a495 100644 --- a/lib/fog/vcloudng/requests/compute/instantiate_vapp_template.rb +++ b/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real #TODO move all the logic to a generator diff --git a/lib/fog/vcloudng/requests/compute/post_vm_metadata.rb b/lib/fog/vcloud_director/requests/compute/post_vm_metadata.rb similarity index 77% rename from lib/fog/vcloudng/requests/compute/post_vm_metadata.rb rename to lib/fog/vcloud_director/requests/compute/post_vm_metadata.rb index 35342d0e6..c25e2a6fa 100644 --- a/lib/fog/vcloudng/requests/compute/post_vm_metadata.rb +++ b/lib/fog/vcloud_director/requests/compute/post_vm_metadata.rb @@ -1,13 +1,13 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/generators/compute/metadata' + require 'fog/vcloud_director/generators/compute/metadata' def post_vm_metadata(vm_id, metadata={}) - data = Fog::Generators::Compute::Vcloudng::Metadata.new(metadata) + data = Fog::Generators::Compute::VcloudDirector::Metadata.new(metadata) request( :body => data.generate_xml, diff --git a/lib/fog/vcloudng/requests/compute/post_vm_poweron.rb b/lib/fog/vcloud_director/requests/compute/post_vm_poweron.rb similarity index 94% rename from lib/fog/vcloudng/requests/compute/post_vm_poweron.rb rename to lib/fog/vcloud_director/requests/compute/post_vm_poweron.rb index 1d8d5c7e6..ba0d21447 100644 --- a/lib/fog/vcloudng/requests/compute/post_vm_poweron.rb +++ b/lib/fog/vcloud_director/requests/compute/post_vm_poweron.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def post_vm_poweron(vm_id) diff --git a/lib/fog/vcloudng/requests/compute/put_metadata_value.rb b/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb similarity index 96% rename from lib/fog/vcloudng/requests/compute/put_metadata_value.rb rename to lib/fog/vcloud_director/requests/compute/put_metadata_value.rb index c858b11ea..97c3c4bcc 100644 --- a/lib/fog/vcloudng/requests/compute/put_metadata_value.rb +++ b/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def put_metadata_value(vm_id, metadata_key, metadata_value) diff --git a/lib/fog/vcloudng/requests/compute/put_vm_cpu.rb b/lib/fog/vcloud_director/requests/compute/put_vm_cpu.rb similarity index 98% rename from lib/fog/vcloudng/requests/compute/put_vm_cpu.rb rename to lib/fog/vcloud_director/requests/compute/put_vm_cpu.rb index 211ec53a3..f2fe4cd8f 100644 --- a/lib/fog/vcloudng/requests/compute/put_vm_cpu.rb +++ b/lib/fog/vcloud_director/requests/compute/put_vm_cpu.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def put_vm_cpu(vm_id, num_cpus) diff --git a/lib/fog/vcloudng/requests/compute/put_vm_customization.rb b/lib/fog/vcloud_director/requests/compute/put_vm_customization.rb similarity index 76% rename from lib/fog/vcloudng/requests/compute/put_vm_customization.rb rename to lib/fog/vcloud_director/requests/compute/put_vm_customization.rb index c91f426cb..fb31c5c73 100644 --- a/lib/fog/vcloudng/requests/compute/put_vm_customization.rb +++ b/lib/fog/vcloud_director/requests/compute/put_vm_customization.rb @@ -1,11 +1,11 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/generators/compute/customization' + require 'fog/vcloud_director/generators/compute/customization' def put_vm_customization(vm_id, customization={}) - data = Fog::Generators::Compute::Vcloudng::Customization.new(customization) + data = Fog::Generators::Compute::VcloudDirector::Customization.new(customization) request( :body => data.generate_xml, diff --git a/lib/fog/vcloudng/requests/compute/put_vm_disks.rb b/lib/fog/vcloud_director/requests/compute/put_vm_disks.rb similarity index 79% rename from lib/fog/vcloudng/requests/compute/put_vm_disks.rb rename to lib/fog/vcloud_director/requests/compute/put_vm_disks.rb index c5502b275..c7a7eb9aa 100644 --- a/lib/fog/vcloudng/requests/compute/put_vm_disks.rb +++ b/lib/fog/vcloud_director/requests/compute/put_vm_disks.rb @@ -1,12 +1,12 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real - require 'fog/vcloudng/generators/compute/disks' + require 'fog/vcloud_director/generators/compute/disks' # disks is the body of get_vm_disks def put_vm_disks(vm_id, disks=[]) - data = Fog::Generators::Compute::Vcloudng::Disks.new(disks) + data = Fog::Generators::Compute::VcloudDirector::Disks.new(disks) request( :body => data.generate_xml, diff --git a/lib/fog/vcloudng/requests/compute/put_vm_memory.rb b/lib/fog/vcloud_director/requests/compute/put_vm_memory.rb similarity index 98% rename from lib/fog/vcloudng/requests/compute/put_vm_memory.rb rename to lib/fog/vcloud_director/requests/compute/put_vm_memory.rb index 49fff9b2a..82f059aa1 100644 --- a/lib/fog/vcloudng/requests/compute/put_vm_memory.rb +++ b/lib/fog/vcloud_director/requests/compute/put_vm_memory.rb @@ -1,6 +1,6 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def put_vm_memory(vm_id, memory) diff --git a/lib/fog/vcloudng/requests/compute/put_vm_network.rb b/lib/fog/vcloud_director/requests/compute/put_vm_network.rb similarity index 77% rename from lib/fog/vcloudng/requests/compute/put_vm_network.rb rename to lib/fog/vcloud_director/requests/compute/put_vm_network.rb index 1d79b6d9c..b7e0c68df 100644 --- a/lib/fog/vcloudng/requests/compute/put_vm_network.rb +++ b/lib/fog/vcloud_director/requests/compute/put_vm_network.rb @@ -1,12 +1,12 @@ module Fog module Compute - class Vcloudng + class VcloudDirector class Real def put_vm_network(vm_id, network={}) - require 'fog/vcloudng/generators/compute/vm_network' + require 'fog/vcloud_director/generators/compute/vm_network' - data = Fog::Generators::Compute::Vcloudng::VmNetwork.new(network) + data = Fog::Generators::Compute::VcloudDirector::VmNetwork.new(network) request( :body => data.generate_xml, diff --git a/lib/fog/vcloudng/models/compute/vm_customizations.rb b/lib/fog/vcloudng/models/compute/vm_customizations.rb deleted file mode 100644 index 456116b22..000000000 --- a/lib/fog/vcloudng/models/compute/vm_customizations.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'fog/core/collection' -require 'fog/vcloudng/models/compute/vm_customization' - -module Fog - module Compute - class Vcloudng - - class VmCustomizations < Fog::Collection - model Fog::Compute::Vcloudng::VmCustomization - - attribute :vm - - - end - end - end -end \ No newline at end of file diff --git a/tests/vcloudng/models/compute/catalog_items_test.rb b/tests/vcloud_director/models/compute/catalog_items_test.rb similarity index 78% rename from tests/vcloudng/models/compute/catalog_items_test.rb rename to tests/vcloud_director/models/compute/catalog_items_test.rb index d4aa8db08..19de1492f 100644 --- a/tests/vcloudng/models/compute/catalog_items_test.rb +++ b/tests/vcloud_director/models/compute/catalog_items_test.rb @@ -2,39 +2,39 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | catalog_items", ['all']) do + Shindo.tests("Compute::VcloudDirector | catalog_items", ['all']) do pending if Fog.mocking? tests("#There is more than one catalog").returns(true){ catalog.catalog_items.size >= 1 } catalog_items = catalog.catalog_items catalog_item = catalog_items.first - tests("Compute::Vcloudng | catalog_item") do + tests("Compute::VcloudDirector | catalog_item") do tests("#id").returns(String){ catalog_item.id.class } tests("#name").returns(String){ catalog_item.name.class } tests("#href").returns(String){ catalog_item.href.class } tests("#type").returns("application/vnd.vmware.vcloud.catalogItem+xml"){ catalog_item.type } end - tests("Compute::Vcloudng | catalog_item", ['lazy load attrs']) do + tests("Compute::VcloudDirector | catalog_item", ['lazy load attrs']) do catalog_item.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { catalog_item.attributes[lazy_attr] } end end - tests("Compute::Vcloudng | catalog_item", ['load on demand']) do + tests("Compute::VcloudDirector | catalog_item", ['load on demand']) do tests("#description is not loaded yet").returns(NonLoaded) { catalog_item.attributes[:description] } tests("#description is loaded on demand").returns(String) { catalog_item.description.class } tests("#description is now loaded").returns(true) { catalog_item.attributes[:description] != NonLoaded } end - tests("Compute::Vcloudng | catalog_item", ['lazy load attrs']) do + tests("Compute::VcloudDirector | catalog_item", ['lazy load attrs']) do catalog.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is now loaded").returns(true) { catalog_item.attributes[lazy_attr] != NonLoaded } end end - tests("Compute::Vcloudng | catalog_item", ['get']) do + tests("Compute::VcloudDirector | catalog_item", ['get']) do tests("#get_by_name").returns(catalog_item.name) { catalog_items.get_by_name(catalog_item.name).name } tests("#get").returns(catalog_item.id) { catalog_items.get(catalog_item.id).id } end diff --git a/tests/vcloudng/models/compute/catalogs_test.rb b/tests/vcloud_director/models/compute/catalogs_test.rb similarity index 78% rename from tests/vcloudng/models/compute/catalogs_test.rb rename to tests/vcloud_director/models/compute/catalogs_test.rb index e4f5c62e8..e8397d1a2 100644 --- a/tests/vcloudng/models/compute/catalogs_test.rb +++ b/tests/vcloud_director/models/compute/catalogs_test.rb @@ -2,39 +2,39 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | catalogs", ['all']) do + Shindo.tests("Compute::VcloudDirector | catalogs", ['all']) do pending if Fog.mocking? tests("#There is one or more catalog").returns(true){ organization.catalogs.size >= 1 } catalogs = organization.catalogs catalog = catalogs.first - tests("Compute::Vcloudng | catalog") do + tests("Compute::VcloudDirector | catalog") do tests("#id").returns(String){ catalog.id.class } tests("#name").returns(String){ catalog.name.class } tests("#href").returns(String){ catalog.href.class } tests("#type").returns("application/vnd.vmware.vcloud.catalog+xml"){ catalog.type } end - tests("Compute::Vcloudng | catalog", ['lazy load attrs']) do + tests("Compute::VcloudDirector | catalog", ['lazy load attrs']) do catalog.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { catalog.attributes[lazy_attr] } end end - tests("Compute::Vcloudng | catalog", ['load on demand']) do + tests("Compute::VcloudDirector | catalog", ['load on demand']) do tests("#description is not loaded yet").returns(NonLoaded) { catalog.attributes[:description] } tests("#description is loaded on demand").returns(String) { catalog.description.class } tests("#description is now loaded").returns(true) { catalog.attributes[:description] != NonLoaded } end - tests("Compute::Vcloudng | catalog", ['lazy load attrs']) do + tests("Compute::VcloudDirector | catalog", ['lazy load attrs']) do catalog.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is now loaded").returns(true) { catalog.attributes[lazy_attr] != NonLoaded } end end - tests("Compute::Vcloudng | catalog", ['get']) do + tests("Compute::VcloudDirector | catalog", ['get']) do tests("#get_by_name").returns(catalog.name) { catalogs.get_by_name(catalog.name).name } tests("#get").returns(catalog.id) { catalogs.get(catalog.id).id } end diff --git a/tests/vcloudng/models/compute/helper.rb b/tests/vcloud_director/models/compute/helper.rb similarity index 71% rename from tests/vcloudng/models/compute/helper.rb rename to tests/vcloud_director/models/compute/helper.rb index 1411b55e4..8760f197a 100644 --- a/tests/vcloudng/models/compute/helper.rb +++ b/tests/vcloud_director/models/compute/helper.rb @@ -1,8 +1,8 @@ require 'vcr' -require 'fog/vcloudng/compute' +require 'fog/vcloud_director/compute' VCR.configure do |c| - c.cassette_library_dir = 'tests/vcloudng/vcr_cassettes' + c.cassette_library_dir = 'tests/vcloud_director/vcr_cassettes' c.hook_into :webmock end @@ -10,10 +10,10 @@ def boolean?(item) [TrueClass, FalseClass].include?(item.class) end -def vcloudng - @vcloudng ||= Fog::Compute::Vcloudng.new(:vcloudng_username => "#{ENV['IMEDIDATA_COM_USERNAME']}@devops", - :vcloudng_password => ENV['IMEDIDATA_COM_PASSWORD'], - :vcloudng_host => 'devlab.mdsol.com', +def vcloud_director + @vcloud_director ||= Fog::Compute::VcloudDirector.new(:vcloud_director_username => "#{ENV['IMEDIDATA_COM_USERNAME']}@devops", + :vcloud_director_password => ENV['IMEDIDATA_COM_PASSWORD'], + :vcloud_director_host => 'devlab.mdsol.com', :connection_options => { :ssl_verify_peer => false, :connect_timeout => 200, @@ -23,7 +23,7 @@ def vcloudng end def organizations - @organizations ||= vcloudng.organizations + @organizations ||= vcloud_director.organizations end def organization diff --git a/tests/vcloudng/models/compute/organizations_tests.rb b/tests/vcloud_director/models/compute/organizations_tests.rb similarity index 70% rename from tests/vcloudng/models/compute/organizations_tests.rb rename to tests/vcloud_director/models/compute/organizations_tests.rb index b5d1b9e38..dff0b42eb 100644 --- a/tests/vcloudng/models/compute/organizations_tests.rb +++ b/tests/vcloud_director/models/compute/organizations_tests.rb @@ -2,19 +2,19 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | organizations", ['all']) do + Shindo.tests("Compute::VcloudDirector | organizations", ['all']) do pending if Fog.mocking? - organizations = vcloudng.organizations + organizations = vcloud_director.organizations tests("#There is one organization").returns(1){ organizations.size } org = organizations.first - tests("Compute::Vcloudng | organization") do + tests("Compute::VcloudDirector | organization") do tests("#name").returns("DevOps"){ org.name } tests("#type").returns("application/vnd.vmware.vcloud.org+xml"){ org.type } end - tests("Compute::Vcloudng | organization", ['get']) do + tests("Compute::VcloudDirector | organization", ['get']) do tests("#get_by_name").returns(org.name) { organizations.get_by_name(org.name).name } tests("#get").returns(org.id) { organizations.get(org.id).id } end diff --git a/tests/vcloudng/models/compute/vapp_life_cycle_tests.rb b/tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb similarity index 84% rename from tests/vcloudng/models/compute/vapp_life_cycle_tests.rb rename to tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb index 6b1a1ab8a..13839246e 100644 --- a/tests/vcloudng/models/compute/vapp_life_cycle_tests.rb +++ b/tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb @@ -11,15 +11,15 @@ TAGS = { :company => "acme", :environment => "testing" } VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | vapp", ['creation']) do + Shindo.tests("Compute::VcloudDirector | vapp", ['creation']) do pending if Fog.mocking? tests("#it creates a vApp from a catalog item").returns(true){ the_catalog_item.instantiate(VAPP_NAME, { :network_id => the_network.id, :network_name => NETWORK_NAME}) } vapp = vapps.get_by_name(VAPP_NAME) tests("#Finds the just created vApp").returns(VAPP_NAME) { vapp.name } tests("#it has one vm").returns(1) { vapp.vms.size} - tests("Compute::Vcloudng | vm", ['configuration']) do + tests("Compute::VcloudDirector | vm", ['configuration']) do vm = vapp.vms.first - tests("Compute::Vcloudng | vm", ['network']) do + tests("Compute::VcloudDirector | vm", ['network']) do network = vm.network network.network = NETWORK_NAME network.is_connected = true @@ -31,7 +31,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#ip_address_allocation_mode").returns(NETWORK_MODE) { network.ip_address_allocation_mode } end - tests("Compute::Vcloudng | vm", ['customization']) do + tests("Compute::VcloudDirector | vm", ['customization']) do customization = vm.customization customization.script = 'this is the user data' customization.enabled = true @@ -40,7 +40,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#enabled").returns(true) { customization.enabled } end - tests("Compute::Vcloudng | vm", ['doble the disk size']) do + tests("Compute::VcloudDirector | vm", ['doble the disk size']) do disk = vm.disks.get_by_name('Hard disk 1') tests("#disk_size").returns(Fixnum) { disk.capacity.class} new_size = disk.capacity * 2 @@ -49,7 +49,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#disk_size is now doubled").returns(new_size) { disk.capacity } end - tests("Compute::Vcloudng | vm", ['add a new disk']) do + tests("Compute::VcloudDirector | vm", ['add a new disk']) do tests("hard disk 2 doesn't exist").returns(nil) { vm.disks.get_by_name('Hard disk 2') } tests("#create").returns(true) { vm.disks.create(1024) } tests("hard disk 2 exists").returns(1024) { vm.disks.get_by_name('Hard disk 2').capacity } @@ -57,7 +57,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("hard disk 2 doesn't exist anymore").returns(nil) { vm.disks.get_by_name('Hard disk 2') } end - tests("Compute::Vcloudng | vm", ['doble the memory size']) do + tests("Compute::VcloudDirector | vm", ['doble the memory size']) do tests("#memory").returns(Fixnum) { vm.memory.class} new_size = vm.memory * 2 vm.memory = new_size @@ -65,7 +65,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#memory is now doubled").returns(new_size) { vm.memory } end - tests("Compute::Vcloudng | vm", ['doble the cpu size']) do + tests("Compute::VcloudDirector | vm", ['doble the cpu size']) do tests("#cpu").returns(Fixnum) { vm.cpu.class} new_size = vm.cpu * 2 vm.cpu = new_size @@ -73,7 +73,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#memory is now doubled").returns(new_size) { vm.cpu } end - tests("Compute::Vcloudng | vm", ['tags']) do + tests("Compute::VcloudDirector | vm", ['tags']) do TAGS.each_pair do |k,v| tests('create tag').returns(true) {vm.tags.create(k, v)} end @@ -85,7 +85,7 @@ VCR.use_cassette(File.basename(__FILE__)) do tests('there is only one tag').returns(1){ vm.tags.size } end - tests("Compute::Vcloudng | vm", ['power on']) do + tests("Compute::VcloudDirector | vm", ['power on']) do tests('#vm is off').returns("off"){ vm.status } tests('#power_on').returns(true){ vm.power_on } vm.reload diff --git a/tests/vcloudng/models/compute/vapp_tests.rb b/tests/vcloud_director/models/compute/vapp_tests.rb similarity index 78% rename from tests/vcloudng/models/compute/vapp_tests.rb rename to tests/vcloud_director/models/compute/vapp_tests.rb index a2a0eabe5..52758d809 100644 --- a/tests/vcloudng/models/compute/vapp_tests.rb +++ b/tests/vcloud_director/models/compute/vapp_tests.rb @@ -2,39 +2,39 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | vapps", ['all']) do + Shindo.tests("Compute::VcloudDirector | vapps", ['all']) do pending if Fog.mocking? tests("#There is more than one vapp").returns(true){ vdc.vapps.size >= 1 } vapps = vdc.vapps vapp = vapps.first - tests("Compute::Vcloudng | vapp") do + tests("Compute::VcloudDirector | vapp") do tests("#id").returns(String){ vapp.id.class } tests("#name").returns(String){ vapp.name.class } tests("#href").returns(String){ vapp.href.class } tests("#type").returns("application/vnd.vmware.vcloud.vApp+xml"){ vapp.type } end - tests("Compute::Vcloudng | vapp", ['lazy load attrs']) do + tests("Compute::VcloudDirector | vapp", ['lazy load attrs']) do vapp.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { vapp.attributes[lazy_attr] } end end - tests("Compute::Vcloudng | vapp", ['load on demand']) do + tests("Compute::VcloudDirector | vapp", ['load on demand']) do tests("#description is not loaded yet").returns(NonLoaded) { vapp.attributes[:description] } tests("#description is loaded on demand").returns(String) { vapp.description.class } tests("#description is now loaded").returns(true) { vapp.attributes[:description] != NonLoaded } end - tests("Compute::Vcloudng | vapp", ['lazy load attrs']) do + tests("Compute::VcloudDirector | vapp", ['lazy load attrs']) do vapp.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is now loaded").returns(true) { vapp.attributes[lazy_attr] != NonLoaded } end end - tests("Compute::Vcloudng | vapp", ['get']) do + tests("Compute::VcloudDirector | vapp", ['get']) do tests("#get_by_name").returns(vapp.name) { vapps.get_by_name(vapp.name).name } tests("#get").returns(vapp.id) { vapps.get(vapp.id).id } end diff --git a/tests/vcloudng/models/compute/vdcs_test.rb b/tests/vcloud_director/models/compute/vdcs_test.rb similarity index 78% rename from tests/vcloudng/models/compute/vdcs_test.rb rename to tests/vcloud_director/models/compute/vdcs_test.rb index 405f19885..d40021da2 100644 --- a/tests/vcloudng/models/compute/vdcs_test.rb +++ b/tests/vcloud_director/models/compute/vdcs_test.rb @@ -2,39 +2,39 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | vdcs", ['all']) do + Shindo.tests("Compute::VcloudDirector | vdcs", ['all']) do pending if Fog.mocking? tests("#There is one or more vdc").returns(true){ organization.vdcs.size >= 1 } vdcs = organization.vdcs vdc = vdcs.first - tests("Compute::Vcloudng | vdc") do + tests("Compute::VcloudDirector | vdc") do tests("#id").returns(String){ vdc.id.class } tests("#name").returns(String){ vdc.name.class } tests("#href").returns(String){ vdc.href.class } tests("#type").returns("application/vnd.vmware.vcloud.vdc+xml"){ vdc.type } end - tests("Compute::Vcloudng | vdc", ['lazy load attrs']) do + tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do vdc.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { vdc.attributes[lazy_attr] } end end - tests("Compute::Vcloudng | vdc", ['load on demand']) do + tests("Compute::VcloudDirector | vdc", ['load on demand']) do tests("#description is not loaded yet").returns(NonLoaded) { vdc.attributes[:description] } tests("#description is loaded on demand").returns(String) { vdc.description.class } tests("#description is now loaded").returns(true) { vdc.attributes[:description] != NonLoaded } end - tests("Compute::Vcloudng | vdc", ['lazy load attrs']) do + tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do vdc.lazy_load_attrs.each do |lazy_attr| tests("##{lazy_attr} is now loaded").returns(true) { vdc.attributes[lazy_attr] != NonLoaded } end end - tests("Compute::Vcloudng | vdc", ['get']) do + tests("Compute::VcloudDirector | vdc", ['get']) do tests("#get_by_name").returns(vdc.name) { vdcs.get_by_name(vdc.name).name } tests("#get").returns(vdc.id) { vdcs.get(vdc.id).id } end diff --git a/tests/vcloudng/models/compute/vms_tests.rb b/tests/vcloud_director/models/compute/vms_tests.rb similarity index 80% rename from tests/vcloudng/models/compute/vms_tests.rb rename to tests/vcloud_director/models/compute/vms_tests.rb index 118867c2e..0b9f8370a 100644 --- a/tests/vcloudng/models/compute/vms_tests.rb +++ b/tests/vcloud_director/models/compute/vms_tests.rb @@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) VCR.use_cassette(File.basename(__FILE__)) do - Shindo.tests("Compute::Vcloudng | vms", ['all']) do + Shindo.tests("Compute::VcloudDirector | vms", ['all']) do pending if Fog.mocking? vapp = vapps.detect {|vapp| vapp.vms.size >= 1 } @@ -11,8 +11,8 @@ VCR.use_cassette(File.basename(__FILE__)) do vms = vapp.vms vm = vms.first - tests("Compute::Vcloudng | vm") do - tests("#model").returns(Fog::Compute::Vcloudng::Vm){vm.class} + tests("Compute::VcloudDirector | vm") do + tests("#model").returns(Fog::Compute::VcloudDirector::Vm){vm.class} tests("#id").returns(String){ vm.id.class } tests("#name").returns(String){ vm.name.class } tests("#href").returns(String){ vm.href.class } @@ -26,14 +26,14 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#hard_disks").returns(Array){ vm.hard_disks.class } end - tests("Compute::Vcloudng | vm", ['get']) do + tests("Compute::VcloudDirector | vm", ['get']) do tests("#get_by_name").returns(vm.name) { vms.get_by_name(vm.name).name } tests("#get").returns(vm.id) { vms.get(vm.id).id } end - tests("Compute::Vcloudng | vm | disks") do - tests("#collection").returns(Fog::Compute::Vcloudng::Disks){ vm.disks.class } - tests("#get_by_name").returns(Fog::Compute::Vcloudng::Disk) { vm.disks.get_by_name("Hard disk 1").class } + tests("Compute::VcloudDirector | vm | disks") do + tests("#collection").returns(Fog::Compute::VcloudDirector::Disks){ vm.disks.class } + tests("#get_by_name").returns(Fog::Compute::VcloudDirector::Disk) { vm.disks.get_by_name("Hard disk 1").class } hard_disk = vm.disks.get_by_name("Hard disk 1") tests("#id").returns(2000){ hard_disk.id } @@ -47,9 +47,9 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#bus_type").returns(6){ hard_disk.bus_type } end - tests("Compute::Vcloudng | vm | customization") do + tests("Compute::VcloudDirector | vm | customization") do customization = vm.customization - tests("#model").returns(Fog::Compute::Vcloudng::VmCustomization){customization.class} + tests("#model").returns(Fog::Compute::VcloudDirector::VmCustomization){customization.class} tests("#id").returns(String){ customization.id.class } tests("#href").returns(String){ customization.href.class } tests("#type").returns("application/vnd.vmware.vcloud.guestCustomizationSection+xml"){ customization.type } @@ -63,9 +63,9 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#reset_password_required").returns(true){ boolean? customization.reset_password_required } end - tests("Compute::Vcloudng | vm | network") do + tests("Compute::VcloudDirector | vm | network") do network = vm.network - tests("#model").returns(Fog::Compute::Vcloudng::VmNetwork){network.class} + tests("#model").returns(Fog::Compute::VcloudDirector::VmNetwork){network.class} tests("#id").returns(String){ network.id.class } tests("#href").returns(String){ network.href.class } tests("#type").returns("application/vnd.vmware.vcloud.networkConnectionSection+xml"){ network.type } @@ -79,9 +79,9 @@ VCR.use_cassette(File.basename(__FILE__)) do tests("#is_connected").returns(true){ boolean? network.is_connected } end - tests("Compute::Vcloudng | vm | tags") do + tests("Compute::VcloudDirector | vm | tags") do tags = vm.tags - tests("#collection").returns(Fog::Compute::Vcloudng::Tags){ tags.class } + tests("#collection").returns(Fog::Compute::VcloudDirector::Tags){ tags.class } end diff --git a/tests/vcloudng/models/tools/reduced_vcr_requests.rb b/tests/vcloud_director/models/tools/reduced_vcr_requests.rb similarity index 100% rename from tests/vcloudng/models/tools/reduced_vcr_requests.rb rename to tests/vcloud_director/models/tools/reduced_vcr_requests.rb diff --git a/tests/vcloudng/vcr_cassettes/catalog_items_test_rb.yml b/tests/vcloud_director/vcr_cassettes/catalog_items_test_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/catalog_items_test_rb.yml rename to tests/vcloud_director/vcr_cassettes/catalog_items_test_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/catalogs_test_rb.yml b/tests/vcloud_director/vcr_cassettes/catalogs_test_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/catalogs_test_rb.yml rename to tests/vcloud_director/vcr_cassettes/catalogs_test_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/organizations_tests_rb.yml b/tests/vcloud_director/vcr_cassettes/organizations_tests_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/organizations_tests_rb.yml rename to tests/vcloud_director/vcr_cassettes/organizations_tests_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/vapp_life_cycle_tests_rb.yml b/tests/vcloud_director/vcr_cassettes/vapp_life_cycle_tests_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/vapp_life_cycle_tests_rb.yml rename to tests/vcloud_director/vcr_cassettes/vapp_life_cycle_tests_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/vapp_tests_rb.yml b/tests/vcloud_director/vcr_cassettes/vapp_tests_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/vapp_tests_rb.yml rename to tests/vcloud_director/vcr_cassettes/vapp_tests_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/vdcs_test_rb.yml b/tests/vcloud_director/vcr_cassettes/vdcs_test_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/vdcs_test_rb.yml rename to tests/vcloud_director/vcr_cassettes/vdcs_test_rb.yml diff --git a/tests/vcloudng/vcr_cassettes/vms_tests_rb.yml b/tests/vcloud_director/vcr_cassettes/vms_tests_rb.yml similarity index 100% rename from tests/vcloudng/vcr_cassettes/vms_tests_rb.yml rename to tests/vcloud_director/vcr_cassettes/vms_tests_rb.yml