fog 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. data/Gemfile.lock +6 -6
  2. data/README.rdoc +7 -1
  3. data/bin/fog +4 -3
  4. data/fog.gemspec +39 -24
  5. data/lib/fog.rb +4 -12
  6. data/lib/fog/aws.rb +14 -5
  7. data/lib/fog/aws/compute.rb +26 -9
  8. data/lib/fog/aws/elb.rb +3 -2
  9. data/lib/fog/aws/models/compute/address.rb +2 -1
  10. data/lib/fog/aws/models/compute/addresses.rb +11 -9
  11. data/lib/fog/aws/models/compute/flavor.rb +1 -1
  12. data/lib/fog/aws/models/compute/flavors.rb +13 -11
  13. data/lib/fog/aws/models/compute/image.rb +2 -1
  14. data/lib/fog/aws/models/compute/images.rb +7 -9
  15. data/lib/fog/aws/models/compute/key_pair.rb +1 -1
  16. data/lib/fog/aws/models/compute/key_pairs.rb +10 -8
  17. data/lib/fog/aws/models/compute/security_group.rb +1 -1
  18. data/lib/fog/aws/models/compute/security_groups.rb +11 -9
  19. data/lib/fog/aws/models/compute/server.rb +10 -3
  20. data/lib/fog/aws/models/compute/servers.rb +14 -8
  21. data/lib/fog/aws/models/compute/snapshot.rb +3 -2
  22. data/lib/fog/aws/models/compute/snapshots.rb +11 -16
  23. data/lib/fog/aws/models/compute/tag.rb +36 -0
  24. data/lib/fog/aws/models/compute/tags.rb +34 -0
  25. data/lib/fog/aws/models/compute/volume.rb +11 -10
  26. data/lib/fog/aws/models/compute/volumes.rb +11 -9
  27. data/lib/fog/aws/models/storage/directories.rb +1 -1
  28. data/lib/fog/aws/models/storage/directory.rb +1 -1
  29. data/lib/fog/aws/models/storage/file.rb +3 -2
  30. data/lib/fog/aws/models/storage/files.rb +1 -7
  31. data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +4 -2
  32. data/lib/fog/aws/parsers/compute/describe_images.rb +23 -13
  33. data/lib/fog/aws/parsers/compute/describe_instances.rb +34 -8
  34. data/lib/fog/aws/parsers/compute/describe_security_groups.rb +4 -3
  35. data/lib/fog/aws/parsers/compute/describe_snapshots.rb +33 -13
  36. data/lib/fog/aws/parsers/compute/describe_tags.rb +30 -0
  37. data/lib/fog/aws/parsers/compute/describe_volumes.rb +17 -3
  38. data/lib/fog/aws/parsers/compute/run_instances.rb +4 -4
  39. data/lib/fog/aws/parsers/storage/get_bucket.rb +1 -1
  40. data/lib/fog/aws/parsers/storage/get_bucket_logging.rb +1 -1
  41. data/lib/fog/aws/parsers/storage/get_bucket_object_versions.rb +3 -3
  42. data/lib/fog/aws/requests/compute/create_snapshot.rb +1 -0
  43. data/lib/fog/aws/requests/compute/create_tags.rb +78 -0
  44. data/lib/fog/aws/requests/compute/delete_tags.rb +45 -0
  45. data/lib/fog/aws/requests/compute/describe_addresses.rb +27 -19
  46. data/lib/fog/aws/requests/compute/describe_availability_zones.rb +31 -25
  47. data/lib/fog/aws/requests/compute/describe_images.rb +11 -18
  48. data/lib/fog/aws/requests/compute/describe_instances.rb +125 -53
  49. data/lib/fog/aws/requests/compute/describe_key_pairs.rb +29 -21
  50. data/lib/fog/aws/requests/compute/describe_regions.rb +28 -23
  51. data/lib/fog/aws/requests/compute/describe_reserved_instances.rb +8 -4
  52. data/lib/fog/aws/requests/compute/describe_security_groups.rb +48 -19
  53. data/lib/fog/aws/requests/compute/describe_snapshots.rb +72 -35
  54. data/lib/fog/aws/requests/compute/describe_tags.rb +42 -0
  55. data/lib/fog/aws/requests/compute/describe_volumes.rb +67 -36
  56. data/lib/fog/aws/requests/compute/run_instances.rb +10 -3
  57. data/lib/fog/aws/simpledb.rb +3 -1
  58. data/lib/fog/aws/storage.rb +17 -8
  59. data/lib/fog/bluebox/models/compute/flavor.rb +1 -1
  60. data/lib/fog/bluebox/models/compute/flavors.rb +1 -1
  61. data/lib/fog/bluebox/models/compute/image.rb +1 -1
  62. data/lib/fog/bluebox/models/compute/images.rb +1 -1
  63. data/lib/fog/bluebox/models/compute/server.rb +8 -6
  64. data/lib/fog/bluebox/models/compute/servers.rb +1 -1
  65. data/lib/fog/bluebox/requests/compute/get_blocks.rb +1 -1
  66. data/lib/fog/core.rb +11 -0
  67. data/lib/fog/{attributes.rb → core/attributes.rb} +0 -0
  68. data/lib/fog/{bin.rb → core/bin.rb} +1 -1
  69. data/lib/fog/{collection.rb → core/collection.rb} +4 -0
  70. data/lib/fog/{connection.rb → core/connection.rb} +0 -0
  71. data/lib/fog/{credentials.rb → core/credentials.rb} +2 -0
  72. data/lib/fog/{deprecation.rb → core/deprecation.rb} +0 -0
  73. data/lib/fog/{errors.rb → core/errors.rb} +0 -0
  74. data/lib/fog/{hmac.rb → core/hmac.rb} +0 -0
  75. data/lib/fog/{model.rb → core/model.rb} +0 -0
  76. data/lib/fog/{parser.rb → core/parser.rb} +0 -0
  77. data/lib/fog/{provider.rb → core/provider.rb} +0 -0
  78. data/lib/fog/{service.rb → core/service.rb} +1 -0
  79. data/lib/fog/{ssh.rb → core/ssh.rb} +7 -7
  80. data/lib/fog/go_grid.rb +1 -1
  81. data/lib/fog/go_grid/compute.rb +6 -1
  82. data/lib/fog/go_grid/models/compute/image.rb +60 -0
  83. data/lib/fog/go_grid/models/compute/images.rb +33 -0
  84. data/lib/fog/go_grid/models/compute/server.rb +56 -0
  85. data/lib/fog/go_grid/models/compute/servers.rb +35 -0
  86. data/lib/fog/go_grid/requests/compute/grid_image_get.rb +41 -0
  87. data/lib/fog/go_grid/requests/compute/grid_image_list.rb +6 -1
  88. data/lib/fog/go_grid/requests/compute/grid_server_power.rb +2 -2
  89. data/lib/fog/google/models/storage/directories.rb +1 -1
  90. data/lib/fog/google/models/storage/directory.rb +1 -1
  91. data/lib/fog/google/models/storage/file.rb +3 -2
  92. data/lib/fog/google/models/storage/files.rb +1 -7
  93. data/lib/fog/google/parsers/storage/get_bucket.rb +1 -1
  94. data/lib/fog/linode/requests/compute/avail_linodeplans.rb +2 -2
  95. data/lib/fog/local/models/storage/directories.rb +1 -1
  96. data/lib/fog/local/models/storage/directory.rb +1 -1
  97. data/lib/fog/local/models/storage/file.rb +2 -2
  98. data/lib/fog/local/models/storage/files.rb +2 -5
  99. data/lib/fog/local/storage.rb +1 -1
  100. data/lib/fog/new_servers/compute.rb +1 -1
  101. data/lib/fog/rackspace/models/compute/flavor.rb +1 -3
  102. data/lib/fog/rackspace/models/compute/flavors.rb +1 -1
  103. data/lib/fog/rackspace/models/compute/image.rb +2 -1
  104. data/lib/fog/rackspace/models/compute/images.rb +1 -1
  105. data/lib/fog/rackspace/models/compute/server.rb +12 -11
  106. data/lib/fog/rackspace/models/compute/servers.rb +1 -1
  107. data/lib/fog/rackspace/models/storage/directories.rb +1 -1
  108. data/lib/fog/rackspace/models/storage/directory.rb +1 -1
  109. data/lib/fog/rackspace/models/storage/file.rb +4 -4
  110. data/lib/fog/rackspace/models/storage/files.rb +1 -1
  111. data/lib/fog/rackspace/requests/compute/create_image.rb +2 -2
  112. data/lib/fog/rackspace/requests/compute/delete_image.rb +1 -1
  113. data/lib/fog/rackspace/requests/compute/delete_server.rb +1 -1
  114. data/lib/fog/rackspace/requests/compute/get_server_details.rb +1 -1
  115. data/lib/fog/rackspace/requests/compute/list_addresses.rb +1 -1
  116. data/lib/fog/rackspace/requests/compute/list_images_detail.rb +2 -2
  117. data/lib/fog/rackspace/requests/compute/list_private_addresses.rb +1 -1
  118. data/lib/fog/rackspace/requests/compute/list_public_addresses.rb +1 -1
  119. data/lib/fog/rackspace/requests/compute/update_server.rb +1 -1
  120. data/lib/fog/rackspace/requests/storage/put_object.rb +4 -3
  121. data/lib/fog/slicehost/models/compute/flavor.rb +1 -1
  122. data/lib/fog/slicehost/models/compute/flavors.rb +1 -1
  123. data/lib/fog/slicehost/models/compute/image.rb +1 -1
  124. data/lib/fog/slicehost/models/compute/images.rb +1 -1
  125. data/lib/fog/slicehost/models/compute/server.rb +3 -1
  126. data/lib/fog/slicehost/models/compute/servers.rb +1 -1
  127. data/lib/fog/terremark/ecloud.rb +34 -33
  128. data/lib/fog/terremark/models/shared/address.rb +1 -1
  129. data/lib/fog/terremark/models/shared/network.rb +1 -1
  130. data/lib/fog/terremark/models/shared/server.rb +1 -1
  131. data/lib/fog/terremark/models/shared/servers.rb +1 -1
  132. data/lib/fog/terremark/models/shared/task.rb +1 -1
  133. data/lib/fog/terremark/models/shared/tasks.rb +1 -1
  134. data/lib/fog/terremark/models/shared/vdc.rb +1 -1
  135. data/lib/fog/terremark/parser.rb +1 -0
  136. data/lib/fog/terremark/vcloud.rb +4 -4
  137. data/lib/fog/vcloud.rb +15 -7
  138. data/lib/fog/vcloud/terremark/ecloud.rb +15 -3
  139. data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +1 -1
  140. data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +1 -1
  141. data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +1 -1
  142. data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +1 -1
  143. data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +1 -1
  144. data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +1 -1
  145. data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +1 -1
  146. data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +1 -1
  147. data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +1 -1
  148. data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +55 -49
  149. data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +19 -15
  150. data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +8 -1
  151. data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +17 -12
  152. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +29 -1
  153. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +38 -2
  154. data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +8 -2
  155. data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +46 -4
  156. data/spec/aws/models/compute/server_spec.rb +2 -0
  157. data/spec/aws/requests/simpledb/select_spec.rb +1 -0
  158. data/spec/spec_helper.rb +1 -1
  159. data/spec/vcloud/spec_helper.rb +1 -1
  160. data/spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb +62 -0
  161. data/spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb +44 -0
  162. data/spec/vcloud/terremark/ecloud/requests/get_customization_options_spec.rb +39 -0
  163. data/spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb +73 -0
  164. data/tests/aws/requests/compute/address_tests.rb +2 -6
  165. data/tests/aws/requests/compute/availability_zone_tests.rb +3 -10
  166. data/tests/aws/requests/compute/image_tests.rb +4 -9
  167. data/tests/aws/requests/compute/instance_tests.rb +7 -8
  168. data/tests/aws/requests/compute/key_pair_tests.rb +2 -6
  169. data/tests/aws/requests/compute/region_tests.rb +2 -9
  170. data/tests/aws/requests/compute/security_group_tests.rb +3 -7
  171. data/tests/aws/requests/compute/snapshot_tests.rb +4 -7
  172. data/tests/aws/requests/compute/tag_tests.rb +49 -0
  173. data/tests/aws/requests/compute/volume_tests.rb +2 -6
  174. data/tests/aws/requests/storage/bucket_tests.rb +48 -0
  175. data/tests/aws/requests/storage/object_tests.rb +63 -0
  176. data/tests/bluebox/requests/compute/block_tests.rb +24 -11
  177. data/tests/bluebox/requests/compute/product_tests.rb +3 -0
  178. data/tests/bluebox/requests/compute/template_tests.rb +3 -0
  179. data/tests/go_grid/helper.rb +0 -0
  180. data/tests/go_grid/requests/compute/image_tests.rb +0 -0
  181. data/tests/helper.rb +5 -1
  182. data/tests/linode/requests/compute/datacenter_tests.rb +1 -0
  183. data/tests/linode/requests/compute/distribution_tests.rb +2 -0
  184. data/tests/linode/requests/compute/linode_tests.rb +6 -0
  185. data/tests/linode/requests/compute/linodeplans_tests.rb +2 -0
  186. data/tests/lorem.txt +1 -0
  187. data/tests/rackspace/requests/compute/flavor_tests.rb +4 -0
  188. data/tests/rackspace/requests/compute/image_tests.rb +12 -4
  189. data/tests/rackspace/requests/compute/server_tests.rb +9 -0
  190. data/tests/slicehost/requests/compute/backup_tests.rb +1 -0
  191. data/tests/slicehost/requests/compute/flavor_tests.rb +3 -0
  192. data/tests/slicehost/requests/compute/image_tests.rb +3 -0
  193. data/tests/slicehost/requests/compute/slice_tests.rb +14 -2
  194. metadata +42 -27
  195. data/spec/aws/requests/storage/delete_bucket_spec.rb +0 -35
  196. data/spec/aws/requests/storage/delete_object_spec.rb +0 -36
  197. data/spec/aws/requests/storage/get_object_spec.rb +0 -58
  198. data/spec/aws/requests/storage/get_service_spec.rb +0 -32
  199. data/spec/aws/requests/storage/head_object_spec.rb +0 -26
  200. data/spec/aws/requests/storage/put_bucket_spec.rb +0 -19
  201. data/spec/aws/requests/storage/put_object_spec.rb +0 -43
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fog (0.3.7)
4
+ fog (0.3.8)
5
5
  builder
