fog 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +1 -0
  3. data/Rakefile +2 -1
  4. data/changelog.txt +184 -0
  5. data/docs/cdn/index.markdown +69 -3
  6. data/fog.gemspec +2 -2
  7. data/lib/fog.rb +2 -1
  8. data/lib/fog/atmos/models/storage/file.rb +16 -14
  9. data/lib/fog/aws/auto_scaling.rb +55 -13
  10. data/lib/fog/aws/cdn.rb +69 -9
  11. data/lib/fog/aws/cloud_watch.rb +15 -1
  12. data/lib/fog/aws/compute.rb +2 -0
  13. data/lib/fog/aws/models/auto_scaling/group.rb +10 -4
  14. data/lib/fog/aws/models/cdn/distribution.rb +93 -0
  15. data/lib/fog/aws/models/cdn/distribution_helper.rb +64 -0
  16. data/lib/fog/aws/models/cdn/distributions.rb +32 -0
  17. data/lib/fog/aws/models/cdn/distributions_helper.rb +47 -0
  18. data/lib/fog/aws/models/cdn/invalidation.rb +64 -0
  19. data/lib/fog/aws/models/cdn/invalidations.rb +54 -0
  20. data/lib/fog/aws/models/cdn/streaming_distribution.rb +77 -0
  21. data/lib/fog/aws/models/cdn/streaming_distributions.rb +32 -0
  22. data/lib/fog/aws/models/compute/server.rb +0 -23
  23. data/lib/fog/aws/models/compute/spot_request.rb +2 -24
  24. data/lib/fog/aws/models/rds/server.rb +18 -0
  25. data/lib/fog/aws/models/rds/subnet_group.rb +20 -0
  26. data/lib/fog/aws/models/rds/subnet_groups.rb +27 -0
  27. data/lib/fog/aws/models/storage/file.rb +1 -1
  28. data/lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb +15 -2
  29. data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +39 -13
  30. data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_notification_types.rb +43 -0
  31. data/lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb +3 -3
  32. data/lib/fog/aws/parsers/auto_scaling/describe_notification_configurations.rb +42 -0
  33. data/lib/fog/aws/parsers/auto_scaling/describe_scaling_process_types.rb +15 -2
  34. data/lib/fog/aws/parsers/auto_scaling/describe_tags.rb +46 -0
  35. data/lib/fog/aws/parsers/auto_scaling/describe_termination_policy_types.rb +44 -0
  36. data/lib/fog/aws/parsers/cdn/get_invalidation.rb +32 -0
  37. data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +1 -1
  38. data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +1 -1
  39. data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +13 -2
  40. data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +1 -1
  41. data/lib/fog/aws/parsers/elasticache/base.rb +0 -2
  42. data/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb +1 -1
  43. data/lib/fog/aws/parsers/elasticache/event_list.rb +2 -0
  44. data/lib/fog/aws/parsers/rds/base.rb +32 -0
  45. data/lib/fog/aws/parsers/rds/create_db_subnet_group.rb +38 -0
  46. data/lib/fog/aws/parsers/rds/describe_db_subnet_groups.rb +38 -0
  47. data/lib/fog/aws/parsers/rds/event_list.rb +40 -0
  48. data/lib/fog/aws/parsers/rds/subnet_group_parser.rb +38 -0
  49. data/lib/fog/aws/parsers/rds/tag_list_parser.rb +35 -0
  50. data/lib/fog/aws/rds.rb +24 -7
  51. data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +36 -16
  52. data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +19 -12
  53. data/lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb +63 -0
  54. data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +10 -3
  55. data/lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb +21 -5
  56. data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +2 -2
  57. data/lib/fog/aws/requests/auto_scaling/delete_tags.rb +63 -0
  58. data/lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb +4 -3
  59. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +17 -13
  60. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +1 -1
  61. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_notification_types.rb +55 -0
  62. data/lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb +6 -5
  63. data/lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb +79 -0
  64. data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +1 -1
  65. data/lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb +4 -3
  66. data/lib/fog/aws/requests/auto_scaling/describe_tags.rb +74 -0
  67. data/lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb +53 -0
  68. data/lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb +1 -1
  69. data/lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb +2 -2
  70. data/lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb +30 -11
  71. data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +4 -4
  72. data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +8 -5
  73. data/lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb +2 -2
  74. data/lib/fog/aws/requests/auto_scaling/set_instance_health.rb +2 -2
  75. data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +1 -1
  76. data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +30 -18
  77. data/lib/fog/aws/requests/cdn/delete_distribution.rb +31 -0
  78. data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +30 -0
  79. data/lib/fog/aws/requests/cdn/get_distribution.rb +28 -0
  80. data/lib/fog/aws/requests/cdn/get_distribution_list.rb +29 -0
  81. data/lib/fog/aws/requests/cdn/get_invalidation.rb +60 -0
  82. data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +41 -0
  83. data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +26 -0
  84. data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +30 -0
  85. data/lib/fog/aws/requests/cdn/post_distribution.rb +44 -0
  86. data/lib/fog/aws/requests/cdn/post_invalidation.rb +33 -0
  87. data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +44 -0
  88. data/lib/fog/aws/requests/cdn/put_distribution_config.rb +28 -0
  89. data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +28 -0
  90. data/lib/fog/aws/requests/compute/create_image.rb +32 -5
  91. data/lib/fog/aws/requests/compute/create_subnet.rb +3 -3
  92. data/lib/fog/aws/requests/compute/create_volume.rb +2 -2
  93. data/lib/fog/aws/requests/compute/register_image.rb +1 -1
  94. data/lib/fog/aws/requests/elasticache/describe_events.rb +7 -4
  95. data/lib/fog/aws/requests/glacier/create_archive.rb +1 -1
  96. data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +1 -1
  97. data/lib/fog/aws/requests/rds/add_tags_to_resource.rb +46 -0
  98. data/lib/fog/aws/requests/rds/create_db_instance.rb +2 -0
  99. data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +58 -0
  100. data/lib/fog/aws/requests/rds/describe_db_subnet_groups.rb +63 -0
  101. data/lib/fog/aws/requests/rds/describe_events.rb +52 -0
  102. data/lib/fog/aws/requests/rds/list_tags_for_resource.rb +44 -0
  103. data/lib/fog/aws/requests/rds/remove_tags_from_resource.rb +44 -0
  104. data/lib/fog/aws/sqs.rb +1 -1
  105. data/lib/fog/aws/storage.rb +1 -1
  106. data/lib/fog/bin/openstack.rb +5 -0
  107. data/lib/fog/bluebox/models/compute/server.rb +0 -19
  108. data/lib/fog/bluebox/requests/compute/create_block.rb +8 -8
  109. data/lib/fog/brightbox/compute.rb +56 -7
  110. data/lib/fog/brightbox/models/compute/accounts.rb +29 -0
  111. data/lib/fog/brightbox/models/compute/api_client.rb +37 -0
  112. data/lib/fog/brightbox/models/compute/api_clients.rb +24 -0
  113. data/lib/fog/brightbox/models/compute/application.rb +27 -0
  114. data/lib/fog/brightbox/models/compute/applications.rb +28 -0
  115. data/lib/fog/brightbox/models/compute/server.rb +3 -1
  116. data/lib/fog/brightbox/models/compute/users.rb +1 -3
  117. data/lib/fog/brightbox/requests/compute/create_application.rb +13 -0
  118. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +2 -2
  119. data/lib/fog/brightbox/requests/compute/destroy_application.rb +14 -0
  120. data/lib/fog/brightbox/requests/compute/get_account.rb +28 -4
  121. data/lib/fog/brightbox/requests/compute/get_application.rb +14 -0
  122. data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +19 -0
  123. data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +19 -0
  124. data/lib/fog/brightbox/requests/compute/get_user.rb +28 -5
  125. data/lib/fog/brightbox/requests/compute/list_accounts.rb +13 -0
  126. data/lib/fog/brightbox/requests/compute/list_applications.rb +13 -0
  127. data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +14 -0
  128. data/lib/fog/brightbox/requests/compute/update_account.rb +51 -3
  129. data/lib/fog/brightbox/requests/compute/update_application.rb +15 -0
  130. data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +4 -2
  131. data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +37 -0
  132. data/lib/fog/clodo/models/compute/server.rb +7 -44
  133. data/lib/fog/compute/models/server.rb +23 -2
  134. data/lib/fog/core/time.rb +2 -0
  135. data/lib/fog/core/wait_for.rb +0 -2
  136. data/lib/fog/ecloud/models/compute/servers.rb +3 -1
  137. data/lib/fog/ecloud/requests/compute/get_servers.rb +1 -1
  138. data/lib/fog/ecloud/requests/compute/get_tasks.rb +1 -1
  139. data/lib/fog/go_grid/models/compute/server.rb +0 -4
  140. data/lib/fog/google/storage.rb +1 -1
  141. data/lib/fog/hp/models/compute/server.rb +1 -23
  142. data/lib/fog/hp/storage.rb +0 -1
  143. data/lib/fog/joyent/models/compute/server.rb +4 -0
  144. data/lib/fog/joyent/models/compute/servers.rb +4 -3
  145. data/lib/fog/libvirt/models/compute/server.rb +1 -27
  146. data/lib/fog/linode/models/compute/server.rb +0 -1
  147. data/lib/fog/local/models/storage/directory.rb +1 -1
  148. data/lib/fog/network.rb +26 -0
  149. data/lib/fog/ninefold/compute.rb +8 -0
  150. data/lib/fog/ninefold/requests/compute/assign_to_load_balancer_rule.rb +13 -0
  151. data/lib/fog/ninefold/requests/compute/create_load_balancer_rule.rb +11 -0
  152. data/lib/fog/ninefold/requests/compute/delete_load_balancer_rule.rb +11 -0
  153. data/lib/fog/ninefold/requests/compute/list_load_balancer_rule_instances.rb +15 -0
  154. data/lib/fog/ninefold/requests/compute/list_load_balancer_rules.rb +14 -0
  155. data/lib/fog/ninefold/requests/compute/remove_from_load_balancer_rule.rb +12 -0
  156. data/lib/fog/ninefold/requests/compute/update_load_balancer_rule.rb +15 -0
  157. data/lib/fog/ninefold/storage.rb +14 -112
  158. data/lib/fog/openstack.rb +4 -1
  159. data/lib/fog/openstack/compute.rb +20 -1
  160. data/lib/fog/openstack/identity.rb +67 -18
  161. data/lib/fog/openstack/image.rb +12 -4
  162. data/lib/fog/openstack/models/compute/security_group.rb +1 -1
  163. data/lib/fog/openstack/models/compute/server.rb +5 -23
  164. data/lib/fog/openstack/models/identity/tenants.rb +5 -3
  165. data/lib/fog/openstack/models/identity/users.rb +4 -1
  166. data/lib/fog/openstack/models/image/image.rb +6 -1
  167. data/lib/fog/openstack/models/network/network.rb +46 -0
  168. data/lib/fog/openstack/models/network/networks.rb +34 -0
  169. data/lib/fog/openstack/models/network/port.rb +52 -0
  170. data/lib/fog/openstack/models/network/ports.rb +34 -0
  171. data/lib/fog/openstack/models/network/subnet.rb +55 -0
  172. data/lib/fog/openstack/models/network/subnets.rb +34 -0
  173. data/lib/fog/openstack/network.rb +234 -0
  174. data/lib/fog/openstack/requests/compute/attach_volume.rb +10 -0
  175. data/lib/fog/openstack/requests/compute/create_security_group.rb +15 -11
  176. data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +17 -15
  177. data/lib/fog/openstack/requests/compute/create_server.rb +7 -1
  178. data/lib/fog/openstack/requests/compute/create_volume.rb +10 -10
  179. data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +16 -1
  180. data/lib/fog/openstack/requests/compute/detach_volume.rb +5 -0
  181. data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +4 -4
  182. data/lib/fog/openstack/requests/compute/get_volume_details.rb +9 -9
  183. data/lib/fog/openstack/requests/compute/list_security_groups.rb +3 -3
  184. data/lib/fog/openstack/requests/compute/list_volumes.rb +14 -14
  185. data/lib/fog/openstack/requests/identity/create_tenant.rb +3 -3
  186. data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
  187. data/lib/fog/openstack/requests/identity/delete_role.rb +1 -1
  188. data/lib/fog/openstack/requests/identity/get_tenant.rb +1 -1
  189. data/lib/fog/openstack/requests/identity/list_roles.rb +7 -0
  190. data/lib/fog/openstack/requests/image/create_image.rb +36 -38
  191. data/lib/fog/openstack/requests/image/delete_image.rb +0 -2
  192. data/lib/fog/openstack/requests/image/list_public_images.rb +7 -25
  193. data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +2 -41
  194. data/lib/fog/openstack/requests/image/update_image.rb +26 -21
  195. data/lib/fog/openstack/requests/image/update_image_members.rb +37 -0
  196. data/lib/fog/openstack/requests/network/create_network.rb +44 -0
  197. data/lib/fog/openstack/requests/network/create_port.rb +52 -0
  198. data/lib/fog/openstack/requests/network/create_subnet.rb +56 -0
  199. data/lib/fog/openstack/requests/network/delete_network.rb +30 -0
  200. data/lib/fog/openstack/requests/network/delete_port.rb +30 -0
  201. data/lib/fog/openstack/requests/network/delete_subnet.rb +30 -0
  202. data/lib/fog/openstack/requests/network/get_network.rb +42 -0
  203. data/lib/fog/openstack/requests/network/get_port.rb +48 -0
  204. data/lib/fog/openstack/requests/network/get_subnet.rb +49 -0
  205. data/lib/fog/openstack/requests/network/list_networks.rb +27 -0
  206. data/lib/fog/openstack/requests/network/list_ports.rb +27 -0
  207. data/lib/fog/openstack/requests/network/list_subnets.rb +27 -0
  208. data/lib/fog/openstack/requests/network/set_tenant.rb +21 -0
  209. data/lib/fog/openstack/requests/network/update_network.rb +41 -0
  210. data/lib/fog/openstack/requests/network/update_port.rb +44 -0
  211. data/lib/fog/openstack/requests/network/update_subnet.rb +44 -0
  212. data/lib/fog/openstack/requests/volume/create_volume.rb +10 -10
  213. data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +16 -1
  214. data/lib/fog/openstack/requests/volume/get_snapshot_details.rb +6 -6
  215. data/lib/fog/openstack/requests/volume/get_volume_details.rb +10 -10
  216. data/lib/fog/openstack/requests/volume/list_volumes.rb +14 -14
  217. data/lib/fog/openstack/volume.rb +10 -0
  218. data/lib/fog/rackspace/models/compute/server.rb +1 -24
  219. data/lib/fog/rackspace/models/compute_v2/server.rb +4 -2
  220. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +1 -1
  221. data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +1 -1
  222. data/lib/fog/storm_on_demand/models/compute/server.rb +1 -5
  223. data/lib/fog/virtual_box/models/compute/server.rb +2 -44
  224. data/lib/fog/vmfusion/models/compute/server.rb +3 -36
  225. data/lib/fog/vsphere/models/compute/server.rb +1 -1
  226. data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +2 -31
  227. data/lib/fog/vsphere/requests/compute/vm_clone.rb +35 -7
  228. data/tests/aws/models/cdn/distribution_tests.rb +15 -0
  229. data/tests/aws/models/cdn/distributions_tests.rb +15 -0
  230. data/tests/aws/models/cdn/invalidation_tests.rb +32 -0
  231. data/tests/aws/models/cdn/invalidations_tests.rb +15 -0
  232. data/tests/aws/models/cdn/streaming_distribution_tests.rb +15 -0
  233. data/tests/aws/models/cdn/streaming_distributions_tests.rb +15 -0
  234. data/tests/aws/models/rds/tagging_tests.rb +20 -0
  235. data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +1 -11
  236. data/tests/aws/requests/auto_scaling/describe_types_tests.rb +102 -0
  237. data/tests/aws/requests/auto_scaling/helper.rb +47 -3
  238. data/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +123 -0
  239. data/tests/aws/requests/auto_scaling/tag_tests.rb +62 -0
  240. data/tests/aws/requests/cdn/cdn_tests.rb +252 -0
  241. data/tests/aws/requests/compute/image_tests.rb +32 -1
  242. data/tests/aws/requests/compute/volume_tests.rb +3 -3
  243. data/tests/aws/requests/rds/describe_events.rb +16 -0
  244. data/tests/aws/requests/rds/helper.rb +26 -0
  245. data/tests/aws/requests/rds/subnet_groups_test.rb +48 -0
  246. data/tests/aws/requests/rds/tagging_tests.rb +78 -0
  247. data/tests/brightbox/requests/compute/account_tests.rb +24 -4
  248. data/tests/brightbox/requests/compute/application_test.rb +63 -0
  249. data/tests/brightbox/requests/compute/helper.rb +49 -1
  250. data/tests/helper.rb +4 -1
  251. data/tests/local/models/directory_tests.rb +16 -0
  252. data/tests/ninefold/requests/compute/helper.rb +53 -0
  253. data/tests/ninefold/requests/compute/load_balancer_tests.rb +66 -0
  254. data/tests/openstack/models/image/image_tests.rb +1 -0
  255. data/tests/openstack/models/network/network_tests.rb +24 -0
  256. data/tests/openstack/models/network/networks_tests.rb +21 -0
  257. data/tests/openstack/models/network/port_tests.rb +28 -0
  258. data/tests/openstack/models/network/ports_tests.rb +25 -0
  259. data/tests/openstack/models/network/subnet_tests.rb +30 -0
  260. data/tests/openstack/models/network/subnets_tests.rb +27 -0
  261. data/tests/openstack/requests/compute/image_tests.rb +3 -4
  262. data/tests/openstack/requests/compute/quota_tests.rb +2 -0
  263. data/tests/openstack/requests/compute/security_group_tests.rb +10 -10
  264. data/tests/openstack/requests/compute/server_tests.rb +3 -1
  265. data/tests/openstack/requests/compute/volume_tests.rb +11 -12
  266. data/tests/openstack/requests/identity/tenant_tests.rb +2 -1
  267. data/tests/openstack/requests/image/image_tests.rb +66 -45
  268. data/tests/openstack/requests/network/network_tests.rb +56 -0
  269. data/tests/openstack/requests/network/port_tests.rb +63 -0
  270. data/tests/openstack/requests/network/subnet_tests.rb +66 -0
  271. data/tests/rackspace/models/identity/user_tests.rb +1 -1
  272. data/tests/rackspace/models/identity/users_tests.rb +1 -1
  273. metadata +137 -13
  274. data/lib/fog/ninefold/models/storage/directories.rb +0 -48
  275. data/lib/fog/ninefold/models/storage/directory.rb +0 -53
  276. data/lib/fog/ninefold/models/storage/file.rb +0 -108
  277. data/lib/fog/ninefold/models/storage/files.rb +0 -73
  278. data/lib/fog/ninefold/requests/storage/delete_namespace.rb +0 -19
  279. data/lib/fog/ninefold/requests/storage/get_namespace.rb +0 -20
  280. data/lib/fog/ninefold/requests/storage/head_namespace.rb +0 -20
  281. data/lib/fog/ninefold/requests/storage/post_namespace.rb +0 -20
  282. data/lib/fog/ninefold/requests/storage/put_namespace.rb +0 -20
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  .bundle
7
7
  .DS_Store
