fog 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/Gemfile +8 -8
  2. data/Gemfile.lock +3 -3
  3. data/bin/fog +2 -10
  4. data/fog.gemspec +45 -20
  5. data/lib/fog.rb +2 -1
  6. data/lib/fog/attributes.rb +48 -8
  7. data/lib/fog/aws/ec2.rb +5 -2
  8. data/lib/fog/aws/elb.rb +5 -2
  9. data/lib/fog/aws/models/ec2/server.rb +1 -1
  10. data/lib/fog/aws/requests/simpledb/put_attributes.rb +43 -12
  11. data/lib/fog/aws/s3.rb +2 -2
  12. data/lib/fog/aws/simpledb.rb +15 -3
  13. data/lib/fog/bin.rb +11 -2
  14. data/lib/fog/bluebox.rb +5 -1
  15. data/lib/fog/connection.rb +9 -1
  16. data/lib/fog/credentials.rb +3 -0
  17. data/lib/fog/new_servers.rb +89 -0
  18. data/lib/fog/new_servers/bin.rb +30 -0
  19. data/lib/fog/new_servers/requests/add_server.rb +39 -0
  20. data/lib/fog/new_servers/requests/cancel_server.rb +36 -0
  21. data/lib/fog/new_servers/requests/get_server.rb +42 -0
  22. data/lib/fog/new_servers/requests/list_images.rb +33 -0
  23. data/lib/fog/new_servers/requests/list_plans.rb +36 -0
  24. data/lib/fog/new_servers/requests/list_servers.rb +43 -0
  25. data/lib/fog/new_servers/requests/reboot_server.rb +30 -0
  26. data/lib/fog/parser.rb +6 -0
  27. data/lib/fog/rackspace/files.rb +8 -2
  28. data/lib/fog/rackspace/models/servers/server.rb +5 -0
  29. data/lib/fog/rackspace/servers.rb +5 -1
  30. data/lib/fog/service.rb +6 -1
  31. data/lib/fog/slicehost.rb +5 -1
  32. data/lib/fog/terremark/ecloud.rb +1 -0
  33. data/lib/fog/terremark/shared.rb +4 -1
  34. data/lib/fog/terremark/vcloud.rb +1 -0
  35. data/lib/fog/vcloud.rb +150 -141
  36. data/lib/fog/vcloud/bin.rb +2 -2
  37. data/lib/fog/vcloud/collection.rb +3 -84
  38. data/lib/fog/vcloud/extension.rb +44 -0
  39. data/lib/fog/vcloud/generators.rb +33 -0
  40. data/lib/fog/vcloud/model.rb +5 -38
  41. data/lib/fog/vcloud/models/vdc.rb +14 -24
  42. data/lib/fog/vcloud/models/vdcs.rb +13 -8
  43. data/lib/fog/vcloud/requests/get_network.rb +4 -11
  44. data/lib/fog/vcloud/requests/get_organization.rb +4 -11
  45. data/lib/fog/vcloud/requests/get_vdc.rb +4 -12
  46. data/lib/fog/vcloud/requests/get_versions.rb +4 -13
  47. data/lib/fog/vcloud/requests/login.rb +4 -4
  48. data/lib/fog/vcloud/terremark/ecloud.rb +125 -54
  49. data/lib/fog/vcloud/terremark/ecloud/models/catalog.rb +30 -0
  50. data/lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb +31 -0
  51. data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +21 -22
  52. data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +11 -25
  53. data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +38 -5
  54. data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +11 -15
  55. data/lib/fog/vcloud/terremark/ecloud/models/network.rb +52 -11
  56. data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +14 -13
  57. data/lib/fog/vcloud/terremark/ecloud/models/node.rb +47 -0
  58. data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +30 -0
  59. data/lib/fog/vcloud/terremark/ecloud/models/public_ip.rb +6 -9
  60. data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +19 -3
  61. data/lib/fog/vcloud/terremark/ecloud/models/server.rb +203 -0
  62. data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +43 -0
  63. data/lib/fog/vcloud/terremark/ecloud/models/task.rb +22 -0
  64. data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +30 -0
  65. data/lib/fog/vcloud/terremark/ecloud/models/vdc.rb +32 -10
  66. data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +5 -6
  67. data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +23 -10
  68. data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +54 -0
  69. data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +14 -12
  70. data/lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb +53 -0
  71. data/lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb +52 -0
  72. data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +42 -0
  73. data/lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb +115 -0
  74. data/lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb +4 -23
  75. data/lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb +0 -0
  76. data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +19 -0
  77. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +18 -0
  78. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +18 -0
  79. data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +18 -0
  80. data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +9 -16
  81. data/lib/fog/vcloud/terremark/ecloud/requests/get_network.rb +8 -14
  82. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +36 -0
  83. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +44 -0
  84. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +11 -12
  85. data/lib/fog/vcloud/terremark/ecloud/requests/get_node.rb +18 -0
  86. data/lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb +18 -0
  87. data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb +5 -19
  88. data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb +5 -12
  89. data/lib/fog/vcloud/terremark/ecloud/requests/get_task.rb +18 -0
  90. data/lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb +19 -0
  91. data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb +18 -0
  92. data/lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb +7 -15
  93. data/lib/fog/vcloud/terremark/ecloud/requests/power_off.rb +18 -0
  94. data/lib/fog/vcloud/terremark/ecloud/requests/power_on.rb +18 -0
  95. data/lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb +18 -0
  96. data/lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb +18 -0
  97. data/lib/fog/vcloud/terremark/vcloud.rb +4 -18
  98. data/lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb +4 -12
  99. data/spec/aws/requests/simpledb/put_attributes_spec.rb +18 -0
  100. data/spec/vcloud/bin_spec.rb +2 -2
  101. data/spec/vcloud/models/vdc_spec.rb +35 -29
  102. data/spec/vcloud/requests/get_network_spec.rb +32 -43
  103. data/spec/vcloud/requests/get_organization_spec.rb +45 -38
  104. data/spec/vcloud/requests/get_vdc_spec.rb +42 -32
  105. data/spec/vcloud/requests/get_versions_spec.rb +17 -17
  106. data/spec/vcloud/requests/login_spec.rb +7 -4
  107. data/spec/vcloud/spec_helper.rb +137 -46
  108. data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +53 -58
  109. data/spec/vcloud/terremark/ecloud/models/internet_services_spec.rb +20 -20
  110. data/spec/vcloud/terremark/ecloud/models/ip_spec.rb +22 -21
  111. data/spec/vcloud/terremark/ecloud/models/ips_spec.rb +18 -18
  112. data/spec/vcloud/terremark/ecloud/models/network_spec.rb +55 -51
  113. data/spec/vcloud/terremark/ecloud/models/networks_spec.rb +16 -15
  114. data/spec/vcloud/terremark/ecloud/models/public_ip_spec.rb +26 -27
  115. data/spec/vcloud/terremark/ecloud/models/public_ips_spec.rb +16 -15
  116. data/spec/vcloud/terremark/ecloud/models/vdc_spec.rb +52 -36
  117. data/spec/vcloud/terremark/ecloud/models/vdcs_spec.rb +18 -15
  118. data/spec/vcloud/terremark/ecloud/requests/add_internet_service_spec.rb +46 -43
  119. data/spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb +37 -32
  120. data/spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb +26 -23
  121. data/spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb +57 -49
  122. data/spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb +41 -0
  123. data/spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb +39 -34
  124. data/spec/vcloud/terremark/ecloud/requests/get_network_spec.rb +26 -48
  125. data/spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb +25 -26
  126. data/spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb +35 -27
  127. data/spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb +85 -110
  128. data/spec/vcloud/terremark/ecloud/requests/login_spec.rb +7 -4
  129. data/spec/vcloud/vcloud_spec.rb +9 -8
  130. metadata +62 -26
  131. data/lib/fog/vcloud/parser.rb +0 -42
  132. data/lib/fog/vcloud/parsers/get_organization.rb +0 -37
  133. data/lib/fog/vcloud/parsers/get_vdc.rb +0 -62
  134. data/lib/fog/vcloud/parsers/get_versions.rb +0 -46
  135. data/lib/fog/vcloud/parsers/login.rb +0 -36
  136. data/lib/fog/vcloud/parsers/network.rb +0 -53
  137. data/lib/fog/vcloud/terremark/all.rb +0 -9
  138. data/lib/fog/vcloud/terremark/ecloud/parsers/get_internet_services.rb +0 -59
  139. data/lib/fog/vcloud/terremark/ecloud/parsers/get_public_ip.rb +0 -30
  140. data/lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb +0 -40
  141. data/lib/fog/vcloud/terremark/ecloud/parsers/get_vdc.rb +0 -59
  142. data/lib/fog/vcloud/terremark/ecloud/parsers/internet_service.rb +0 -58
  143. data/lib/fog/vcloud/terremark/ecloud/parsers/network.rb +0 -28
  144. data/lib/fog/vcloud/terremark/ecloud/parsers/network_ips.rb +0 -31
  145. data/lib/fog/vcloud/terremark/ecloud/requests/login.rb +0 -27
  146. data/lib/fog/vcloud/terremark/vcloud/parsers/get_vdc.rb +0 -34
  147. data/spec/vcloud/terremark/vcloud/requests/get_vdc_spec.rb +0 -74