6
- excon (>= 0.2.3)
6
+ excon (>= 0.2.4)
7
7
  formatador (>= 0.0.15)
8
8
  json
9
9
  mime-types
@@ -15,7 +15,7 @@ GEM
15
15
  remote: http://rubygems.org/
16
16
  specs:
17
17
  builder (2.1.2)
18
- excon (0.2.3)
18
+ excon (0.2.4)
19
19
  formatador (0.0.15)
20
20
  gestalt (0.0.11)
21
21
  formatador (>= 0.0.12)
@@ -26,7 +26,7 @@ GEM
26
26
  rake (0.8.7)
27
27
  rspec (1.3.0)
28
28
  ruby-hmac (0.4.0)
29
- shindo (0.1.6)
29
+ shindo (0.1.7)
30
30
  formatador (>= 0.0.14)
31
31
  gestalt (>= 0.0.11)
32
32
 
@@ -35,7 +35,7 @@ PLATFORMS
35
35
 
36
36
  DEPENDENCIES
37
37
  builder
38
- excon (>= 0.2.3)
38
+ excon (>= 0.2.4)
39
39
  fog!
40
40
  formatador (>= 0.0.15)
41
41
  json
@@ -45,4 +45,4 @@ DEPENDENCIES
45
45
  rake
46
46
  rspec
