brightbox-cli 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (381) hide show
  1. data/.gitignore +7 -0
  2. data/bin/brightbox-firewall-policies +14 -0
  3. data/bin/brightbox-firewall-rules +14 -0
  4. data/bin/brightbox-groups +14 -0
  5. data/lib/brightbox-cli/api.rb +2 -1
  6. data/lib/brightbox-cli/cloud_ips.rb +2 -2
  7. data/lib/brightbox-cli/command_generator.rb +3 -0
  8. data/lib/brightbox-cli/commands/cloudips-update.rb +2 -2
  9. data/lib/brightbox-cli/commands/config-client-list.rb +1 -1
  10. data/lib/brightbox-cli/commands/firewall-policies-apply.rb +31 -0
  11. data/lib/brightbox-cli/commands/firewall-policies-create.rb +39 -0
  12. data/lib/brightbox-cli/commands/firewall-policies-destroy.rb +24 -0
  13. data/lib/brightbox-cli/commands/firewall-policies-list.rb +17 -0
  14. data/lib/brightbox-cli/commands/firewall-policies-remove.rb +31 -0
  15. data/lib/brightbox-cli/commands/firewall-policies-show.rb +19 -0
  16. data/lib/brightbox-cli/commands/firewall-rules-create.rb +51 -0
  17. data/lib/brightbox-cli/commands/firewall-rules-destroy.rb +24 -0
  18. data/lib/brightbox-cli/commands/firewall-rules-list.rb +19 -0
  19. data/lib/brightbox-cli/commands/firewall-rules-show.rb +22 -0
  20. data/lib/brightbox-cli/commands/groups-add-server.rb +23 -0
  21. data/lib/brightbox-cli/commands/groups-create.rb +22 -0
  22. data/lib/brightbox-cli/commands/groups-destroy.rb +23 -0
  23. data/lib/brightbox-cli/commands/groups-list.rb +16 -0
  24. data/lib/brightbox-cli/commands/groups-move_servers.rb +39 -0
  25. data/lib/brightbox-cli/commands/groups-remove-servers.rb +35 -0
  26. data/lib/brightbox-cli/commands/groups-show.rb +14 -0
  27. data/lib/brightbox-cli/commands/groups-update.rb +38 -0
  28. data/lib/brightbox-cli/commands/images-register.rb +11 -3
  29. data/lib/brightbox-cli/commands/images-update.rb +4 -0
  30. data/lib/brightbox-cli/commands/servers-create.rb +19 -8
  31. data/lib/brightbox-cli/commands/servers-list.rb +0 -3
  32. data/lib/brightbox-cli/commands/servers-show.rb +3 -39
  33. data/lib/brightbox-cli/commands/servers-stop.rb +1 -1
  34. data/lib/brightbox-cli/detailed_server.rb +43 -0
  35. data/lib/brightbox-cli/detailed_server_group.rb +13 -0
  36. data/lib/brightbox-cli/firewall_policy.rb +32 -0
  37. data/lib/brightbox-cli/firewall_rule.rb +39 -0
  38. data/lib/brightbox-cli/firewall_rules.rb +26 -0
  39. data/lib/brightbox-cli/images.rb +2 -1
  40. data/lib/brightbox-cli/server_groups.rb +64 -0
  41. data/lib/brightbox-cli/servers.rb +5 -13
  42. data/lib/brightbox-cli/vendor/fog/Rakefile +17 -2
  43. data/lib/brightbox-cli/vendor/fog/changelog.txt +434 -0
  44. data/lib/brightbox-cli/vendor/fog/docs/_layouts/default.html +12 -12
  45. data/lib/brightbox-cli/vendor/fog/docs/about/getting_started.markdown +2 -2
  46. data/lib/brightbox-cli/vendor/fog/docs/dns/index.markdown +3 -3
  47. data/lib/brightbox-cli/vendor/fog/docs/index.markdown +1 -1
  48. data/lib/brightbox-cli/vendor/fog/docs/public/css/fog.css +14 -1
  49. data/lib/brightbox-cli/vendor/fog/docs/public/images/engineyard.png +0 -0
  50. data/lib/brightbox-cli/vendor/fog/docs/public/images/fog.png +0 -0
  51. data/lib/brightbox-cli/vendor/fog/fog.gemspec +4 -4
  52. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_watch.rb +14 -0
  53. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/compute.rb +50 -19
  54. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elasticache.rb +127 -0
  55. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarm.rb +12 -0
  56. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarm_data.rb +39 -0
  57. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarm_datum.rb +66 -0
  58. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarm_histories.rb +18 -0
  59. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarm_history.rb +16 -0
  60. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/alarms.rb +30 -0
  61. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/servers.rb +1 -1
  62. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/cluster.rb +69 -0
  63. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/clusters.rb +31 -0
  64. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/parameter_group.rb +32 -0
  65. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/parameter_groups.rb +30 -0
  66. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/security_group.rb +52 -0
  67. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elasticache/security_groups.rb +30 -0
  68. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/delete_alarms.rb +26 -0
  69. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/describe_alarm_history.rb +40 -0
  70. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/describe_alarms.rb +73 -0
  71. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/describe_alarms_for_metric.rb +71 -0
  72. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/disable_alarm_actions.rb +26 -0
  73. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/enable_alarm_actions.rb +26 -0
  74. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/get_metric_statistics.rb +1 -0
  75. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/put_metric_alarm.rb +26 -0
  76. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_watch/set_alarm_state.rb +26 -0
  77. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/spot_instance_requests.rb +2 -2
  78. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/change_resource_record_sets.rb +0 -0
  79. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/create_hosted_zone.rb +0 -0
  80. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/delete_hosted_zone.rb +0 -0
  81. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/get_change.rb +0 -0
  82. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/get_hosted_zone.rb +0 -0
  83. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/list_hosted_zones.rb +0 -0
  84. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/{aws → dns}/list_resource_record_sets.rb +0 -0
  85. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/authorize_cache_security_group_ingress.rb +26 -0
  86. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/base.rb +34 -0
  87. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb +79 -0
  88. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/describe_cache_clusters.rb +27 -0
  89. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/describe_cache_parameters.rb +22 -0
  90. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/describe_engine_default_parameters.rb +22 -0
  91. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/describe_parameter_groups.rb +27 -0
  92. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/describe_security_groups.rb +27 -0
  93. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb +59 -0
  94. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/event_list.rb +38 -0
  95. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/modify_parameter_group.rb +27 -0
  96. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/parameter_group_parser.rb +30 -0
  97. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/reset_parameter_group.rb +27 -0
  98. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/security_group_parser.rb +40 -0
  99. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/single_cache_cluster.rb +22 -0
  100. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/single_parameter_group.rb +22 -0
  101. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/single_security_group.rb +34 -0
  102. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/delete_alarms.rb +30 -0
  103. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/describe_alarm_history.rb +33 -0
  104. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/describe_alarms.rb +38 -0
  105. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/describe_alarms_for_metric.rb +39 -0
  106. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/disable_alarm_actions.rb +30 -0
  107. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/enable_alarm_actions.rb +30 -0
  108. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/put_metric_alarm.rb +84 -0
  109. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_watch/set_alarm_state.rb +31 -0
  110. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_security_group.rb +5 -4
  111. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_snapshot.rb +2 -3
  112. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_tags.rb +5 -3
  113. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_volume.rb +0 -1
  114. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_tags.rb +2 -3
  115. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_images.rb +5 -8
  116. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_instances.rb +2 -2
  117. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_snapshots.rb +3 -1
  118. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_volumes.rb +3 -2
  119. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/modify_image_attribute.rb +32 -0
  120. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/purchase_reserved_instances_offering.rb +1 -1
  121. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/register_image.rb +0 -1
  122. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/run_instances.rb +1 -2
  123. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +36 -0
  124. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +62 -0
  125. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/create_cache_parameter_group.rb +37 -0
  126. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/create_cache_security_group.rb +33 -0
  127. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/delete_cache_cluster.rb +32 -0
  128. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/delete_cache_parameter_group.rb +31 -0
  129. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/delete_cache_security_group.rb +31 -0
  130. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb +39 -0
  131. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_cache_parameter_groups.rb +34 -0
  132. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_cache_parameters.rb +36 -0
  133. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_cache_security_groups.rb +34 -0
  134. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_engine_default_parameters.rb +35 -0
  135. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/describe_events.rb +46 -0
  136. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/modify_cache_cluster.rb +70 -0
  137. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/modify_cache_parameter_group.rb +45 -0
  138. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb +44 -0
  139. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reset_cache_parameter_group.rb +46 -0
  140. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/revoke_cache_security_group_ingress.rb +37 -0
  141. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
  142. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +1 -1
  143. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +1 -1
  144. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/describe_instance_health.rb +2 -2
  145. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
  146. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/get_server_certificate.rb +5 -7
  147. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_server_certificates.rb +3 -1
  148. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/upload_server_certificate.rb +3 -2
  149. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/change_message_visibility.rb +30 -0
  150. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/create_queue.rb +35 -1
  151. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/delete_message.rb +29 -0
  152. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/delete_queue.rb +24 -1
  153. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/get_queue_attributes.rb +22 -1
  154. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/list_queues.rb +15 -1
  155. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/receive_message.rb +55 -1
  156. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/send_message.rb +39 -1
  157. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/set_queue_attributes.rb +19 -1
  158. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/copy_object.rb +1 -1
  159. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_acl.rb +1 -1
  160. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/hash_to_acl.rb +2 -3
  161. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sqs.rb +30 -0
  162. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/storage.rb +2 -1
  163. data/lib/brightbox-cli/vendor/fog/lib/fog/aws.rb +17 -14
  164. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/aws.rb +4 -0
  165. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/openstack.rb +31 -0
  166. data/lib/brightbox-cli/vendor/fog/lib/fog/bin.rb +1 -0
  167. data/lib/brightbox-cli/vendor/fog/lib/fog/bluebox/models/compute/server.rb +1 -1
  168. data/lib/brightbox-cli/vendor/fog/lib/fog/bluebox/requests/compute/create_template.rb +1 -1
  169. data/lib/brightbox-cli/vendor/fog/lib/fog/bluebox.rb +2 -2
  170. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/compute.rb +5 -0
  171. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/account.rb +1 -1
  172. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/firewall_policies.rb +29 -0
  173. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/firewall_policy.rb +65 -0
  174. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/firewall_rule.rb +54 -0
  175. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/firewall_rules.rb +24 -0
  176. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/image.rb +2 -0
  177. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server.rb +27 -2
  178. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server_group.rb +1 -1
  179. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +14 -0
  180. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox.rb +1 -1
  181. data/lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb +1 -2
  182. data/lib/brightbox-cli/vendor/fog/lib/fog/compute.rb +3 -0
  183. data/lib/brightbox-cli/vendor/fog/lib/fog/core/attributes.rb +5 -5
  184. data/lib/brightbox-cli/vendor/fog/lib/fog/core/credentials.rb +5 -0
  185. data/lib/brightbox-cli/vendor/fog/lib/fog/core/errors.rb +4 -0
  186. data/lib/brightbox-cli/vendor/fog/lib/fog/core/provider.rb +9 -4
  187. data/lib/brightbox-cli/vendor/fog/lib/fog/dnsimple.rb +1 -1
  188. data/lib/brightbox-cli/vendor/fog/lib/fog/dnsmadeeasy.rb +1 -1
  189. data/lib/brightbox-cli/vendor/fog/lib/fog/dynect.rb +1 -1
  190. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/compute.rb +1 -5
  191. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud.rb +1 -1
  192. data/lib/brightbox-cli/vendor/fog/lib/fog/glesys/compute.rb +20 -4
  193. data/lib/brightbox-cli/vendor/fog/lib/fog/glesys/models/compute/templates.rb +0 -6
  194. data/lib/brightbox-cli/vendor/fog/lib/fog/glesys.rb +1 -1
  195. data/lib/brightbox-cli/vendor/fog/lib/fog/go_grid.rb +1 -1
  196. data/lib/brightbox-cli/vendor/fog/lib/fog/google.rb +1 -1
  197. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/server.rb +1 -1
  198. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/uri.rb +7 -3
  199. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt.rb +1 -1
  200. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/models/compute/server.rb +10 -0
  201. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_create.rb +3 -3
  202. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_delete.rb +0 -0
  203. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_list.rb +1 -1
  204. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_resource_create.rb +8 -8
  205. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_resource_delete.rb +0 -0
  206. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_resource_list.rb +8 -8
  207. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_resource_update.rb +9 -9
  208. data/lib/brightbox-cli/vendor/fog/lib/fog/linode/{models/dns/linode → requests/dns}/domain_update.rb +5 -5
  209. data/lib/brightbox-cli/vendor/fog/lib/fog/linode.rb +2 -2
  210. data/lib/brightbox-cli/vendor/fog/lib/fog/local/models/storage/directories.rb +33 -0
  211. data/lib/brightbox-cli/vendor/fog/lib/fog/local/models/storage/directory.rb +57 -0
  212. data/lib/brightbox-cli/vendor/fog/lib/fog/local/models/storage/file.rb +113 -0
  213. data/lib/brightbox-cli/vendor/fog/lib/fog/local/models/storage/files.rb +87 -0
  214. data/lib/brightbox-cli/vendor/fog/lib/fog/local/storage.rb +71 -0
  215. data/lib/brightbox-cli/vendor/fog/lib/fog/local.rb +1 -1
  216. data/lib/brightbox-cli/vendor/fog/lib/fog/new_servers.rb +1 -1
  217. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/compute.rb +1 -1
  218. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/compute/server.rb +2 -1
  219. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold.rb +2 -2
  220. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/compute.rb +198 -0
  221. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/flavor.rb +20 -0
  222. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/flavors.rb +28 -0
  223. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/image.rb +57 -0
  224. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/images.rb +33 -0
  225. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/meta.rb +29 -0
  226. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/metadata.rb +69 -0
  227. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/server.rb +195 -0
  228. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/servers.rb +36 -0
  229. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/meta_parent.rb +33 -0
  230. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/change_password_server.rb +24 -0
  231. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/confirm_resized_server.rb +24 -0
  232. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/create_image.rb +49 -0
  233. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +75 -0
  234. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/delete_image.rb +40 -0
  235. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/delete_meta.rb +28 -0
  236. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/delete_server.rb +38 -0
  237. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/get_flavor_details.rb +43 -0
  238. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/get_image_details.rb +33 -0
  239. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/get_meta.rb +29 -0
  240. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/get_server_details.rb +32 -0
  241. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_addresses.rb +32 -0
  242. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_flavors.rb +38 -0
  243. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_flavors_detail.rb +38 -0
  244. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_images.rb +33 -0
  245. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_images_detail.rb +39 -0
  246. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_metadata.rb +28 -0
  247. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_private_addresses.rb +32 -0
  248. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_public_addresses.rb +32 -0
  249. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_servers.rb +33 -0
  250. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/list_servers_detail.rb +39 -0
  251. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/reboot_server.rb +24 -0
  252. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/rebuild_server.rb +31 -0
  253. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/resize_server.rb +24 -0
  254. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/revert_resized_server.rb +30 -0
  255. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/server_action.rb +18 -0
  256. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/set_metadata.rb +45 -0
  257. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/update_meta.rb +45 -0
  258. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/update_metadata.rb +46 -0
  259. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/update_server.rb +35 -0
  260. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack.rb +113 -0
  261. data/lib/brightbox-cli/vendor/fog/lib/fog/providers.rb +1 -0
  262. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/dns.rb +25 -0
  263. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/dns/callback.rb +3 -2
  264. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace.rb +5 -5
  265. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/create_record.rb +2 -2
  266. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/create_zone.rb +1 -1
  267. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/delete_record.rb +0 -0
  268. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/delete_zone.rb +0 -0
  269. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/get_record.rb +2 -2
  270. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/get_records.rb +1 -1
  271. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/get_zone.rb +0 -0
  272. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/{parsers/dns/slicehost → requests/dns}/get_zones.rb +0 -0
  273. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost.rb +2 -2
  274. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand.rb +1 -1
  275. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud.rb +1 -1
  276. data/lib/brightbox-cli/vendor/fog/lib/fog/virtual_box.rb +1 -1
  277. data/lib/brightbox-cli/vendor/fog/lib/fog/vmfusion/models/compute/servers.rb +6 -6
  278. data/lib/brightbox-cli/vendor/fog/lib/fog/vmfusion.rb +1 -1
  279. data/lib/brightbox-cli/vendor/fog/lib/fog/voxel.rb +1 -1
  280. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/compute.rb +0 -2
  281. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere.rb +1 -1
  282. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/dns.rb +14 -3
  283. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/models/dns/record.rb +1 -1
  284. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/models/dns/records.rb +5 -0
  285. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/models/dns/zones.rb +2 -2
  286. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/count_hosts.rb +20 -1
  287. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/count_zones.rb +12 -1
  288. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/create_host.rb +67 -1
  289. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/create_zone.rb +44 -1
  290. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/delete_host.rb +19 -0
  291. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/delete_zone.rb +17 -0
  292. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/find_hosts.rb +22 -1
  293. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/get_host.rb +18 -1
  294. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/get_zone.rb +19 -2
  295. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/get_zone_stats.rb +23 -0
  296. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/list_hosts.rb +20 -1
  297. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/list_zones.rb +15 -0
  298. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/update_host.rb +20 -1
  299. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/update_zone.rb +20 -1
  300. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo.rb +1 -1
  301. data/lib/brightbox-cli/vendor/fog/lib/fog.rb +1 -1
  302. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_data_tests.rb +40 -0
  303. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_history_tests.rb +20 -0
  304. data/lib/brightbox-cli/vendor/fog/tests/aws/models/compute/server_tests.rb +2 -0
  305. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elasticache/cluster_tests.rb +30 -0
  306. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elasticache/parameter_groups_tests.rb +17 -0
  307. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elasticache/security_groups_tests.rb +52 -0
  308. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb +2 -0
  309. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/cloud_watch/list_metrics_test.rb +5 -5
  310. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/image_tests.rb +33 -2
  311. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/tag_tests.rb +40 -0
  312. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elasticache/cache_cluster_tests.rb +137 -0
  313. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elasticache/describe_events.rb +17 -0
  314. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elasticache/helper.rb +68 -0
  315. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elasticache/parameter_group_tests.rb +105 -0
  316. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elasticache/security_group_tests.rb +107 -0
  317. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/server_certificate_tests.rb +39 -18
  318. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/simpledb/attributes_tests.rb +18 -18
  319. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/simpledb/domain_tests.rb +7 -7
  320. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/sqs/message_tests.rb +1 -7
  321. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/sqs/queue_tests.rb +0 -5
  322. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/load_balancer_tests.rb +1 -0
  323. data/lib/brightbox-cli/vendor/fog/tests/compute/models/flavors_tests.rb +1 -1
  324. data/lib/brightbox-cli/vendor/fog/tests/core/attribute_tests.rb +29 -0
  325. data/lib/brightbox-cli/vendor/fog/tests/core/credential_tests.rb +2 -0
  326. data/lib/brightbox-cli/vendor/fog/tests/helper.rb +1 -1
  327. data/lib/brightbox-cli/vendor/fog/tests/helpers/collection_helper.rb +5 -0
  328. data/lib/brightbox-cli/vendor/fog/tests/helpers/compute/server_helper.rb +1 -0
  329. data/lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper.rb +16 -8
  330. data/lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb +8 -0
  331. data/lib/brightbox-cli/vendor/fog/tests/helpers/mock_helper.rb +6 -2
  332. data/lib/brightbox-cli/vendor/fog/tests/linode/requests/compute/linodeplans_tests.rb +2 -1
  333. data/lib/brightbox-cli/vendor/fog/tests/ninefold/requests/compute/helper.rb +14 -17
  334. data/lib/brightbox-cli/vendor/fog/tests/openstack/requests/compute/flavor_tests.rb +35 -0
  335. data/lib/brightbox-cli/vendor/fog/tests/openstack/requests/compute/helper.rb +17 -0
  336. data/lib/brightbox-cli/vendor/fog/tests/openstack/requests/compute/image_tests.rb +59 -0
  337. data/lib/brightbox-cli/vendor/fog/tests/openstack/requests/compute/server_tests.rb +142 -0
  338. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/dns_tests.rb +21 -21
  339. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/helper.rb +17 -9
  340. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/records_tests.rb +16 -16
  341. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{access_list_tests.rb → load_balancers/access_list_tests.rb} +0 -0
  342. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{algorithm_tests.rb → load_balancers/algorithm_tests.rb} +0 -0
  343. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{connection_logging_tests.rb → load_balancers/connection_logging_tests.rb} +0 -0
  344. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{connection_throttling_tests.rb → load_balancers/connection_throttling_tests.rb} +0 -0
  345. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{helper.rb → load_balancers/helper.rb} +12 -1
  346. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{load_balancer_tests.rb → load_balancers/load_balancer_tests.rb} +1 -1
  347. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{load_balancer_usage_tests.rb → load_balancers/load_balancer_usage_tests.rb} +0 -0
  348. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{monitor_tests.rb → load_balancers/monitor_tests.rb} +0 -0
  349. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{node_tests.rb → load_balancers/node_tests.rb} +0 -0
  350. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{protocol_tests.rb → load_balancers/protocol_tests.rb} +0 -0
  351. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{session_persistence_tests.rb → load_balancers/session_persistence_tests.rb} +0 -0
  352. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{usage_tests.rb → load_balancers/usage_tests.rb} +0 -0
  353. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/{virtual_ip_tests.rb → load_balancers/virtual_ip_tests.rb} +2 -2
  354. data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb +2 -1
  355. data/lib/brightbox-cli/version.rb +1 -1
  356. data/lib/brightbox_cli.rb +16 -10
  357. data/spec/cloud_ips_spec.rb +17 -0
  358. data/spec/firewall_policy_spec.rb +78 -0
  359. data/spec/firewall_rule_spec.rb +74 -0
  360. data/spec/fixtures/vcr_cassettes/apply_firewall_policy.yml +137 -0
  361. data/spec/fixtures/vcr_cassettes/create_firewall_policy.yml +104 -0
  362. data/spec/fixtures/vcr_cassettes/destroy_firewall_policy.yml +137 -0
  363. data/spec/fixtures/vcr_cassettes/firewall_rule.yml +36 -0
  364. data/spec/fixtures/vcr_cassettes/firewall_rule_create.yml +36 -0
  365. data/spec/fixtures/vcr_cassettes/firewall_rule_destroy.yml +69 -0
  366. data/spec/fixtures/vcr_cassettes/firewall_rule_list.yml +36 -0
  367. data/spec/fixtures/vcr_cassettes/firewall_rule_show.yml +36 -0
  368. data/spec/fixtures/vcr_cassettes/list_cloud_ip.yml +36 -0
  369. data/spec/fixtures/vcr_cassettes/list_firewall_policy.yml +36 -0
  370. data/spec/fixtures/vcr_cassettes/list_server_groups.yml +36 -0
  371. data/spec/fixtures/vcr_cassettes/server_destroy.yml +71 -0
  372. data/spec/fixtures/vcr_cassettes/server_show.yml +141 -0
  373. data/spec/fixtures/vcr_cassettes/server_shutdown.yml +104 -0
  374. data/spec/fixtures/vcr_cassettes/server_start.yml +137 -0
  375. data/spec/fixtures/vcr_cassettes/server_stop.yml +104 -0
  376. data/spec/fixtures/vcr_cassettes/show_firewall_policy.yml +36 -0
  377. data/spec/server_group_spec.rb +15 -0
  378. data/spec/servers_spec.rb +75 -0
  379. data/spec/spec_helper.rb +0 -3
  380. data/tools/bash_completion_script +269 -122
  381. metadata +224 -41