@@ -1,7 +1,10 @@
1
- require 'spec_helper'
1
+ require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
2
2
 
3
- describe Fog::Vcloud, :type => :tmrk_ecloud_request do
4
- subject { @vcloud }
3
+ if Fog.mocking?
4
+ describe Fog::Vcloud, :type => :mock_tmrk_ecloud_request do
5
+ subject { @vcloud }
5
6
 
6
- it_should_behave_like "all login requests"
7
+ it_should_behave_like "all login requests"
8
+ end
9
+ else
7
10
  end
@@ -1,17 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Fog::Vcloud do
4
- subject { Fog::Vcloud.new() }
3
+ if Fog.mocking?
4
+ describe Fog::Vcloud, :type => :mock_vcloud_request do
5
+ subject { Fog::Vcloud.new(:username => "foo", :password => "bar", :versions_uri => "https://fakey.com/api/versions") }
5
6
 
6
- it { should be_an_instance_of Fog::Vcloud::Mock }
7
+ it { should be_an_instance_of Fog::Vcloud::Mock }
7
8
 
8
- it { should respond_to :default_organization_uri }
9
+ it { should respond_to :default_organization_uri }
9
10
 
10
- it { should respond_to :supported_versions }
11
+ it { should respond_to :supported_versions }
11
12
 