47
47
  ruby-hmac
48
- shindo (= 0.1.6)
48
+ shindo (= 0.1.7)
@@ -2,6 +2,12 @@ http://geemus.com/fog.png
2
2
 
3
3
  fog is the Ruby cloud computing library.
4
4
 
5
+ ################################################################################
6
+
7
+ Thursday, October 14, 2010 10:00 am PST, hear it straight from {geemus}[http://github.com/geemus] in the {fog webinar}[http://pages.engineyard.com/FogWebinar.html]
8
+
9
+ ################################################################################
10
+
5
11
  The quick and dirty, top to bottom:
6
12
  * Collections provide a simplified interface, making clouds easier to work with and switch between.
7
13
  * Requests allow power users to get the most out of the features of each individual cloud.
@@ -112,7 +118,7 @@ Enjoy, and let me know what I can do to continue improving fog!
112
118
  * Discuss in irc on the {#ruby-fog}[irc://irc.freenode.net/ruby-fog] channel on Freenode or via email on the {mailing list}[http://groups.google.com/group/ruby-fog]
113
119
  * See upcoming work in the {tracker}[http://www.pivotaltracker.com/projects/54635]
114
120
  * Report bugs in {issues}[http://github.com/geemus/fog/issues]
115
- * Learn about {contributing}[http://wiki.github.com/geemus/fog/contributors-guide]
121
+ * Learn about {contributing}[http://github.com/geemus/fog/wiki/contributor-guide] or find more info about the {Providers}[http://github.com/geemus/fog/wiki/Providers] (including some todo items)
116
122
  * See what already uses fog and add your own stuff to {the list}[http://wiki.github.com/geemus/fog/in-the-wild]
117
123
 
118
124
  == Copyright
data/bin/fog CHANGED
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
- require File.join(File.dirname(__FILE__), '..', 'lib', 'fog')
2
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'fog'))
3
3
  require 'irb'
4
4
  require 'yaml'
5
- require File.join('fog', 'credentials')
5
+ require File.join('fog', 'core', 'credentials')
6
6
  Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
7
7
  Fog.bin = true
8
+ Fog.mock! if ENV['FOG_MOCK']
8
9
  unless Fog.credentials
9
10
  exit
10
11
  end
11
12
 
12
- require 'fog/bin'
13
+ require 'fog/core/bin'
13
14
 
14
15
  if ARGV.length > 1
15
16
  print(instance_eval(ARGV[1..-1].join(' ')).to_json)
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'fog'
10
- s.version = '0.3.7'
11
- s.date = '2010-09-29'
10
+ s.version = '0.3.8'
11
+ s.date = '2010-10-14'
12
12
  s.rubyforge_project = 'fog'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  ## List your runtime dependencies here. Runtime dependencies are those
44
44
  ## that are needed for an end user to actually USE your code.
45
45
  s.add_dependency('builder')
46
- s.add_dependency('excon', '>=0.2.3')
46
+ s.add_dependency('excon', '>=0.2.4')
47
47
  s.add_dependency('formatador', '>=0.0.15')
48
48
  s.add_dependency('json')
49
49
  s.add_dependency('mime-types')
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
55
55
  ## those that are only needed during development
56
56
  s.add_development_dependency('rake')
57
57
  s.add_development_dependency('rspec')
58
- s.add_development_dependency('shindo', '0.1.6')
58
+ s.add_development_dependency('shindo', '0.1.7')
59
59
 
60
60
  ## Leave this section as-is. It will be automatically generated from the
61
61
  ## contents of your Git repository via the gemspec task. DO NOT REMOVE
@@ -73,7 +73,6 @@ Gem::Specification.new do |s|
73
73
  examples/bluebox_create.rb
74
74
  fog.gemspec
75
75
  lib/fog.rb
76
- lib/fog/attributes.rb
77
76
  lib/fog/aws.rb
78
77
  lib/fog/aws/bin.rb
79
78
  lib/fog/aws/compute.rb
@@ -93,6 +92,8 @@ Gem::Specification.new do |s|
93
92
  lib/fog/aws/models/compute/servers.rb
94
93
  lib/fog/aws/models/compute/snapshot.rb
95
94
  lib/fog/aws/models/compute/snapshots.rb
95
+ lib/fog/aws/models/compute/tag.rb
96
+ lib/fog/aws/models/compute/tags.rb
96
97
  lib/fog/aws/models/compute/volume.rb
97
98
  lib/fog/aws/models/compute/volumes.rb
98
99
  lib/fog/aws/models/storage/directories.rb
@@ -116,6 +117,7 @@ Gem::Specification.new do |s|
116
117
  lib/fog/aws/parsers/compute/describe_reserved_instances.rb
117
118
  lib/fog/aws/parsers/compute/describe_security_groups.rb
118
119
  lib/fog/aws/parsers/compute/describe_snapshots.rb
120
+ lib/fog/aws/parsers/compute/describe_tags.rb
119
121
  lib/fog/aws/parsers/compute/describe_volumes.rb
120
122
  lib/fog/aws/parsers/compute/detach_volume.rb
121
123
  lib/fog/aws/parsers/compute/get_console_output.rb
@@ -154,10 +156,12 @@ Gem::Specification.new do |s|
154
156
  lib/fog/aws/requests/compute/create_key_pair.rb
155
157
  lib/fog/aws/requests/compute/create_security_group.rb
156
158
  lib/fog/aws/requests/compute/create_snapshot.rb
159
+ lib/fog/aws/requests/compute/create_tags.rb
157
160
  lib/fog/aws/requests/compute/create_volume.rb
158
161
  lib/fog/aws/requests/compute/delete_key_pair.rb
159
162
  lib/fog/aws/requests/compute/delete_security_group.rb
160
163
  lib/fog/aws/requests/compute/delete_snapshot.rb
164
+ lib/fog/aws/requests/compute/delete_tags.rb
161
165
  lib/fog/aws/requests/compute/delete_volume.rb
162
166
  lib/fog/aws/requests/compute/deregister_image.rb
163
167
  lib/fog/aws/requests/compute/describe_addresses.rb
@@ -169,6 +173,7 @@ Gem::Specification.new do |s|
169
173
  lib/fog/aws/requests/compute/describe_reserved_instances.rb
170
174
  lib/fog/aws/requests/compute/describe_security_groups.rb
171
175
  lib/fog/aws/requests/compute/describe_snapshots.rb
176
+ lib/fog/aws/requests/compute/describe_tags.rb
172
177
  lib/fog/aws/requests/compute/describe_volumes.rb
173
178
  lib/fog/aws/requests/compute/detach_volume.rb
174
179
  lib/fog/aws/requests/compute/disassociate_address.rb
@@ -227,7 +232,6 @@ Gem::Specification.new do |s|
227
232
  lib/fog/aws/s3.rb
228
233
  lib/fog/aws/simpledb.rb
229
234
  lib/fog/aws/storage.rb
230
- lib/fog/bin.rb
231
235
  lib/fog/bluebox.rb
232
236
  lib/fog/bluebox/bin.rb
233
237
  lib/fog/bluebox/compute.rb
@@ -246,15 +250,29 @@ Gem::Specification.new do |s|
246
250
  lib/fog/bluebox/requests/compute/get_template.rb
247
251
  lib/fog/bluebox/requests/compute/get_templates.rb
248
252
  lib/fog/bluebox/requests/compute/reboot_block.rb
249
- lib/fog/collection.rb
250
- lib/fog/connection.rb
251
- lib/fog/credentials.rb
252
- lib/fog/deprecation.rb
253
- lib/fog/errors.rb
253
+ lib/fog/core.rb
254
+ lib/fog/core/attributes.rb
255
+ lib/fog/core/bin.rb
256
+ lib/fog/core/collection.rb
257
+ lib/fog/core/connection.rb
258
+ lib/fog/core/credentials.rb
259
+ lib/fog/core/deprecation.rb
260
+ lib/fog/core/errors.rb
261
+ lib/fog/core/hmac.rb
262
+ lib/fog/core/model.rb
263
+ lib/fog/core/parser.rb
264
+ lib/fog/core/provider.rb
265
+ lib/fog/core/service.rb
266
+ lib/fog/core/ssh.rb
254
267
  lib/fog/go_grid.rb
255
268
  lib/fog/go_grid/bin.rb
256
269
  lib/fog/go_grid/compute.rb
270
+ lib/fog/go_grid/models/compute/image.rb
271
+ lib/fog/go_grid/models/compute/images.rb
272
+ lib/fog/go_grid/models/compute/server.rb
273
+ lib/fog/go_grid/models/compute/servers.rb
257
274
  lib/fog/go_grid/requests/compute/common_lookup_list.rb
275
+ lib/fog/go_grid/requests/compute/grid_image_get.rb
258
276
  lib/fog/go_grid/requests/compute/grid_image_list.rb
259
277
  lib/fog/go_grid/requests/compute/grid_ip_list.rb
260
278
  lib/fog/go_grid/requests/compute/grid_loadbalancer_list.rb
@@ -293,7 +311,6 @@ Gem::Specification.new do |s|
293
311
  lib/fog/google/requests/storage/put_object.rb
294
312
  lib/fog/google/requests/storage/put_object_url.rb
295
313
  lib/fog/google/storage.rb
296
- lib/fog/hmac.rb
297
314
  lib/fog/linode.rb
298
315
  lib/fog/linode/bin.rb
299
316
  lib/fog/linode/compute.rb
@@ -313,7 +330,6 @@ Gem::Specification.new do |s|
313
330
  lib/fog/local/models/storage/file.rb
314
331
  lib/fog/local/models/storage/files.rb
315
332
  lib/fog/local/storage.rb
316
- lib/fog/model.rb
317
333
  lib/fog/new_servers.rb
318
334
  lib/fog/new_servers/bin.rb
319
335
  lib/fog/new_servers/compute.rb
@@ -324,8 +340,6 @@ Gem::Specification.new do |s|
324
340
  lib/fog/new_servers/requests/compute/list_plans.rb
325
341
  lib/fog/new_servers/requests/compute/list_servers.rb
326
342
  lib/fog/new_servers/requests/compute/reboot_server.rb
327
- lib/fog/parser.rb
328
- lib/fog/provider.rb
329
343
  lib/fog/rackspace.rb
330
344
  lib/fog/rackspace/bin.rb
331
345
  lib/fog/rackspace/compute.rb
@@ -370,7 +384,6 @@ Gem::Specification.new do |s|
370
384
  lib/fog/rackspace/requests/storage/put_object.rb
371
385
  lib/fog/rackspace/servers.rb
372
386
  lib/fog/rackspace/storage.rb
373
- lib/fog/service.rb
374
387
  lib/fog/slicehost.rb
375
388
  lib/fog/slicehost/bin.rb
376
389
  lib/fog/slicehost/compute.rb
@@ -398,7 +411,6 @@ Gem::Specification.new do |s|
398
411
  lib/fog/slicehost/requests/compute/get_slice.rb
399
412
  lib/fog/slicehost/requests/compute/get_slices.rb
400
413
  lib/fog/slicehost/requests/compute/reboot_slice.rb
401
- lib/fog/ssh.rb
402
414
  lib/fog/terremark.rb
403
415
  lib/fog/terremark/bin.rb
404
416
  lib/fog/terremark/ecloud.rb
@@ -558,16 +570,9 @@ Gem::Specification.new do |s|
558
570
  spec/aws/requests/simpledb/put_attributes_spec.rb
559
571
  spec/aws/requests/simpledb/select_spec.rb
560
572
  spec/aws/requests/storage/copy_object_spec.rb
561
- spec/aws/requests/storage/delete_bucket_spec.rb
562
- spec/aws/requests/storage/delete_object_spec.rb
563
573
  spec/aws/requests/storage/get_bucket_location_spec.rb
564
574
  spec/aws/requests/storage/get_bucket_spec.rb
565
- spec/aws/requests/storage/get_object_spec.rb
566
575
  spec/aws/requests/storage/get_request_payment_spec.rb
567
- spec/aws/requests/storage/get_service_spec.rb
568
- spec/aws/requests/storage/head_object_spec.rb
569
- spec/aws/requests/storage/put_bucket_spec.rb
570
- spec/aws/requests/storage/put_object_spec.rb
571
576
  spec/aws/requests/storage/put_request_payment_spec.rb
572
577
  spec/bluebox/models/compute/flavors_spec.rb
573
578
  spec/bluebox/models/compute/server_spec.rb
@@ -634,6 +639,9 @@ Gem::Specification.new do |s|
634
639
  spec/vcloud/terremark/ecloud/requests/configure_node_spec.rb
635
640
  spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb
636
641
  spec/vcloud/terremark/ecloud/requests/delete_node_spec.rb
642
+ spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb
643
+ spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb
644
+ spec/vcloud/terremark/ecloud/requests/get_customization_options_spec.rb
637
645
  spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb
638
646
  spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb
639
647
  spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb
@@ -643,6 +651,7 @@ Gem::Specification.new do |s|
643
651
  spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb
644
652
  spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb
645
653
  spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb
654
+ spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb
646
655
  spec/vcloud/terremark/ecloud/requests/login_spec.rb
647
656
  spec/vcloud/vcloud_spec.rb
648
657
  tests/aws/helper.rb
@@ -655,11 +664,16 @@ Gem::Specification.new do |s|
655
664
  tests/aws/requests/compute/region_tests.rb
656
665
  tests/aws/requests/compute/security_group_tests.rb
657
666
  tests/aws/requests/compute/snapshot_tests.rb
667
+ tests/aws/requests/compute/tag_tests.rb
658
668
  tests/aws/requests/compute/volume_tests.rb
669
+ tests/aws/requests/storage/bucket_tests.rb
670
+ tests/aws/requests/storage/object_tests.rb
659
671
  tests/bluebox/helper.rb
660
672
  tests/bluebox/requests/compute/block_tests.rb
661
673
  tests/bluebox/requests/compute/product_tests.rb
662
674
  tests/bluebox/requests/compute/template_tests.rb
675
+ tests/go_grid/helper.rb
676
+ tests/go_grid/requests/compute/image_tests.rb
663
677
  tests/helper.rb
664
678
  tests/helper_tests.rb
665
679
  tests/helpers/model_helper.rb
@@ -668,6 +682,7 @@ Gem::Specification.new do |s|
668
682
  tests/linode/requests/compute/distribution_tests.rb
669
683
  tests/linode/requests/compute/linode_tests.rb
670
684
  tests/linode/requests/compute/linodeplans_tests.rb
685
+ tests/lorem.txt
671
686
  tests/rackspace/helper.rb
672
687
  tests/rackspace/requests/compute/address_tests.rb
673
688
  tests/rackspace/requests/compute/flavor_tests.rb
data/lib/fog.rb CHANGED
@@ -17,22 +17,14 @@ $LOAD_PATH.unshift __DIR__ unless
17
17
  $LOAD_PATH.include?(__DIR__) ||
18
18
  $LOAD_PATH.include?(File.expand_path(__DIR__))
19
19
 
20
- require 'fog/attributes'
21
- require 'fog/collection'
22
- require 'fog/connection'
23
- require 'fog/deprecation'
24
- require 'fog/errors'
25
- require 'fog/hmac'
26
- require 'fog/model'
27
- require 'fog/parser'
28
- require 'fog/provider'
29
- require 'fog/service'
30
- require 'fog/ssh'
20
+ require 'fog/core'
31
21
 
32
22
  module Fog
33
23
 
24
+ @mocking = false
25
+
34
26
  unless const_defined?(:VERSION)
35
- VERSION = '0.3.7'
27
+ VERSION = '0.3.8'
36
28
  end
37
29
 
38
30
  module Mock
@@ -22,6 +22,19 @@ module Fog
22
22
  params
23
23
  end
24
24
 
25
+ def self.indexed_filters(filters)
26
+ params = {}
27
+ filters.keys.each_with_index do |key, key_index|
28
+ key_index += 1
29
+ params[format('Filter.%d.Name', key_index)] = key
30
+ [*filters[key]].each_with_index do |value, value_index|
31
+ value_index += 1
32
+ params[format('Filter.%d.Value.%d', key_index, value_index)] = value
33
+ end
34
+ end
35
+ params
36
+ end
37
+
25
38
  def self.signed_params(params, options = {})
26
39
  params.merge!({
27
40
  'AWSAccessKeyId' => options[:aws_access_key_id],
@@ -37,7 +50,7 @@ module Fog
37
50
  body << "#{key}=#{CGI.escape(value.to_s).gsub(/\+/, '%20')}&"
38
51
  end
39
52
  end
40
- string_to_sign = "POST\n#{options[:host]}\n/\n" << body.chop
53
+ string_to_sign = "POST\n#{options[:host]}\n#{options[:path]}\n" << body.chop
41
54
  signed_string = options[:hmac].sign(string_to_sign)
42
55
  body << "Signature=#{CGI.escape(Base64.encode64(signed_string).chomp!).gsub(/\+/, '%20')}"
43
56
 
@@ -100,10 +113,6 @@ module Fog
100
113
  fingerprint.join(':')
101
114
  end
102
115
 
103
- def self.image_id
104
- "ami-#{hex(8)}"
105
- end
106
-
107
116
  def self.instance_id
108
117
  "i-#{hex(8)}"
109
118
  end
@@ -19,6 +19,8 @@ module Fog
19
19
  collection :servers
20
20
  model :snapshot
21
21
  collection :snapshots
22
+ model :tag
23
+ collection :tags
22
24
  model :volume
23
25
  collection :volumes
24
26
 
@@ -29,14 +31,16 @@ module Fog
29
31
  request :associate_address
30
32
  request :attach_volume
31
33
  request :authorize_security_group_ingress
34
+ request :create_image
32
35
  request :create_key_pair
33
36
  request :create_security_group
34
37
  request :create_snapshot
35
- request :create_image
38
+ request :create_tags
36
39
  request :create_volume
37
40
  request :delete_key_pair
38
41
  request :delete_security_group
39
42
  request :delete_snapshot
43
+ request :delete_tags
40
44
  request :delete_volume
41
45
  request :deregister_image
42
46
  request :describe_addresses
@@ -48,6 +52,7 @@ module Fog
48
52
  request :describe_regions
49
53
  request :describe_security_groups
50
54
  request :describe_snapshots
55
+ request :describe_tags
51
56
  request :describe_volumes
52
57
  request :detach_volume
53
58
  request :disassociate_address
@@ -69,10 +74,11 @@ module Fog
69
74
  def self.data
70
75
  @data ||= Hash.new do |hash, region|
71
76
  owner_id = Fog::AWS::Mock.owner_id
72
- hash[region] = Hash.new do |hash, key|
73
- hash[key] = {
77
+ hash[region] = Hash.new do |region_hash, key|
78
+ region_hash[key] = {
74
79
  :deleted_at => {},
75
80
  :addresses => {},
81
+ :images => {},
76
82
  :instances => {},
77
83
  :key_pairs => {},
78
84
  :limits => { :addresses => 5 },
@@ -108,7 +114,8 @@ module Fog
108
114
  }
109
115
  },
110
116
  :snapshots => {},
111
- :volumes => {}
117
+ :volumes => {},
118
+ :tags => {}
112
119
  }
113
120
  end
114
121
  end
@@ -153,8 +160,15 @@ module Fog
153
160
  @aws_access_key_id = options[:aws_access_key_id]
154
161
  @aws_secret_access_key = options[:aws_secret_access_key]
155
162
  @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
156
- options[:region] ||= 'us-east-1'
157
- @host = options[:host] || case options[:region]
163
+ if @endpoint = options[:endpoint]
164
+ endpoint = URI.parse(@endpoint)
165
+ @host = endpoint.host
166
+ @path = endpoint.path
167
+ @port = endpoint.port
168
+ @scheme = endpoint.scheme
169
+ else
170
+ options[:region] ||= 'us-east-1'
171
+ @host = options[:host] || case options[:region]
158
172
  when 'ap-southeast-1'
159
173
  'ec2.ap-southeast-1.amazonaws.com'
160
174
  when 'eu-west-1'
@@ -166,9 +180,11 @@ module Fog
166
180
  else
167
181
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
168
182
  end
169
- @port = options[:port] || 443
170
- @scheme = options[:scheme] || 'https'
171
- @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
183
+ @path = options[:path] || '/'
184
+ @port = options[:port] || 443
185
+ @scheme = options[:scheme] || 'https'
186
+ end
187
+ @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
172
188
  end
173
189
 
174
190
  def reload
@@ -187,6 +203,7 @@ module Fog
187
203
  :aws_access_key_id => @aws_access_key_id,
188
204
  :hmac => @hmac,
189
205
  :host => @host,
206
+ :path => @path,
190
207
  :version => '2010-08-31'
191
208
  }
192
209
  )