8
8
  .idea
9
+ /tests/.fog
9
10
  bin/*
10
11
  !bin/fog
11
12
  !bin/rdoc
data/README.md CHANGED
@@ -114,6 +114,7 @@ geemus says: "That should give you everything you need to get started, but let m
114
114
 
115
115
  * Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the [issues](https://github.com/fog/fog/issues)
116
116
  * Fork the project and do your work in a topic branch.
117
+ * Add a config at `~/.fog` for the component you want to test.
117
118
  * Add shindo tests to prove your code works and run all the tests using `bundle exec rake`.
118
119
  * Rebase your branch against fog/fog to make sure everything is up to date.
119
120
  * Commit your changes and send a pull request.
data/Rakefile CHANGED
@@ -59,7 +59,7 @@ namespace :test do
59
59
  end
60
60
 
61
61
  task :test do
62
- Rake::Task[:mock_tests].invoke && Rake::Task[:real_tests].invoke
62
+ Rake::Task[:mock_tests].invoke
63
63
  end
64
64
 
65
65
  def tests(mocked)
@@ -239,6 +239,7 @@ task :changelog do
239
239
  'Lincoln Stoll',
240
240
  'Luqman Amjad',
241
241
  'Michael Zeng',
242
+ 'Nick Osborn',
242
243
  'nightshade427',
243
244
  'Patrick Debois',
244
245
  'Stepan G. Fedorov',
@@ -1,3 +1,187 @@
1
+ 1.7.0 11/04/2012 aa853488c9d84d849f52cf348787030fbb963163
2
+ =========================================================
3
+
4
+ Stats! { 'collaborators' => 41, 'downloads' => 1216554, 'forks' => 599, 'open_issues' => 80, 'watchers' => 2206 }
5
+
6
+ MVP! Nick Osborn
7
+
8
+ [AWS::Mock|create_image]
9
+ automatic registration of ebs image upon image_create. thanks Chielo Zimmerman
10
+
11
+ [AWS|Glacier]
12
+ Fix description header not being passed through Fog.escape. thanks Frederick Cheung
13
+
14
+ [Brightbox]
15
+ Change code to return Single user. thanks Hemant Kumar
16
+ Adds ApiClient Model. thanks Hemant Kumar
17
+ Add identifier to get_account method. thanks Hemant Kumar
18
+ Reuses connection for image selection. thanks Paul Thornthwaite
19
+ Fixes cloud IP options default. thanks Paul Thornthwaite
20
+ Deprecates overloaded requests. thanks Paul Thornthwaite
21
+ Standardises update_firewall_rule. thanks Paul Thornthwaite
22
+ Deprecates old account update request. thanks Paul Thornthwaite
23
+ Use correct request to update account. thanks Paul Thornthwaite
24
+ Brightbox tests should select the smallest official image. thanks Steve Smith
25
+ Allows authentication as user. thanks Steve Smith
26
+ Allow users to lists all accounts associated with the current credentials. thanks Steve Smith
27
+ add support for User Applications. thanks Steve Smith
28
+
29
+ [HP|Storage]
30
+ remove debug output. thanks geemus
31
+
32
+ [Ninefold|Storage]
33
+ Use Atmos in Ninefold storage. thanks Timur Alperovich
34
+
35
+ [aws|auto_scaling]
36
+ update display_*_types. thanks Nick Osborn
37
+ Fix documentation URL. thanks Nick Osborn
38
+ support termination policies. thanks Nick Osborn
39
+ correct DefaultCooldown in mocks. thanks Nick Osborn
40
+ documentation tinkering. thanks Nick Osborn
41
+ support ForceDelete for delete_auto_scaling_group. thanks Nick Osborn
42
+ better tag handling. thanks Nick Osborn
43
+ DRY out ARNs in mocks. thanks Nick Osborn
44
+ document Tags option to create_auto_scaling_group. thanks Nick Osborn
45
+ fix AutoScalingGroupName in mock. thanks Nick Osborn
46
+ expose delete_notification_configuration request. thanks Nick Osborn
47
+ improve describe_*_types test. thanks Nick Osborn
48
+ improve notification configurations. thanks Nick Osborn
49
+ s/data/self.data/ in mocks. thanks Nick Osborn
50
+ mark describe_*_types requests as idempotent. thanks Nick Osborn
51
+ tags support. thanks Nick Osborn
52
+ expose termination policies in group model. thanks Nick Osborn
53
+
54
+ [aws|autoscaling]
55
+ fix casting availability_zones to array in create_auto_scaling_group mock. thanks geemus
56
+ mark problematic auto_scaling mocked tests as pending see also #1183. thanks geemus
57
+
58
+ [aws|cdn]
59
+ cover AWS CDN with some non-exhaustive tests. thanks Brice Figureau
60
+ Implements AWS CDN get_invalidation request. thanks Brice Figureau
61
+ fix incorrect get_invalidation result. thanks Brice Figureau
62
+ add aws cdn tests for streaming distributions. thanks Brice Figureau
63
+ fix cdn documentation. thanks Brice Figureau
64
+ AWS CDN models. thanks Brice Figureau
65
+ add request mock support for AWS Cloudfront. thanks Brice Figureau
66
+ fix up failing mocked tests around invalidations. thanks geemus
67
+
68
+ [aws|cloud_watch]
69
+ Add instrumentation support. thanks Michael Hale
70
+
71
+ [aws|ec2]
72
+ describe_availability_zones parser handles nested <item> tags. thanks Aaron Suggs
73
+
74
+ [aws|rds]
75
+ add region and owner_id as RDS connection attributes. thanks Benton Roberts
76
+ add request definitions for RDS tagging and increment RDS API version. thanks Benton Roberts
77
+ add tests for RDS tagging requests. thanks Benton Roberts
78
+ add tagging methods to RDS server model. thanks Benton Roberts
79
+ add tagging tests for RDS server model. thanks Benton Roberts
80
+ store mocked RDS instance tags in connection object. thanks Benton Roberts
81
+ FIX non-1.8-compliant syntax bug. thanks Benton Roberts
82
+
83
+ [misc]
84
+ modified create function to include options. changed "diskConfig" to "OS-DCF:diskConfig" to allow disk configuration to be properly set. thanks Alex Dunn
85
+ Removed options attribute and used the already existing disk_config attribute instead. Passed in options hash to create_server method with disk_config attribute unless nil. thanks Alex Dunn
86
+ Replace nil return value with private IP, implementation as in public_ip_address method. thanks Andrew Taylor
87
+ Change the metadata method to support amazon tags such as x-amz-website-redirect-location. thanks Arthur Gunawan
88
+ Fix issue #1245 - mock register_image fails with block device mapping. thanks Brice Figureau
89
+ Added ninefold load balancers. thanks Carl Woodward
90
+ Added other commands for load balancers. thanks Carl Woodward
91
+ Fix create load balancer test. thanks Carl Woodward
92
+ Add assign list to load balancer rules and update load balancer rule for Ninefold. thanks Carl Woodward
93
+ Add remove from load balancer test. thanks Carl Woodward
94
+ Move ssh private_key, public_key, username to Server model to reduce duplication. thanks Carlos Sanchez
95
+ Joyent server creation should not wait for server to be ready. thanks Carlos Sanchez
96
+ Added ParameterValue to engine_defaults_parser. thanks Curtis Stewart
97
+ Added outputs 'Description' field to DescribeStacks parser. thanks Curtis Stewart
98
+ Make region available to mock. thanks Edward Muller
99
+ Added OpenStack::Server#created and #updated. thanks Eric Hodel
100
+ Use :default from tests/.fog for test credentials. thanks Eric Hodel
101
+ Only run mocked tests by default. thanks Eric Hodel
102
+ Tested handling of Openstack server created and updated times. thanks Eric Hodel
103
+ create image now supports block device mapping. thanks Eric Stonfer
104
+ create image extended to allow for EBS volume handling. thanks Eric Stonfer
105
+ fix indexed_param usage. thanks Eric Stonfer
106
+ forgot to commit some changes. thanks Eric Stonfer
107
+ when querying servers by icenter group, servers will return nil. fixed this. thanks Eugene Howe
108
+ fixed bad request names. thanks Eugene Howe
109
+ correct the options checking in BlueBox create_block. thanks Josh Kalderimis
110
+ changed list nova servers request to get details. thanks Julio Feijo
111
+ Correct the handling of the power_on option. thanks Karan Misra
112
+ Added support for scheduler_hints in OpenStack. thanks Mariusz Pietrzyk
113
+ add force option to auto scaling group destroy method. thanks Michael Hale
114
+ use hash args. thanks Michael Hale
115
+ [AWS|cloud_watch]: fix list_metrics NextMarker should be NextToken. thanks Michael Hale
116
+ Fix to resolve "objectid is required for this operation" error message when calling public_url. thanks Michael Harrison
117
+ Fix to resolve "objectid is required for this operation" error message when calling public_url. thanks Michael Harrison
118
+ Return nil on public_url if the file isn't present on the cloud storage. thanks Michael Harrison
119
+ Added file existence check before file deletion attempt. thanks Michael Harrison
120
+ Rolled back deletion guard as some may be using the exception raised in their code. thanks Michael Harrison
121
+ Changed Atmos::FIle.public_url so an exception is thrown if the file doesn't exist on the cloud storage. thanks Michael Harrison
122
+ Changed Atmos::FIle.public_url so returns nil if the file doesn't exist on the cloud storage. This brings the method in line with other storage implementations such as AWS and Rackspace. thanks Michael Harrison
123
+ Changed Atmos::FIle.public_url so checks for existence of the file on storage on every call to the method minimising the potential for a 404 error. thanks Michael Harrison
124
+ added documentation. thanks Nick Huanuca
125
+ ammend dest_folder disclaimer. thanks Nick Huanuca
126
+ fixed vm listing problem. thanks Ohad Levy
127
+ Allows tests to run against FOG_RC setting. thanks Paul Thornthwaite
128
+ Beginning implementation of RDS subnet groups. thanks Rusty Geldmacher
129
+ Changes RDS subnet attribute name from subnets to subnet_ids. thanks Rusty Geldmacher
130
+ allow port to be included in queue_url. thanks Sairam
131
+ Fixed typos in elasticache and rds describe_events. Added better documentation of describe_events. thanks Sean Hart
132
+ Added test for describe_events.rb. It is very simple, and I'm not familiar with Shindo, so may need some assistance expanding. thanks Sean Hart
133
+ Added parsing for Marker. AWS limits response to 100 lines and gives you a marker to get the next batch with. thanks Sean Hart
134
+ Added missing header. thanks Stephen von Takach
135
+ Bumped mocked maximum value for provisioned iops. thanks Thom Mahoney
136
+ Ignore existing directory when creating on local storage. thanks Thomas Wright
137
+ Add config instructions to README. thanks Thomas Wright
138
+ Fix reference to config file. thanks Thomas Wright
139
+ expect public_key option instead of ssh_key on block create. thanks Trevor Bramble
140
+ Added usagePrice the hourly cost for a reserved instance. thanks Ulf Mansson
141
+ Added RDS describe_events. thanks Your Name
142
+ Created describe events for RDS. thanks Your Name
143
+ Update lib/fog/vsphere/requests/compute/vm_clone.rb. thanks endzyme
144
+ Update lib/fog/vsphere/requests/compute/vm_clone.rb. thanks endzyme
145
+ Update lib/fog/vsphere/requests/compute/vm_clone.rb. thanks endzyme
146
+
147
+ [ninefold|compute]
148
+ update load balancer tests to pass hash parameters for backwards compatability. thanks geemus
149
+ mark before/after blocks as pending in mocked mode also. thanks geemus
150
+
151
+ [openstack]
152
+ Authentication Mocks. thanks Nelvin Driz
153
+ Fix Failing Shindo Tests. thanks Nelvin Driz
154
+ Ensure String Username for Authentication. thanks Nelvin Driz
155
+ Changed volumes attributes of mocks from camelcase to snakecase. thanks Philip Mark M. Deazeta
156
+ Updated mocks for quota, image, tenant and volumes. thanks Philip Mark M. Deazeta
157
+ Fixed mocks for failing shindo tests. thanks Philip Mark M. Deazeta
158
+ Updated 'image update' mocks. thanks Philip Mark M. Deazeta
159
+
160
+ [openstack|compute]
161
+ Added auth_token_expiration. thanks Alfonso Juan Dillera
162
+ Fixed security groups typos. thanks Alfonso Juan Dillera
163
+ Fix Server Mocks and `find_by_id` method. thanks Nelvin Driz
164
+
165
+ [openstack|identity]
166
+ Update for failing mock test. thanks Alvin Garcia
167
+ Update Identity Mocking Process. thanks Nelvin Driz
168
+ Update Fog Mocks on Authentication, User and Roles. thanks Nelvin Driz
169
+
170
+ [openstack|image]
171
+ Added update_members function. thanks Alvin Garcia
172
+ Added updateable attributes. thanks Alvin Garcia
173
+ Added optional attributes to set on create image. thanks Alvin Garcia
174
+ Fixed update image and list public images mocks. thanks Alvin Garcia
175
+ Fix Hash Access on Mock of Create Image. thanks Nelvin Driz
176
+
177
+ [openstack|network]
178
+ Add support for OpenStack Quantum. thanks Ferran Rodenas
179
+ Add filters to networks, ports and subnets. thanks Ferran Rodenas
180
+
181
+ [rackspace|identity]
182
+ user should be alphanumeric. thanks geemus
183
+
184
+
1
185
  1.6.0 09/15/2012 4bd909557fd595a656ebd86a3d7c5849bd923fe1
2
186
  =========================================================
3
187
 
@@ -37,21 +37,72 @@ Now you'll need to create a 'distribution' which represents a mapping from the C
37
37
 
38
38
  # parse the response for stuff you'll need later
39
39
  distribution_id = data.body['Id']
40
- caller_reference = data.body['CallerReference']
40
+ caller_reference = data.body['DistributionConfig']['CallerReference']
41
41
  etag = data.headers['ETag']
42
42
  cdn_domain_name = data.body['DomainName']
43
43
 
44
44
  # wait for the updates to propogate
45
45
  Fog.wait_for {
46
- cdn.get_distribution(distribution_id).body['Status'] ## 'Deployed'
46
+ cdn.get_distribution(distribution_id).body['Status'] == 'Deployed'
47
47
  }
48
48
 
49
+ Fog also supports models for the AWS CDN. The above code can also be written like this:
50
+
51
+ distribution = cdn.distributions.create( :custom_origin => {
52
+ 'DNSName' => 'www.example.com',
53
+ 'OriginProtocolPolicy' => 'match-viewer'
54
+ }, :enabled => true
55
+ })
56
+
57
+ distribution.wait_for { ready? }
58
+
59
+ Like other collections supported by Fog, it is also possible to browse the list of distributions:
60
+
61
+ cdn.distributions.all
62
+
63
+ Or get access to a distinct distribution by its identity:
64
+
65
+ cdn.distributions.get(distribution_id)
66
+
67
+
49
68
  ## Getting Served
50
69
 
51
70
  With the domain name from the distribution in hand you should now be ready to serve content from the edge. All you need to do is start replacing urls like `http://www.example.com/stylesheets/foo.css` with `#{cdn_domain_name}/stylesheets/foo.css`. Just because you can do something doesn't always mean you should though. Dynamic pages are not really well suited to CDN storage, since CDN content will be the same for every user. Fortunately some of your most used content is a great fit. By just switching over your images, javascripts and stylesheets you can have an impact for each and every one of your users.
52
71
 
53
72
  Congrats, your site is faster! By default the urls aren't very pretty, something like `http://d1xdx2sah5udd0.cloudfront.net/stylesheets/foo.css`. Thankfully you can use CNAME config options to utilize something like `http://assets.example.com/stylesheets/foo.css`, if you are interested in learning more about this let me know in the comments.
54
73
 
74
+ ## Invalidating the CDN caches
75
+
76
+ Sometimes, some part of the CDN cache needs to be invalidated because the origin changed and we need a faster propagation than waiting for the objects to expire by themselves. To do this, CloudFront supports creating <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/Actions_Invalidations.html">distributions invalidation</a>.
77
+
78
+ An invalidation can be created with the following code:
79
+
80
+ # let's invalidate /test.html and /path/to/file.html
81
+ data = cdn.post_invalidation(distribution_id, [ "/test.html", "/path/to/file.html" ])
82
+ invalidation_id = data.body['Id']
83
+
84
+ Fog.wait_for { cdn.get_invalidation(distribution_id, invalidation_id).body['Status'] == 'Completed' }
85
+
86
+ It is also possible to list past and current invalidation for a given distribution:
87
+
88
+ cdn.get_invalidation_list(distribution_id)
89
+
90
+ The same can be written with Fog CDN model abstraction:
91
+
92
+ distribution = cdn.distributions.get(distribution_id)
93
+
94
+ invalidation = distribution.invalidations.create(:paths => [ "/test.html", "/path/to/file.html" ])
95
+ invalidation.wait_for { ready? }
96
+
97
+ Listing invalidations is as simple as:
98
+
99
+ distribution.invalidations.all
100
+
101
+ # this returns only summarized invalidation
102
+ # to get access to the invalidations path:
103
+ distribution.invalidations.get(invalidation_id)
104
+
105
+
55
106
  ## Cleaning Up
56
107
 
57
108
  But, just in case you need to update things I'll run through how you can make changes. In my case I just want to clean up after myself, so I'll use the distribution_id and ETag from before to disable the distribution. We need to use the ETag as well because it provides a way to refer to different versions of the same distribution and ensures we are updating the version that we think we are.
@@ -75,8 +126,23 @@ But, just in case you need to update things I'll run through how you can make ch
75
126
  Now you just need to wait for the update to happen like before and once its disabled we can delete it:
76
127
 
77
128
  Fog.wait_for {
78
- cdn.get_distribution(distribution_id).body['Status'] ## 'Deployed'
129
+ cdn.get_distribution(distribution_id).body['Status'] == 'Deployed'
79
130
  }
80
131
  cdn.delete_distribution(distribution_id, etag)
81
132
 
133
+ This can also be written with CDN models as:
134
+
135
+ distribution = cdn.distributions.get(distribution_id)
136
+
137
+ # make sure the distribution is deployed otherwise it can't be disabled
138
+ distribution.wait_for { ready? }
139
+
140
+ distribution.disable
141
+
142
+ # Disabling a distribution is a lengthy operation
143
+ distribution.wait_for { ready? }
144
+
145
+ # and finally let's get rid of it
146
+ distribution.destroy
147
+
82
148
  Thats it, now go forth and speed up some load times!
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
6
6
  ## If your rubyforge_project name is different, then edit it and comment out
7
7
  ## the sub! line in the Rakefile
8
8
  s.name = 'fog'
9
- s.version = '1.6.0'
10
- s.date = '2012-09-15'
9
+ s.version = '1.7.0'
10
+ s.date = '2012-11-04'
11
11
  s.rubyforge_project = 'fog'
12
12
 
13
13
 
data/lib/fog.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), 'fog', 'core')
3
3
  module Fog
4
4
 
5
5
  unless const_defined?(:VERSION)
6
- VERSION = '1.6.0'
6
+ VERSION = '1.7.0'
7
7
  end
8
8
 
9
9
  end
@@ -18,4 +18,5 @@ require 'fog/image'
18
18
  require 'fog/volume'
19
19
  require 'fog/cdn'
20
20
  require 'fog/dns'
21
+ require 'fog/network'
21
22
  require 'fog/storage'
@@ -57,20 +57,22 @@ module Fog
57
57
 
58
58
  # By default, expire in 5 years
59
59
  def public_url(expires = (Time.now + 5 * 365 * 24 * 60 * 60))
60
- requires :objectid
61
- # TODO - more efficient method to get this?
62
- storage = Fog::Storage.new(:provider => 'Atmos')
63
- uri = URI::HTTP.build(:scheme => @prefix, :host => @storage_host, :port => @storage_port.to_i, :path => "/rest/objects/#{objectid}" )
64
- Fog::Storage.new(:provider => 'Atmos').uid
65
-
66
- sb = "GET\n"
67
- sb += uri.path.downcase + "\n"
68
- sb += storage.uid + "\n"
69
- sb += String(expires.to_i())
70
-
71
- signature = storage.sign( sb )
72
- uri.query = "uid=#{CGI::escape(storage.uid)}&expires=#{expires.to_i()}&signature=#{CGI::escape(signature)}"
73
- uri.to_s
60
+ file = directory.files.head(key)
61
+ self.objectid = if file.present? then file.attributes['x-emc-meta'].scan(/objectid=(\w+),/).flatten[0] else nil end
62
+ if self.objectid.present?
63
+ uri = URI::HTTP.build(:scheme => connection.ssl? ? "http" : "https" , :host => connection.host, :port => connection.port.to_i, :path => "/rest/objects/#{self.objectid}" )
64
+
65
+ sb = "GET\n"
66
+ sb += uri.path.downcase + "\n"
67
+ sb += connection.uid + "\n"
68
+ sb += String(expires.to_i())
69
+
70
+ signature = connection.sign( sb )
71
+ uri.query = "uid=#{CGI::escape(connection.uid)}&expires=#{expires.to_i()}&signature=#{CGI::escape(signature)}"
72
+ uri.to_s
73
+ else
74
+ nil
75
+ end
74
76
  end
75
77
 
76
78
  def save(options = {})
@@ -15,25 +15,32 @@ module Fog
15
15
  request_path 'fog/aws/requests/auto_scaling'
16
16
  request :create_auto_scaling_group
17
17
  request :create_launch_configuration
18
+ request :create_or_update_tags
18
19
  request :delete_auto_scaling_group
19
20
  request :delete_launch_configuration
21
+ request :delete_notification_configuration
20
22
  request :delete_policy
21
23
  request :delete_scheduled_action
24
+ request :delete_tags
22
25
  request :describe_adjustment_types
23
26
  request :describe_auto_scaling_groups
24
27
  request :describe_auto_scaling_instances
28
+ request :describe_auto_scaling_notification_types
25
29
  request :describe_launch_configurations
26
30
  request :describe_metric_collection_types
31
+ request :describe_notification_configurations
27
32
  request :describe_policies
28
33
  request :describe_scaling_activities
29
34
  request :describe_scaling_process_types
30
35
  request :describe_scheduled_actions
36
+ request :describe_tags
37
+ request :describe_termination_policy_types
31
38
  request :disable_metrics_collection
32
39
  request :enable_metrics_collection
33
40
  request :execute_policy
41
+ request :put_notification_configuration
34
42
  request :put_scaling_policy
35
43
  request :put_scheduled_update_group_action
36
- request :put_notification_configuration
37
44
  request :resume_processes
38
45
  request :set_desired_capacity
39
46
  request :set_instance_health
@@ -55,6 +62,9 @@ module Fog
55
62
 
56
63
  class Real
57
64
  include Fog::AWS::CredentialFetcher::ConnectionMethods
65
+
66
+ attr_accessor :region
67
+
58
68
  # Initialize connection to AutoScaling
59
69
  #
60
70
  # ==== Notes
@@ -72,6 +82,7 @@ module Fog
72
82
  #
73
83
  # ==== Returns
74
84
  # * AutoScaling object with connection to AWS.
85
+
75
86
  def initialize(options={})
76
87
  require 'fog/core/parser'
77
88
 
@@ -82,8 +93,10 @@ module Fog
82
93
 
83
94
  @instrumentor = options[:instrumentor]
84
95
  @instrumentor_name = options[:instrumentor_name] || 'fog.aws.auto_scaling'
85
-
96
+
86
97
  options[:region] ||= 'us-east-1'
98
+ @region = options[:region]
99
+
87
100
  @host = options[:host] || "autoscaling.#{options[:region]}.amazonaws.com"
88
101
  @path = options[:path] || '/'
89
102
  @port = options[:port] || 443
@@ -159,9 +172,9 @@ module Fog
159
172
  end
160
173
 
161
174
  def setup_credentials(options)
162
- @aws_access_key_id = options[:aws_access_key_id]
163
- @aws_secret_access_key = options[:aws_secret_access_key]
164
- @aws_session_token = options[:aws_session_token]
175
+ @aws_access_key_id = options[:aws_access_key_id]
176
+ @aws_secret_access_key = options[:aws_secret_access_key]
177
+ @aws_session_token = options[:aws_session_token]
165
178
  @aws_credentials_expire_at = options[:aws_credentials_expire_at]
166
179
 
167
180
  @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@@ -170,9 +183,13 @@ module Fog
170
183
 
171
184
 
172
185
  class Mock
186
+ include Fog::AWS::CredentialFetcher::ConnectionMethods
187
+
188
+ attr_accessor :region
173
189
 
174
190
  def self.data
175
191
  @data ||= Hash.new do |hash, region|
192
+ owner_id = Fog::AWS::Mock.owner_id
176
193
  hash[region] = Hash.new do |region_hash, key|
177
194
  region_hash[key] = {
178
195
  :adjustment_types => [
@@ -182,10 +199,15 @@ module Fog
182
199
  ],
183
200
  :auto_scaling_groups => {},
184
201
  :scaling_policies => {},
185
- :health_states => ['Healthy', 'Unhealthy'],
202
+ :health_states => [
203
+ 'Healthy',
204
+ 'Unhealthy'
205
+ ],
186
206
  :launch_configurations => {},
187
207
  :metric_collection_types => {
188
- :granularities => [ '1Minute' ],
208
+ :granularities => [
209
+ '1Minute'
210
+ ],
189
211
  :metrics => [
190
212
  'GroupMinSize',
191
213
  'GroupMaxSize',
@@ -194,16 +216,33 @@ module Fog
194
216
  'GroupPendingInstances',
195
217
  'GroupTerminatingInstances',
196
218
  'GroupTotalInstances'
197
- ],
219
+ ]
198
220
  },
221
+ :notification_configurations => {},
222
+ :notification_types => [
223
+ 'autoscaling:EC2_INSTANCE_LAUNCH',
224
+ 'autoscaling:EC2_INSTANCE_LAUNCH_ERROR',
225
+ 'autoscaling:EC2_INSTANCE_TERMINATE',
226
+ 'autoscaling:EC2_INSTANCE_TERMINATE_ERROR',
227
+ 'autoscaling:TEST_NOTIFICATION'
228
+ ],
229
+ :owner_id => owner_id,
199
230
  :process_types => [
200
231
  'AZRebalance',
232
+ 'AddToLoadBalancer',
201
233
  'AlarmNotification',
202
234
  'HealthCheck',
203
235
  'Launch',
204
236
  'ReplaceUnhealthy',
205
237
  'ScheduledActions',
206
238
  'Terminate'
239
+ ],
240
+ :termination_policy_types => [
241
+ 'ClosestToNextInstanceHour',
242
+ 'Default',
243
+ 'NewestInstance',
244
+ 'OldestInstance',
245
+ 'OldestLaunchConfiguration'
207
246
  ]
208
247
  }
209
248
  end
@@ -222,19 +261,22 @@ module Fog
222
261
  unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
223
262
  raise ArgumentError, "Unknown region: #{@region.inspect}"
224
263
  end
225
-
226
264
  end
227
265
 
228
- def setup_credentials(options)
229
- @aws_access_key_id = options[:aws_access_key_id]
266
+ def region_data
267
+ self.class.data[@region]
230
268
  end
231
269
 
232
270
  def data
233
- self.class.data[@region][@aws_access_key_id]
271
+ self.region_data[@aws_access_key_id]
234
272
  end
235
273
 
236
274
  def reset_data
237
- self.class.data[@region].delete(@aws_access_key_id)
275
+ self.region_data.delete(@aws_access_key_id)
276
+ end
277
+
278
+ def setup_credentials(options)
279
+ @aws_access_key_id = options[:aws_access_key_id]
238
280
  end
239
281
 
240
282
  end