12
- it { should have_at_least(1).supported_versions }
13
+ it { should have_at_least(1).supported_versions }
13
14
 
14
- its(:default_organization_uri) { should == URI.parse(@mock_organization[:info][:href]) }
15
- its(:default_organization_uri) { should be_an_instance_of URI::HTTPS }
15
+ its(:default_organization_uri) { should == @mock_organization[:info][:href] }
16
16
 
17
+ end
17
18
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-18 00:00:00 -07:00
17
+ date: 2010-06-27 00:00:00 -05:00
18
18
  default_executable: fog
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -26,9 +26,9 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
28
  - 0
29
- - 0
30
- - 24
31
- version: 0.0.24
29
+ - 1
30
+ - 2
31
+ version: 0.1.2
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
@@ -106,7 +106,7 @@ dependencies:
106
106
  type: :runtime
107
107
  version_requirements: *id007
108
108
  - !ruby/object:Gem::Dependency
109
- name: rspec
109
+ name: builder
110
110
  prerelease: false
111
111
  requirement: &id008 !ruby/object:Gem::Requirement
112
112
  requirements:
@@ -115,10 +115,10 @@ dependencies:
115
115
  segments:
116
116
  - 0
117
117
  version: "0"
118
- type: :development
118
+ type: :runtime
119
119
  version_requirements: *id008
120
120
  - !ruby/object:Gem::Dependency
121
- name: shindo
121
+ name: rspec
122
122
  prerelease: false
123
123
  requirement: &id009 !ruby/object:Gem::Requirement
124
124
  requirements:
@@ -129,6 +129,18 @@ dependencies:
129
129
  version: "0"
130
130
  type: :development
131
131
  version_requirements: *id009
132
+ - !ruby/object:Gem::Dependency
133
+ name: shindo
134
+ prerelease: false
135
+ requirement: &id010 !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ segments:
140
+ - 0
141
+ version: "0"
142
+ type: :development
143
+ version_requirements: *id010
132
144
  description: The Ruby cloud computing library.