@@ -13,14 +13,54 @@ Shindo.tests('Fog::Compute[:aws] | tag requests', ['aws']) do
13
13
  @volume.wait_for { ready? }
14
14
 
15
15
  tests('success') do
16
+ if Fog.mocking?
17
+ @other_account = Fog::Compute::AWS.new(:aws_access_key_id => 'other', :aws_secret_access_key => 'account')
18
+ @image_id = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1').body['imageId']
19
+ end
20
+
16
21
  tests("#create_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
17
22
  Fog::Compute[:aws].create_tags(@volume.identity, 'foo' => 'bar').body
18
23
  end
19
24
 
25
+ if Fog.mocking?
26
+ tests("#create_tags('#{@image_id}', 'foo' => 'baz')").formats(AWS::Compute::Formats::BASIC) do
27
+ Fog::Compute[:aws].create_tags(@image_id, 'foo' => 'baz').body
28
+ end
29
+ end
30
+
20
31
  tests('#describe_tags').formats(@tags_format) do
21
32
  Fog::Compute[:aws].describe_tags.body
22
33
  end
23
34
 
35
+ expected_identities = Fog.mocking? ? [@volume.identity, @image_id] : [@volume.identity]
36
+ tests('#describe_tags').succeeds do
37
+ (expected_identities - Fog::Compute[:aws].describe_tags.body['tagSet'].map {|t| t['resourceId'] }).empty?
38
+ end
39
+
40
+ tests("#describe_tags('key' => 'foo', 'value' => 'bar')").returns([@volume.identity]) do
41
+ Fog::Compute[:aws].describe_tags('key' => 'foo', 'value' => 'bar').body['tagSet'].map {|t| t['resourceId'] }
42
+ end
43
+
44
+ if Fog.mocking?
45
+ tests("#describe_tags('key' => 'foo', 'value' => 'baz')").returns([@image_id]) do
46
+ Fog::Compute[:aws].describe_tags('key' => 'foo', 'value' => 'baz').body['tagSet'].map {|t| t['resourceId'] }
47
+ end
48
+
49
+ Fog::Compute[:aws].modify_image_attribute(@image_id, 'Add.UserId' => [@other_account.data[:owner_id]])
50
+
51
+ tests("other_account#describe_tags('key' => 'foo', 'value' => 'baz')").returns([]) do
52
+ @other_account.describe_tags('key' => 'foo', 'value' => 'baz').body['tagSet'].map {|t| t['resourceId'] }
53
+ end
54
+
55
+ tests("other_account#create_tags('#{@image_id}', 'foo' => 'quux')").formats(AWS::Compute::Formats::BASIC) do
56
+ @other_account.create_tags(@image_id, 'foo' => 'quux').body
57
+ end
58
+
59
+ tests("other_account#describe_tags('key' => 'foo', 'value' => 'quux')").returns([@image_id]) do
60
+ @other_account.describe_tags('key' => 'foo', 'value' => 'quux').body['tagSet'].map {|t| t['resourceId'] }
61
+ end
62
+ end
63
+
24
64
  tests("#delete_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
25
65
  Fog::Compute[:aws].delete_tags(@volume.identity, 'foo' => 'bar').body
26
66
  end
@@ -0,0 +1,137 @@
1
+ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']) do
2
+
3
+ tests('success') do
4
+ pending if Fog.mocking?
5
+
6
+ # Randomize the cluster ID so tests can be fequently re-run
7
+ CLUSTER_ID = "fog-test-cluster-#{rand(999).to_s}" # 20 chars max!
8
+ NUM_NODES = 2 # Must be > 1, because one of the tests reomves a node!
9
+
10
+ tests(
11
+ '#create_cache_cluster'
12
+ ).formats(AWS::Elasticache::Formats::SINGLE_CACHE_CLUSTER) do
13
+ body = AWS[:elasticache].create_cache_cluster(CLUSTER_ID,
14
+ :num_nodes => NUM_NODES
15
+ ).body
16
+ cluster = body['CacheCluster']
17
+ returns(CLUSTER_ID) { cluster['CacheClusterId'] }
18
+ returns('creating') { cluster['CacheClusterStatus'] }
19
+ body
20
+ end
21
+
22
+ tests(
23
+ '#describe_cache_clusters without options'
24
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_CACHE_CLUSTERS) do
25
+ body = AWS[:elasticache].describe_cache_clusters.body
26
+ returns(true, "has #{CLUSTER_ID}") do
27
+ body['CacheClusters'].any? do |cluster|
28
+ cluster['CacheClusterId'] == CLUSTER_ID
29
+ end
30
+ end
31
+ # The DESCRIBE_CACHE_CLUSTERS format must include only one cluster
32
+ # So remove all but the relevant cluster from the response body
33
+ test_cluster = body['CacheClusters'].delete_if do |cluster|
34
+ cluster['CacheClusterId'] != CLUSTER_ID
35
+ end
36
+ body
37
+ end
38
+
39
+ tests(
40
+ '#describe_cache_clusters with cluster ID'
41
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_CACHE_CLUSTERS) do
42
+ body = AWS[:elasticache].describe_cache_clusters(CLUSTER_ID).body
43
+ returns(1, "size of 1") { body['CacheClusters'].size }
44
+ returns(CLUSTER_ID, "has #{CLUSTER_ID}") do
45
+ body['CacheClusters'].first['CacheClusterId']
46
+ end
47
+ body
48
+ end
49
+
50
+ Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
51
+ AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
52
+
53
+ tests(
54
+ '#describe_cache_clusters with node info'
55
+ ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
56
+ cluster = AWS[:elasticache].describe_cache_clusters(CLUSTER_ID,
57
+ :show_node_info => true
58
+ ).body['CacheClusters'].first
59
+ returns(NUM_NODES, "has #{NUM_NODES} nodes") do
60
+ cluster['CacheNodes'].count
61
+ end
62
+ cluster
63
+ end
64
+
65
+ tests(
66
+ '#modify_cache_cluster - change a non-pending cluster attribute'
67
+ ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
68
+ body = AWS[:elasticache].modify_cache_cluster(CLUSTER_ID,
69
+ :auto_minor_version_upgrade => false
70
+ ).body
71
+ # now check that parameter change is in place
72
+ returns('false') { body['CacheCluster']['AutoMinorVersionUpgrade'] }
73
+ body['CacheCluster']
74
+ end
75
+
76
+ tests(
77
+ '#reboot_cache_cluster - reboot a node'
78
+ ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
79
+ c = AWS[:elasticache].clusters.get(CLUSTER_ID)
80
+ node_id = c.nodes.last['CacheNodeId']
81
+ Formatador.display_line "Rebooting node #{node_id}..."
82
+ body = AWS[:elasticache].reboot_cache_cluster(c.id, [ node_id ]).body
83
+ returns('rebooting cache cluster nodes') do
84
+ body['CacheCluster']['CacheClusterStatus']
85
+ end
86
+ body['CacheCluster']
87
+ end
88
+
89
+ Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
90
+ AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
91
+
92
+ tests(
93
+ '#modify_cache_cluster - remove a node'
94
+ ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
95
+ c = AWS[:elasticache].clusters.get(CLUSTER_ID)
96
+ node_id = c.nodes.last['CacheNodeId']
97
+ Formatador.display_line "Removing node #{node_id}..."
98
+ body = AWS[:elasticache].modify_cache_cluster(c.id,
99
+ {
100
+ :num_nodes => NUM_NODES - 1,
101
+ :nodes_to_remove => node_id,
102
+ :apply_immediately => true,
103
+ }).body
104
+ c.reload
105
+ returns(NUM_NODES - 1) { c.pending_values['NumCacheNodes'] }
106
+ body['CacheCluster']
107
+ end
108
+
109
+ Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
110
+ AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
111
+
112
+ tests(
113
+ '#delete_cache_clusters'
114
+ ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
115
+ body = AWS[:elasticache].delete_cache_cluster(CLUSTER_ID).body
116
+ # make sure this particular cluster is in the returned list
117
+ returns(true, "has #{CLUSTER_ID}") do
118
+ body['CacheClusters'].any? do |cluster|
119
+ cluster['CacheClusterId'] == CLUSTER_ID
120
+ end
121
+ end
122
+ # now check that it reports itself as 'deleting'
123
+ cluster = body['CacheClusters'].find do |cluster|
124
+ cluster['CacheClusterId'] == CLUSTER_ID
125
+ end
126
+ returns('deleting') { cluster['CacheClusterStatus'] }
127
+ cluster
128
+ end
129
+ end
130
+
131
+ tests('failure') do
132
+ # TODO:
133
+ # Create a duplicate cluster ID
134
+ # List a missing cache cluster
135
+ # Delete a missing cache cluster
136
+ end
137
+ end
@@ -0,0 +1,17 @@
1
+ Shindo.tests('AWS::Elasticache | describe cache cluster events',
2
+ ['aws', 'elasticache']) do
3
+
4
+ tests('success') do
5
+ pending if Fog.mocking?
6
+
7
+ tests(
8
+ '#describe_events'
9
+ ).formats(AWS::Elasticache::Formats::EVENT_LIST) do
10
+ AWS[:elasticache].describe_events().body['Events']
11
+ end
12
+ end
13
+
14
+ tests('failure') do
15
+ # TODO:
16
+ end
17
+ end
@@ -0,0 +1,68 @@
1
+ class AWS
2
+ module Elasticache
3
+ module Formats
4
+
5
+ BASIC = {
6
+ 'ResponseMetadata' => {'RequestId' => String}
7
+ }
8
+
9
+ # Cache Security Groups
10
+ SECURITY_GROUP = {
11
+ 'EC2SecurityGroups' => Array,
12
+ 'CacheSecurityGroupName' => String,
13
+ 'Description' => String,
14
+ 'OwnerId' => String,
15
+ }
16
+ SINGLE_SECURITY_GROUP = BASIC.merge('CacheSecurityGroup' => SECURITY_GROUP)
17
+ DESCRIBE_SECURITY_GROUPS = {'CacheSecurityGroups' => [SECURITY_GROUP]}
18
+
19
+ # Cache Parameter Groups
20
+ PARAMETER_GROUP = {
21
+ 'CacheParameterGroupFamily' => String,
22
+ 'CacheParameterGroupName' => String,
23
+ 'Description' => String,
24
+ }
25
+ SINGLE_PARAMETER_GROUP = BASIC.merge('CacheParameterGroup' => PARAMETER_GROUP)
26
+ DESCRIBE_PARAMETER_GROUPS = BASIC.merge('CacheParameterGroups' => [PARAMETER_GROUP])
27
+ MODIFY_PARAMETER_GROUP = {'CacheParameterGroupName' => String }
28
+ PARAMETER_SET = {
29
+ 'Parameters' => Array,
30
+ 'CacheNodeTypeSpecificParameters' => Array,
31
+ }
32
+ ENGINE_DEFAULTS = PARAMETER_SET.merge('CacheParameterGroupFamily' => String)
33
+ # Cache Clusters - more parameters get added as the lifecycle progresses
34
+ CACHE_CLUSTER = {
35
+ 'AutoMinorVersionUpgrade' => String, # actually TrueClass or FalseClass
36
+ 'CacheSecurityGroups' => Array,
37
+ 'CacheClusterId' => String,
38
+ 'CacheClusterStatus' => String,
39
+ 'CacheNodeType' => String,
40
+ 'Engine' => String,
41
+ 'EngineVersion' => String,
42
+ 'CacheParameterGroup' => Hash,
43
+ 'NumCacheNodes' => Integer,
44
+ 'PreferredMaintenanceWindow' => String,
45
+ 'CacheNodes' => Array,
46
+ 'PendingModifiedValues' => Hash,
47
+ }
48
+ CACHE_CLUSTER_RUNNING = CACHE_CLUSTER.merge({
49
+ 'CacheClusterCreateTime' => DateTime,
50
+ 'PreferredAvailabilityZone' => String,
51
+ })
52
+ CACHE_CLUSTER_MODIFIED = CACHE_CLUSTER_RUNNING.merge({
53
+ 'NotificationConfiguration' => Hash,
54
+ 'PendingModifiedValues' => Hash,
55
+ })
56
+ SINGLE_CACHE_CLUSTER = BASIC.merge('CacheCluster' => CACHE_CLUSTER)
57
+ DESCRIBE_CACHE_CLUSTERS = BASIC.merge('CacheClusters' => [CACHE_CLUSTER])
58
+
59
+ EVENT = {
60
+ 'Date' => DateTime,
61
+ 'Message' => String,
62
+ 'SourceIdentifier' => String,
63
+ 'SourceType' => String,
64
+ }
65
+ EVENT_LIST = [EVENT]
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,105 @@
1
+ Shindo.tests('AWS::Elasticache | parameter group requests', ['aws', 'elasticache']) do
2
+
3
+ tests('success') do
4
+ pending if Fog.mocking?
5
+
6
+ name = 'fog-test'
7
+ description = 'Fog Test Parameter Group'
8
+
9
+ tests(
10
+ '#describe_engine_default_parameters'
11
+ ).formats(AWS::Elasticache::Formats::ENGINE_DEFAULTS) do
12
+ response = AWS[:elasticache].describe_engine_default_parameters
13
+ engine_defaults = response.body['EngineDefaults']
14
+ returns('memcached1.4') { engine_defaults['CacheParameterGroupFamily'] }
15
+ engine_defaults
16
+ end
17
+
18
+ tests(
19
+ '#create_cache_parameter_group'
20
+ ).formats(AWS::Elasticache::Formats::SINGLE_PARAMETER_GROUP) do
21
+ body = AWS[:elasticache].create_cache_parameter_group(name, description).body
22
+ group = body['CacheParameterGroup']
23
+ returns(name) { group['CacheParameterGroupName'] }
24
+ returns(description) { group['Description'] }
25
+ returns('memcached1.4') { group['CacheParameterGroupFamily'] }
26
+ body
27
+ end
28
+
29
+ tests(
30
+ '#describe_cache_parameters'
31
+ ).formats(AWS::Elasticache::Formats::PARAMETER_SET) do
32
+ response = AWS[:elasticache].describe_cache_parameters(name)
33
+ parameter_set = response.body['DescribeCacheParametersResult']
34
+ parameter_set
35
+ end
36
+
37
+ tests(
38
+ '#describe_cache_parameter_groups without options'
39
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_PARAMETER_GROUPS) do
40
+ body = AWS[:elasticache].describe_cache_parameter_groups.body
41
+ returns(true, "has #{name}") do
42
+ body['CacheParameterGroups'].any? do |group|
43
+ group['CacheParameterGroupName'] == name
44
+ end
45
+ end
46
+ body
47
+ end
48
+
49
+ tests(
50
+ '#reset_cache_parameter_group completely'
51
+ ).formats('CacheParameterGroupName' => String) do
52
+ result = AWS[:elasticache].reset_cache_parameter_group(
53
+ name
54
+ ).body['ResetCacheParameterGroupResult']
55
+ returns(name) {result['CacheParameterGroupName']}
56
+ result
57
+ end
58
+
59
+ tests(
60
+ '#modify_cache_parameter_group'
61
+ ).formats('CacheParameterGroupName' => String) do
62
+ result = AWS[:elasticache].modify_cache_parameter_group(
63
+ name, {"chunk_size" => 32}
64
+ ).body['ModifyCacheParameterGroupResult']
65
+ returns(name) {result['CacheParameterGroupName']}
66
+ result
67
+ end
68
+
69
+ # BUG: returns "MalformedInput - Unexpected complex element termination"
70
+ tests(
71
+ '#reset_cache_parameter_group with one parameter'
72
+ ).formats('CacheParameterGroupName' => String) do
73
+ pending
74
+ result = AWS[:elasticache].reset_cache_parameter_group(
75
+ name, ["chunk_size"]
76
+ ).body['ResetCacheParameterGroupResult']
77
+ returns(name) {result['CacheParameterGroupName']}
78
+ result
79
+ end
80
+
81
+ tests(
82
+ '#describe_cache_parameter_groups with name'
83
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_PARAMETER_GROUPS) do
84
+ body = AWS[:elasticache].describe_cache_parameter_groups(name).body
85
+ returns(1, "size of 1") { body['CacheParameterGroups'].size }
86
+ returns(name, "has #{name}") do
87
+ body['CacheParameterGroups'].first['CacheParameterGroupName']
88
+ end
89
+ body
90
+ end
91
+
92
+ tests(
93
+ '#delete_cache_parameter_group'
94
+ ).formats(AWS::Elasticache::Formats::BASIC) do
95
+ body = AWS[:elasticache].delete_cache_parameter_group(name).body
96
+ end
97
+ end
98
+
99
+ tests('failure') do
100
+ # TODO:
101
+ # Create a duplicate parameter group
102
+ # List a missing parameter group
103
+ # Delete a missing parameter group
104
+ end
105
+ end
@@ -0,0 +1,107 @@
1
+ Shindo.tests('AWS::Elasticache | security group requests', ['aws', 'elasticache']) do
2
+
3
+ tests('success') do
4
+ pending if Fog.mocking?
5
+
6
+ name = 'fog-test'
7
+ description = 'Fog Test Group'
8
+
9
+ tests(
10
+ '#create_cache_security_group'
11
+ ).formats(AWS::Elasticache::Formats::SINGLE_SECURITY_GROUP) do
12
+ body = AWS[:elasticache].create_cache_security_group(name, description).body
13
+ group = body['CacheSecurityGroup']
14
+ returns(name) { group['CacheSecurityGroupName'] }
15
+ returns(description) { group['Description'] }
16
+ returns([], "no authorized security group") { group['EC2SecurityGroups'] }
17
+ body
18
+ end
19
+
20
+ tests(
21
+ '#describe_cache_security_groups without options'
22
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_SECURITY_GROUPS) do
23
+ body = AWS[:elasticache].describe_cache_security_groups.body
24
+ returns(true, "has #{name}") do
25
+ body['CacheSecurityGroups'].any? do |group|
26
+ group['CacheSecurityGroupName'] == name
27
+ end
28
+ end
29
+ body
30
+ end
31
+
32
+ tests(
33
+ '#describe_cache_security_groups with name'
34
+ ).formats(AWS::Elasticache::Formats::DESCRIBE_SECURITY_GROUPS) do
35
+ body = AWS[:elasticache].describe_cache_security_groups(name).body
36
+ returns(1, "size of 1") { body['CacheSecurityGroups'].size }
37
+ returns(name, "has #{name}") do
38
+ body['CacheSecurityGroups'].first['CacheSecurityGroupName']
39
+ end
40
+ body
41
+ end
42
+
43
+ tests('authorization') do
44
+ ec2_group = Fog::Compute.new(:provider => 'AWS').security_groups.create(
45
+ :name => 'fog-test-elasticache', :description => 'Fog Test Elasticache'
46
+ )
47
+ # Reload to get the owner_id
48
+ ec2_group.reload
49
+
50
+ tests(
51
+ '#authorize_cache_security_group_ingress'
52
+ ).formats(AWS::Elasticache::Formats::SINGLE_SECURITY_GROUP) do
53
+ body = AWS[:elasticache].authorize_cache_security_group_ingress(
54
+ name, ec2_group.name, ec2_group.owner_id
55
+ ).body
56
+ group = body['CacheSecurityGroup']
57
+ expected_ec2_groups = [{
58
+ 'Status' => 'authorizing', 'EC2SecurityGroupName' => ec2_group.name,
59
+ 'EC2SecurityGroupOwnerId' => ec2_group.owner_id
60
+ }]
61
+ returns(expected_ec2_groups, 'has correct EC2 groups') do
62
+ group['EC2SecurityGroups']
63
+ end
64
+ body
65
+ end
66
+
67
+ # Wait for the state to be active
68
+ Fog.wait_for do
69
+ response = AWS[:elasticache].describe_cache_security_groups(name)
70
+ group = response.body['CacheSecurityGroups'].first
71
+ group['EC2SecurityGroups'].all? {|ec2| ec2['Status'] == 'authorized'}
72
+ end
73
+
74
+ tests(
75
+ '#revoke_cache_security_group_ingress'
76
+ ).formats(AWS::Elasticache::Formats::SINGLE_SECURITY_GROUP) do
77
+ body = AWS[:elasticache].revoke_cache_security_group_ingress(
78
+ name, ec2_group.name, ec2_group.owner_id
79
+ ).body
80
+ group = body['CacheSecurityGroup']
81
+ expected_ec2_groups = [{
82
+ 'Status' => 'revoking', 'EC2SecurityGroupName' => ec2_group.name,
83
+ 'EC2SecurityGroupOwnerId' => ec2_group.owner_id
84
+ }]
85
+ returns(expected_ec2_groups, 'has correct EC2 groups') do
86
+ group['EC2SecurityGroups']
87
+ end
88
+ body
89
+ end
90
+
91
+ ec2_group.destroy
92
+ end
93
+
94
+ tests(
95
+ '#delete_cache_security_group'
96
+ ).formats(AWS::Elasticache::Formats::BASIC) do
97
+ body = AWS[:elasticache].delete_cache_security_group(name).body
98
+ end
99
+ end
100
+
101
+ tests('failure') do
102
+ # TODO:
103
+ # Create a duplicate security group
104
+ # List a missing security group
105
+ # Delete a missing security group
106
+ end
107
+ end
@@ -1,17 +1,25 @@
1
1
  Shindo.tests('AWS::IAM | server certificate requests', ['aws']) do
2
2
  @key_name = 'fog-test'
3
+ @key_name_chained = 'fog-test-chained'
3
4
 
4
5
  @certificate_format = {
5
- 'Arn' => String,
6
- 'Path' => String,
7
- 'ServerCertificateId' => String,
8
- 'ServerCertificateName' => String,
9
- 'UploadDate' => Time
6
+ 'Arn' => String,
7
+ 'Path' => String,
8
+ 'ServerCertificateId' => String,
9
+ 'ServerCertificateName' => String,
10
+ 'UploadDate' => Time
10
11
  }
11
12
  @upload_format = {
12
13
  'Certificate' => @certificate_format,
13
14
  'RequestId' => String
14
15
  }
16
+ @get_server_certificate_format = {
17
+ 'Certificate' => @certificate_format,
18
+ 'RequestId' => String
19
+ }
20
+ @list_format = {
21
+ 'Certificates' => [@certificate_format]
22
+ }
15
23
 
16
24
  tests('#upload_server_certificate') do
17
25
  public_key = AWS::IAM::SERVER_CERT_PUBLIC_KEY
@@ -19,44 +27,55 @@ Shindo.tests('AWS::IAM | server certificate requests', ['aws']) do
19
27
  private_key_mismatch = AWS::IAM::SERVER_CERT_PRIVATE_KEY_MISMATCHED
20
28
 
21
29
  tests('empty public key').raises(Fog::AWS::IAM::ValidationError) do
22
- Fog::AWS[:iam].upload_server_certificate('', private_key, @key_name)
30
+ Fog::AWS::IAM.new.upload_server_certificate('', private_key, @key_name)
23
31
  end
24
32
 
25
33
  tests('empty private key').raises(Fog::AWS::IAM::ValidationError) do
26
- Fog::AWS[:iam].upload_server_certificate(public_key, '', @key_name)
34
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, '', @key_name)
27
35
  end
28
36
 
29
37
  tests('invalid public key').raises(Fog::AWS::IAM::MalformedCertificate) do
30
- Fog::AWS[:iam].upload_server_certificate('abcde', private_key, @key_name)
38
+ Fog::AWS::IAM.new.upload_server_certificate('abcde', private_key, @key_name)
31
39
  end
32
40
 
33
41
  tests('invalid private key').raises(Fog::AWS::IAM::MalformedCertificate) do
34
- Fog::AWS[:iam].upload_server_certificate(public_key, 'abcde', @key_name)
42
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, 'abcde', @key_name)
35
43
  end
36
44
 
37
45
  tests('mismatched private key').raises(Fog::AWS::IAM::KeyPairMismatch) do
38
- Fog::AWS[:iam].upload_server_certificate(public_key, private_key_mismatch, @key_name)
46
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, private_key_mismatch, @key_name)
39
47
  end
40
48
 
41
49
  tests('format').formats(@upload_format) do
42
- Fog::AWS[:iam].upload_server_certificate(public_key, private_key, @key_name).body
50
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, private_key, @key_name).body
51
+ end
52
+
53
+ tests('format with chain').formats(@upload_format) do
54
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, private_key, @key_name_chained, { 'CertificateChain' => public_key }).body
43
55
  end
44
56
 
45
57
  tests('duplicate name').raises(Fog::AWS::IAM::EntityAlreadyExists) do
46
- Fog::AWS[:iam].upload_server_certificate(public_key, private_key, @key_name)
58
+ Fog::AWS::IAM.new.upload_server_certificate(public_key, private_key, @key_name)
47
59
  end
48
60
  end
49
61
 
50
- tests('#get_server_certificate').formats(@upload_format) do
62
+ tests('#get_server_certificate').formats(@get_server_certificate_format) do
51
63
  tests('raises NotFound').raises(Fog::AWS::IAM::NotFound) do
52
- Fog::AWS[:iam].get_server_certificate("#{@key_name}fake")
64
+ Fog::AWS::IAM.new.get_server_certificate("#{@key_name}fake")
53
65
  end
54
- Fog::AWS[:iam].get_server_certificate(@key_name).body
66
+ Fog::AWS::IAM.new.get_server_certificate(@key_name).body
55
67
  end
56
68
 
57
- @list_format = { 'Certificates' => [@certificate_format] }
58
69
  tests('#list_server_certificates').formats(@list_format) do
59
- result = Fog::AWS[:iam].list_server_certificates.body
70
+ result = Fog::AWS::IAM.new.list_server_certificates.body
71
+ tests('includes key name') do
72
+ returns(true) { result['Certificates'].any?{|c| c['ServerCertificateName'] == @key_name} }
73
+ end
74
+ result
75
+ end
76
+
77
+ tests("#list_server_certificates('path-prefix' => '/'").formats(@list_format) do
78
+ result = Fog::AWS::IAM.new.list_server_certificates('PathPrefix' => '/').body
60
79
  tests('includes key name') do
61
80
  returns(true) { result['Certificates'].any?{|c| c['ServerCertificateName'] == @key_name} }
62
81
  end
@@ -64,6 +83,8 @@ Shindo.tests('AWS::IAM | server certificate requests', ['aws']) do
64
83
  end
65
84
 
66
85
  tests('#delete_server_certificate').formats(AWS::IAM::Formats::BASIC) do
67
- Fog::AWS[:iam].delete_server_certificate(@key_name).body
86
+ Fog::AWS::IAM.new.delete_server_certificate(@key_name).body
68
87
  end
88
+
89
+ Fog::AWS::IAM.new.delete_server_certificate(@key_name_chained)
69
90
  end