133
145
  email: geemus@gmail.com
134
146
  executables:
@@ -320,6 +332,15 @@ files:
320
332
  - lib/fog/local/models/file.rb
321
333
  - lib/fog/local/models/files.rb
322
334
  - lib/fog/model.rb
335
+ - lib/fog/new_servers.rb
336
+ - lib/fog/new_servers/bin.rb
337
+ - lib/fog/new_servers/requests/add_server.rb
338
+ - lib/fog/new_servers/requests/cancel_server.rb
339
+ - lib/fog/new_servers/requests/get_server.rb
340
+ - lib/fog/new_servers/requests/list_images.rb
341
+ - lib/fog/new_servers/requests/list_plans.rb
342
+ - lib/fog/new_servers/requests/list_servers.rb
343
+ - lib/fog/new_servers/requests/reboot_server.rb
323
344
  - lib/fog/parser.rb
324
345
  - lib/fog/rackspace.rb
325
346
  - lib/fog/rackspace/bin.rb
@@ -456,51 +477,66 @@ files:
456
477
  - lib/fog/vcloud.rb
457
478
  - lib/fog/vcloud/bin.rb
458
479
  - lib/fog/vcloud/collection.rb
480
+ - lib/fog/vcloud/extension.rb
481
+ - lib/fog/vcloud/generators.rb
459
482
  - lib/fog/vcloud/model.rb
460
483
  - lib/fog/vcloud/models/vdc.rb
461
484
  - lib/fog/vcloud/models/vdcs.rb
462
- - lib/fog/vcloud/parser.rb
463
- - lib/fog/vcloud/parsers/get_organization.rb
464
- - lib/fog/vcloud/parsers/get_vdc.rb
465
- - lib/fog/vcloud/parsers/get_versions.rb
466
- - lib/fog/vcloud/parsers/login.rb
467
- - lib/fog/vcloud/parsers/network.rb
468
485
  - lib/fog/vcloud/requests/get_network.rb
469
486
  - lib/fog/vcloud/requests/get_organization.rb
470
487
  - lib/fog/vcloud/requests/get_vdc.rb
471
488
  - lib/fog/vcloud/requests/get_versions.rb
472
489
  - lib/fog/vcloud/requests/login.rb
473
- - lib/fog/vcloud/terremark/all.rb
474
490
  - lib/fog/vcloud/terremark/ecloud.rb
491
+ - lib/fog/vcloud/terremark/ecloud/models/catalog.rb
492
+ - lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb
475
493
  - lib/fog/vcloud/terremark/ecloud/models/internet_service.rb
476
494
  - lib/fog/vcloud/terremark/ecloud/models/internet_services.rb
477
495
  - lib/fog/vcloud/terremark/ecloud/models/ip.rb
478
496
  - lib/fog/vcloud/terremark/ecloud/models/ips.rb
479
497
  - lib/fog/vcloud/terremark/ecloud/models/network.rb
480
498
  - lib/fog/vcloud/terremark/ecloud/models/networks.rb
499
+ - lib/fog/vcloud/terremark/ecloud/models/node.rb
500
+ - lib/fog/vcloud/terremark/ecloud/models/nodes.rb
481
501
  - lib/fog/vcloud/terremark/ecloud/models/public_ip.rb
482
502
  - lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
503
+ - lib/fog/vcloud/terremark/ecloud/models/server.rb
504
+ - lib/fog/vcloud/terremark/ecloud/models/servers.rb
505
+ - lib/fog/vcloud/terremark/ecloud/models/task.rb
506
+ - lib/fog/vcloud/terremark/ecloud/models/tasks.rb
483
507
  - lib/fog/vcloud/terremark/ecloud/models/vdc.rb
484
508
  - lib/fog/vcloud/terremark/ecloud/models/vdcs.rb
485
- - lib/fog/vcloud/terremark/ecloud/parsers/get_internet_services.rb
486
- - lib/fog/vcloud/terremark/ecloud/parsers/get_public_ip.rb
487
- - lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb
488
- - lib/fog/vcloud/terremark/ecloud/parsers/get_vdc.rb
489
- - lib/fog/vcloud/terremark/ecloud/parsers/internet_service.rb
490
- - lib/fog/vcloud/terremark/ecloud/parsers/network.rb
491
- - lib/fog/vcloud/terremark/ecloud/parsers/network_ips.rb
492
509
  - lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb
510
+ - lib/fog/vcloud/terremark/ecloud/requests/add_node.rb
493
511
  - lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb
512
+ - lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb
513
+ - lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb
514
+ - lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb
515
+ - lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb
494
516
  - lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb
517
+ - lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb
518
+ - lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb
519
+ - lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb
520
+ - lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb
521
+ - lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb
495
522
  - lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb
496
523
  - lib/fog/vcloud/terremark/ecloud/requests/get_network.rb
524
+ - lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
525
+ - lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb
497
526
  - lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb
527
+ - lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
528
+ - lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
498
529
  - lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
499
530
  - lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb
531
+ - lib/fog/vcloud/terremark/ecloud/requests/get_task.rb
532
+ - lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb
533
+ - lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb
500
534
  - lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb
501
- - lib/fog/vcloud/terremark/ecloud/requests/login.rb
535
+ - lib/fog/vcloud/terremark/ecloud/requests/power_off.rb
536
+ - lib/fog/vcloud/terremark/ecloud/requests/power_on.rb
537
+ - lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb
538
+ - lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb
502
539
  - lib/fog/vcloud/terremark/vcloud.rb
503
- - lib/fog/vcloud/terremark/vcloud/parsers/get_vdc.rb
504
540
  - lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb
505
541
  - spec/aws/models/ec2/address_spec.rb
506
542
  - spec/aws/models/ec2/addresses_spec.rb
@@ -589,13 +625,13 @@ files:
589
625
  - spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb
590
626
  - spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb
591
627
  - spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb
628
+ - spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb
592
629
  - spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb
593
630
  - spec/vcloud/terremark/ecloud/requests/get_network_spec.rb
594
631
  - spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb
595
632
  - spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb
596
633
  - spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb
597
634
  - spec/vcloud/terremark/ecloud/requests/login_spec.rb
598
- - spec/vcloud/terremark/vcloud/requests/get_vdc_spec.rb
599
635
  - spec/vcloud/vcloud_spec.rb
600
636
  - tests/aws/helper.rb
601
637
  - tests/aws/requests/ec2/address_tests.rb
@@ -1,42 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Vcloud
4
-
5
- def self.de_camel(str)
6
- str.gsub(/(.)([A-Z])/,'\1_\2').downcase
7
- end
8
-
9
- class Base < Fog::Parsers::Base
10
-
11
- private
12
-
13
- def generate_link(attributes)
14
- link = Struct::VcloudLink.new
15
- until attributes.empty?
16
- link[attributes.shift.downcase] = attributes.shift
17
- end
18
- if link.href
19
- link.href = URI.parse(link.href)
20
- end
21
- link
22
- end
23
-
24
- def handle_root(attributes)
25
- root = {}
26
- until attributes.empty?
27
- if attributes.first.is_a?(Array)
28
- attribute = attributes.shift
29
- root[attribute.first.downcase] = attribute.last
30
- else
31
- root[attributes.shift.downcase] = attributes.shift
32
- end
33
- end
34
- @response.href = URI.parse(root['href'])
35
- @response.name = root['name']
36
- @response.type = root['type']
37
- @response.xmlns = root['xmlns']
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,37 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Vcloud
4
-
5
- class GetOrganization < Fog::Parsers::Vcloud::Base
6
- #
7
- # Based off of:
8
- # http://support.theenterprisecloud.com/kb/default.asp?id=540&Lang=1&SID=
9
- #
10
- # vCloud API Guide v0.9 - Page 26
11
- #
12
-
13
- def reset
14
- @response = Struct::VcloudOrganization.new([])
15
- end
16
-
17
- def start_element(name, attributes=[])
18
- super
19
- case name
20
- when 'Link'
21
- @response.links << generate_link(attributes)
22
- when 'Org'
23
- handle_root(attributes)
24
- end
25
- end
26
-
27
- def end_element(name)
28
- if name == 'Description'
29
- @response.description = @value
30
- end
31
- end
32
-
33
- end
34
-
35
- end
36
- end
37
- end
@@ -1,62 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Vcloud
4
-
5
- class GetVdc < Fog::Parsers::Vcloud::Base
6
- #WARNING: Incomplete
7
- #Based off of:
8
- #vCloud API Guide v0.9 - Page 27
9
-
10
- def reset
11
- @target = nil
12
- @response = Struct::VcloudVdc.new([],[],[],Struct::VcloudXCapacity.new,Struct::VcloudXCapacity.new,Struct::VcloudXCapacity.new)
13
- end
14
-
15
- def start_element(name, attributes=[])
16
- super
17
- case name
18
- when 'Cpu'
19
- @target = :cpu_capacity
20
- when 'Memory'
21
- @target = :memory_capacity
22
- when 'StorageCapacity'
23
- @target = :storage_capacity
24
- when 'NetworkQuota'
25
- @target = :network_quota
26
- when 'VmQuota'
27
- @target = :vm_quota
28
- when 'NicQuota'
29
- @target = :nic_quota
30
- when 'Link'
31
- @response.links << generate_link(attributes)
32
- when 'ResourceEntity'
33
- @response.resource_entities << generate_link(attributes)
34
- when 'Network'
35
- @response.networks << generate_link(attributes)
36
- when 'Vdc'
37
- handle_root(attributes)
38
- end
39
- end
40
-
41
- def end_element(name)
42
- case name
43
- when 'Allocated', 'Limit', 'Used'
44
- @response[@target][name.downcase] = @value.to_i
45
- when 'Units'
46
- @response[@target][name.downcase] = @value
47
- when "AllocationModel"
48
- @response.allocation_model = @value
49
- when "Description"
50
- @response.description = @value
51
- when "NicQuota", "VmQuota", "NetworkQuota"
52
- @response[@target] = @value.to_i
53
- when 'IsEnabled'
54
- @response.enabled = (@value == 'true' ? true : false)
55
- end
56
- end
57
-
58
- end
59
-
60
- end
61
- end
62
- end
@@ -1,46 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Vcloud
4
-
5
- class GetVersions < Fog::Parsers::Base
6
- #
7
- # Based off of:
8
- # http://support.theenterprisecloud.com/kb/default.asp?id=535&Lang=1&SID=
9
- # https://community.vcloudexpress.terremark.com/en-us/product_docs/w/wiki/02-get-versions.aspx
10
- # vCloud API Guide v0.9 - Page 89
11
- #
12
-
13
- def reset
14
- @response = []
15
- @supported = false
16
- end
17
-
18
- def start_element(name, attributes = {})
19
- super
20
- case name
21
- when "Version"
22
- @version = Struct::VcloudVersion.new
23
- when "SupportedVersions"
24
- @supported = true
25
- end
26
- end
27
-
28
- def end_element(name)
29
- case name
30
- when "Version"
31
- @version.version = @value
32
- @version.supported = @supported
33
- when "LoginUrl"
34
- @version.login_url = @value
35
- when "VersionInfo"
36
- @response << @version
37
- when "SupportedVersions"
38
- @supported = false
39
- end
40
- end
41
-
42
- end
43
-
44
- end
45
- end
46
- end
@@ -1,36 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Vcloud
4
-
5
- class Login < Fog::Parsers::Vcloud::Base
6
- #
7
- # Based off of:
8
- # http://support.theenterprisecloud.com/kb/default.asp?id=536&Lang=1&SID=
9
- # https://community.vcloudexpress.terremark.com/en-us/product_docs/w/wiki/01-get-login-token.aspx
10
- # vCloud API Guide v0.9 - Page 17
11
- #
12
-
13
- def reset
14
- @response = Struct::VcloudOrgList.new([])
15
- end
16
-
17
- def start_element(name, attributes=[])
18
- super
19
- case name
20
- when 'OrgList'
21
- until attributes.empty?
22
- if at = attributes.shift
23
- if at[0] == "xmlns"
24
- @response.xmlns = at[1]
25
- end
26
- end
27
- end
28
- when 'Org'
29
- @response.organizations << generate_link(attributes)
30
- end
31
- end
32
-
33
- end
34
- end
35
- end
36
- end