brightbox-cli 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,46 @@
1
+ module Fog
2
+ module AWS
3
+ class Elasticache
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/elasticache/event_list'
7
+
8
+ # Returns a list of service events
9
+ #
10
+ # === Parameters (optional)
11
+ # * options <~Hash> (optional):
12
+ # * :start_time <~DateTime> - starting time for event records
13
+ # * :end_time <~DateTime> - ending time for event records
14
+ # * :duration <~DateTime> - time span for event records
15
+ # * :marker <~String> - marker provided in the previous request
16
+ # * :max_records <~Integer> - the maximum number of records to include
17
+ # * :source_identifier <~DateTime> - identifier of the event source
18
+ # * :source_type <~DateTime> - event type, one of:
19
+ # (cache-cluster | cache-parameter-group | cache-security-group)
20
+ # === Returns
21
+ # * response <~Excon::Response>:
22
+ # * body <~Hash>
23
+ def describe_events(options = {})
24
+ request(
25
+ 'Action' => 'DescribeEvents',
26
+ 'StartTime' => options[:sart_time],
27
+ 'EndTime' => options[:end_time],
28
+ 'Duration' => options[:duration],
29
+ 'Marker' => options[:marker],
30
+ 'MaxRecords' => options[:max_records],
31
+ 'SourceIdentifier' => options[:source_identifier],
32
+ 'SourceType' => options[:source_type],
33
+ :parser => Fog::Parsers::AWS::Elasticache::EventListParser.new
34
+ )
35
+ end
36
+
37
+ end
38
+
39
+ class Mock
40
+ def describe_events
41
+ Fog::Mock.not_implemented
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,70 @@
1
+ module Fog
2
+ module AWS
3
+ class Elasticache
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/elasticache/single_cache_cluster'
7
+
8
+ # Modifies an existing cache cluster
9
+ # Returns a cache cluster description
10
+ #
11
+ # === Required Parameters
12
+ # * id <~String> - The ID of the existing cluster to be modified
13
+ # === Optional Parameters
14
+ # * options <~Hash> - All optional parameters should be set in this Hash:
15
+ # * :apply_immediately <~TrueFalseClass> - whether to apply changes now
16
+ # * :auto_minor_version_upgrade <~TrueFalseClass>
17
+ # * :num_nodes <~Integer> - The number of nodes in the Cluster
18
+ # * :nodes_to_remove <~Array> - Array of node IDs to delete
19
+ # * :security_group_names <~Array> - Array of Elasticache::SecurityGroup names
20
+ # * :parameter_group_name <~String> - Name of the Cluster's ParameterGroup
21
+ # * :engine_version <~String> - The Cluster's caching software version
22
+ # * :notification_topic_arn <~String> - Amazon SNS Resource Name
23
+ # * :notification_topic_status <~String> - Amazon SNS Topic status
24
+ # * :preferred_maintenance_window <~String>
25
+ # === Returns
26
+ # * response <~Excon::Response>:
27
+ # * body <~Hash>
28
+ def modify_cache_cluster(id, options = {})
29
+ # Construct Cache Security Group parameters in the format:
30
+ # CacheSecurityGroupNames.member.N => "security_group_name"
31
+ group_names = options[:security_group_names] || []
32
+ sec_group_params = group_names.inject({}) do |group_hash, name|
33
+ index = group_names.index(name) + 1
34
+ group_hash["CacheSecurityGroupNames.member.#{index}"] = name
35
+ group_hash
36
+ end
37
+ # Construct CacheNodeIdsToRemove parameters in the format:
38
+ # CacheNodeIdsToRemove.member.N => "node_id"
39
+ node_ids = options[:nodes_to_remove] || []
40
+ node_id_params = node_ids.inject({}) do |node_hash, node_id|
41
+ index = node_ids.index(node_id) + 1
42
+ node_hash["CacheNodeIdsToRemove.member.#{index}"] = node_id
43
+ node_hash
44
+ end
45
+ # Merge the Cache Security Group parameters with the normal options
46
+ request(node_id_params.merge(sec_group_params.merge(
47
+ 'Action' => 'ModifyCacheCluster',
48
+ 'CacheClusterId' => id,
49
+ 'ApplyImmediately' => options[:apply_immediately],
50
+ 'NumCacheNodes' => options[:num_nodes],
51
+ 'AutoMinorVersionUpgrade' => options[:auto_minor_version_upgrade],
52
+ 'CacheParameterGroupName' => options[:parameter_group_name],
53
+ 'EngineVersion' => options[:engine_version],
54
+ 'NotificationTopicArn' => options[:notification_topic_arn],
55
+ 'NotificationTopicStatus' => options[:notification_topic_status],
56
+ 'PreferredMaintenanceWindow' => options[:preferred_maintenance_window],
57
+ :parser => Fog::Parsers::AWS::Elasticache::SingleCacheCluster.new
58
+ )))
59
+ end
60
+
61
+ end
62
+
63
+ class Mock
64
+ def modify_cache_cluster
65
+ Fog::Mock.not_implemented
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,45 @@
1
+ module Fog
2
+ module AWS
3
+ class Elasticache
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/elasticache/modify_parameter_group'
7
+
8
+ # Modifies an existing cache parameter group
9
+ # Returns a the name of the modified parameter group
10
+ #
11
+ # === Required Parameters
12
+ # * id <~String> - The ID of the parameter group to be modified
13
+ # * new_parameters <~Hash> - The parameters to modify, and their values
14
+ # === Returns
15
+ # * response <~Excon::Response>:
16
+ # * body <~Hash>
17
+ def modify_cache_parameter_group(id, new_parameters)
18
+ # Construct Parameter Modifications in the format:
19
+ # ParameterNameValues.member.N.ParameterName => "param_name"
20
+ # ParameterNameValues.member.N.ParameterValue => "param_value"
21
+ n = 0 # n is the parameter index
22
+ parameter_changes = new_parameters.inject({}) do |new_args,pair|
23
+ n += 1
24
+ new_args["ParameterNameValues.member.#{n}.ParameterName"] = pair[0]
25
+ new_args["ParameterNameValues.member.#{n}.ParameterValue"] = pair[1]
26
+ new_args
27
+ end
28
+ # Merge the Cache Security Group parameters with the normal options
29
+ request(parameter_changes.merge(
30
+ 'Action' => 'ModifyCacheParameterGroup',
31
+ 'CacheParameterGroupName' => id,
32
+ :parser => Fog::Parsers::AWS::Elasticache::ModifyParameterGroup.new
33
+ ))
34
+ end
35
+
36
+ end
37
+
38
+ class Mock
39
+ def modify_cache_parameter_group(id, new_parameters)
40
+ Fog::Mock.not_implemented
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ module Fog
2
+ module AWS
3
+ class Elasticache
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/elasticache/single_cache_cluster'
7
+
8
+ # Reboots some or all of an existing cache cluster's nodes
9
+ # Returns a cache cluster description
10
+ #
11
+ # === Required Parameters
12
+ # * id <~String> - The ID of the existing cluster to be rebooted
13
+ # === Optional Parameters
14
+ # * nodes_to_reboot <~Array> - Array of node IDs to reboot
15
+ # === Returns
16
+ # * response <~Excon::Response>:
17
+ # * body <~Hash>
18
+ def reboot_cache_cluster(id, nodes_to_reboot)
19
+ # Construct CacheNodeIdsToReboot parameters in the format:
20
+ # CacheNodeIdsToReboot.member.N => "node_id"
21
+ node_ids = nodes_to_reboot || []
22
+ node_id_params = node_ids.inject({}) do |node_hash, node_id|
23
+ index = node_ids.index(node_id) + 1
24
+ node_hash["CacheNodeIdsToReboot.member.#{index}"] = node_id
25
+ node_hash
26
+ end
27
+ # Merge the CacheNodeIdsToReboot parameters with the normal options
28
+ request(node_id_params.merge(
29
+ 'Action' => 'RebootCacheCluster',
30
+ 'CacheClusterId' => id,
31
+ :parser => Fog::Parsers::AWS::Elasticache::SingleCacheCluster.new
32
+ ))
33
+ end
34
+
35
+ end
36
+
37
+ class Mock
38
+ def reboot_cache_cluster
39
+ Fog::Mock.not_implemented
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,46 @@
1
+ module Fog
2
+ module AWS
3
+ class Elasticache
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/elasticache/reset_parameter_group'
7
+
8
+ # Resets an existing cache parameter group
9
+ # Returns a the name of the modified parameter group
10
+ #
11
+ # === Required Parameters
12
+ # * id <~String> - The ID of the parameter group to be modified
13
+ # === Optional Parameters
14
+ # * parameter_names <~Array> - The parameters to reset
15
+ # === Returns
16
+ # * response <~Excon::Response>:
17
+ # * body <~Hash>
18
+ def reset_cache_parameter_group(id, parameter_names = [])
19
+ # Construct Parameter resets in the format:
20
+ # ParameterNameValues.member.N => "param_name"
21
+ parameter_changes = parameter_names.inject({}) do |new_args, param|
22
+ index = parameter_names.index(param) + 1
23
+ new_args["ParameterNameValues.member.#{index}"] = param
24
+ new_args
25
+ end
26
+ if parameter_changes.empty?
27
+ parameter_changes = {'ResetAllParameters' => 'true'}
28
+ end
29
+ # Merge the Cache Security Group parameters with the normal options
30
+ request(parameter_changes.merge(
31
+ 'Action' => 'ResetCacheParameterGroup',
32
+ 'CacheParameterGroupName' => id,
33
+ :parser => Fog::Parsers::AWS::Elasticache::ResetParameterGroup.new
34
+ ))
35
+ end
36
+
37
+ end
38
+
39
+ class Mock
40
+ def reset_cache_parameter_group(id, parameter_names)
41
+ Fog::Mock.not_implemented
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,37 @@
1
+
2
+ module Fog
3
+ module AWS
4
+ class Elasticache
5
+ class Real
6
+
7
+ require 'fog/aws/parsers/elasticache/single_security_group'
8
+
9
+ # Revoke ingress to a CacheSecurityGroup using EC2 Security Groups
10
+ #
11
+ # === Parameters
12
+ # * name <~String> - The name of the cache security group
13
+ # * ec2_name <~String> - The name of the EC2 security group to revoke
14
+ # * ec2_owner_id <~String> - The AWS Account Number of the EC2 security group
15
+ # === Returns
16
+ # * response <~Excon::Response>:
17
+ # * body <~Hash>
18
+ def revoke_cache_security_group_ingress(name, ec2_name, ec2_owner_id)
19
+ request({
20
+ 'Action' => 'RevokeCacheSecurityGroupIngress',
21
+ 'CacheSecurityGroupName' => name,
22
+ 'EC2SecurityGroupName' => ec2_name,
23
+ 'EC2SecurityGroupOwnerId' => ec2_owner_id,
24
+ :parser => Fog::Parsers::AWS::Elasticache::SingleSecurityGroup.new
25
+ })
26
+ end
27
+
28
+ end
29
+
30
+ class Mock
31
+ def revoke_cache_security_group_ingress
32
+ Fog::Mock.not_implemented
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -56,7 +56,7 @@ module Fog
56
56
 
57
57
  raise Fog::AWS::ELB::IdentifierTaken if self.data[:load_balancers].has_key? lb_name
58
58
 
59
- certificate_ids = Fog::AWS::IAM.new.list_server_certificates.body['Certificates'].collect { |c| c['Arn'] }
59
+ certificate_ids = Fog::AWS::IAM::Mock.data[@aws_access_key_id][:server_certificates].map {|n, c| c['Arn'] }
60
60
 
61
61
  listeners = [*listeners].map do |listener|
62
62
  if listener['SSLCertificateId'] and !certificate_ids.include? listener['SSLCertificateId']
@@ -52,7 +52,7 @@ module Fog
52
52
  if load_balancer = self.data[:load_balancers][lb_name]
53
53
  response = Excon::Response.new
54
54
 
55
- certificate_ids = Fog::AWS::IAM.new.list_server_certificates.body['Certificates'].collect { |c| c['Arn'] }
55
+ certificate_ids = Fog::AWS::IAM::Mock.data[@aws_access_key_id][:server_certificates].map {|n, c| c['Arn'] }
56
56
 
57
57
  listeners.each do |listener|
58
58
  if listener['SSLCertificateId'] and !certificate_ids.include? listener['SSLCertificateId']
@@ -37,7 +37,7 @@ module Fog
37
37
  raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]
38
38
  instance_ids = [*instance_ids]
39
39
  instance_ids.each do |instance|
40
- raise Fog::AWS::ELB::InvalidInstance unless Compute[:aws].servers.get(instance)
40
+ raise Fog::AWS::ELB::InvalidInstance unless Fog::Compute::AWS::Mock.data[@region][@aws_access_key_id][:instances][instance]
41
41
  end
42
42
 
43
43
  response = Excon::Response.new
@@ -40,13 +40,13 @@ module Fog
40
40
  instance_ids = [*instance_ids]
41
41
  instance_ids = load_balancer['Instances'].collect { |i| i['InstanceId'] } unless instance_ids.any?
42
42
  data = instance_ids.map do |id|
43
- unless instance = Compute[:aws].servers.get(id)
43
+ unless Fog::Compute::AWS::Mock.data[@region][@aws_access_key_id][:instances][id]
44
44
  raise Fog::AWS::ELB::InvalidInstance
45
45
  end
46
46
 
47
47
  {
48
48
  'Description' => "",
49
- 'InstanceId' => instance.id,
49
+ 'InstanceId' => id,
50
50
  'ReasonCode' => "",
51
51
  'State' => 'OutOfService'
52
52
  }
@@ -37,7 +37,7 @@ module Fog
37
37
  raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]
38
38
  instance_ids = [*instance_ids]
39
39
  instances = instance_ids.map do |instance|
40
- raise Fog::AWS::ELB::InvalidInstance unless Compute[:aws].servers.get(instance)
40
+ raise Fog::AWS::ELB::InvalidInstance unless Fog::Compute::AWS::Mock.data[@region][@aws_access_key_id][:instances][instance]
41
41
  {'InstanceId' => instance}
42
42
  end
43
43
 
@@ -18,10 +18,10 @@ module Fog
18
18
  # ==== See Also
19
19
  # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_GetServerCertificate.html
20
20
  #
21
- def get_server_certificate(server_certificate_name)
21
+ def get_server_certificate(name)
22
22
  request({
23
23
  'Action' => 'GetServerCertificate',
24
- 'ServerCertificateName' => server_certificate_name,
24
+ 'ServerCertificateName' => name,
25
25
  :parser => Fog::Parsers::AWS::IAM::UploadServerCertificate.new
26
26
  })
27
27
  end
@@ -29,18 +29,16 @@ module Fog
29
29
  end
30
30
 
31
31
  class Mock
32
- def get_server_certificate(server_certificate_name)
33
- raise Fog::AWS::IAM::NotFound unless self.data[:server_certificates].key?(server_certificate_name)
32
+ def get_server_certificate(name)
33
+ raise Fog::AWS::IAM::NotFound unless certificate = self.data[:server_certificates][name]
34
34
 
35
35
  response = Excon::Response.new
36
36
  response.status = 200
37
37
  response.body = {
38
- 'Certificate' => self.data[:server_certificates][server_certificate_name],
38
+ 'Certificate' => certificate,
39
39
  'RequestId' => Fog::AWS::Mock.request_id
40
40
  }
41
41
 
42
- self.data[:server_certificates]
43
-
44
42
  response
45
43
  end
46
44
  end
@@ -40,10 +40,12 @@ module Fog
40
40
 
41
41
  class Mock
42
42
  def list_server_certificates(options = {})
43
+ certificates = self.data[:server_certificates].values
44
+ certificates = certificates.select { |certificate| certificate['Path'] =~ Regexp.new("^#{options['PathPrefix']}") } if options['PathPrefix']
43
45
  response = Excon::Response.new
44
46
  response.status = 200
45
47
  response.body = {
46
- 'Certificates' => self.data[:server_certificates].values
48
+ 'Certificates' => certificates
47
49
  }
48
50
 
49
51
  response
@@ -52,6 +52,7 @@ module Fog
52
52
  # Validate cert and key
53
53
  begin
54
54
  cert = OpenSSL::X509::Certificate.new(certificate)
55
+ chain = OpenSSL::X509::Certificate.new(options['CertificateChain']) if options['CertificateChain']
55
56
  key = OpenSSL::PKey::RSA.new(private_key)
56
57
  rescue OpenSSL::X509::CertificateError, OpenSSL::PKey::RSAError => e
57
58
  message = if e.is_a?(OpenSSL::X509::CertificateError)
@@ -70,9 +71,9 @@ module Fog
70
71
  raise Fog::AWS::IAM::EntityAlreadyExists.new
71
72
  else
72
73
  response.status = 200
73
- path = "server-certificates/#{name}"
74
+ path = options['path'] || "/"
74
75
  data = {
75
- 'Arn' => Fog::AWS::Mock.arn('iam', self.data[:owner_id], path),
76
+ 'Arn' => Fog::AWS::Mock.arn('iam', self.data[:owner_id], "server-certificate/#{name}"),
76
77
  'Path' => path,
77
78
  'ServerCertificateId' => Fog::AWS::IAM::Mock.server_certificate_id,
78
79
  'ServerCertificateName' => name,
@@ -27,6 +27,36 @@ module Fog
27
27
  end
28
28
 
29
29
  end
30
+
31
+ class Mock
32
+
33
+ def change_message_visibility(queue_url, receipt_handle, visibility_timeout)
34
+ Excon::Response.new.tap do |response|
35
+ if (queue = data[:queues][queue_url])
36
+ message_id, _ = queue[:receipt_handles].find { |message_id, receipts|
37
+ receipts.keys.include?(receipt_handle)
38
+ }
39
+
40
+ if message_id
41
+ queue[:messages][message_id]['Attributes']['VisibilityTimeout'] = visibility_timeout
42
+ response.body = {
43
+ 'ResponseMetadata' => {
44
+ 'RequestId' => Fog::AWS::Mock.request_id
45
+ }
46
+ }
47
+ response.status = 200
48
+ else
49
+ response.status = 404
50
+ raise(Excon::Errors.status_error({:expects => 200}, response))
51
+ end
52
+ else
53
+ response.status = 404
54
+ raise(Excon::Errors.status_error({:expects => 200}, response))
55
+ end
56
+ end
57
+ end
58
+
59
+ end
30
60
 
31
61
  end
32
62
  end
@@ -25,7 +25,41 @@ module Fog
25
25
  end
26
26
 
27
27
  end
28
-
28
+
29
+ class Mock
30
+ def create_queue(name, options = {})
31
+ Excon::Response.new.tap do |response|
32
+ response.status = 200
33
+
34
+ now = Time.now
35
+ queue_url = "https://queue.amazonaws.com/#{data[:owner_id]}/#{name}"
36
+ queue = {
37
+ 'QueueName' => name,
38
+ 'Attributes' => {
39
+ 'VisibilityTimeout' => 30,
40
+ 'ApproximateNumberOfMessages' => 0,
41
+ 'ApproximateNumberOfMessagesNotVisible' => 0,
42
+ 'CreatedTimestamp' => now,
43
+ 'LastModifiedTimestamp' => now,
44
+ 'QueueArn' => Fog::AWS::Mock.arn('sqs', 'us-east-1', data[:owner_id], name),
45
+ 'MaximumMessageSize' => 8192,
46
+ 'MessageRetentionPeriod' => 345600
47
+ },
48
+ :messages => {},
49
+ :receipt_handles => {}
50
+ }
51
+ data[:queues][queue_url] = queue unless data[:queues][queue_url]
52
+
53
+ response.body = {
54
+ 'ResponseMetadata' => {
55
+ 'RequestId' => Fog::AWS::Mock.request_id
56
+ },
57
+ 'QueueUrl' => queue_url
58
+ }
59
+ end
60
+
61
+ end
62
+ end
29
63
  end
30
64
  end
31
65
  end
@@ -25,7 +25,36 @@ module Fog
25
25
  end
26
26
 
27
27
  end
28
+
29
+ class Mock
28
30
 
31
+ def delete_message(queue_url, receipt_handle)
32
+ Excon::Response.new.tap do |response|
33
+ if (queue = data[:queues][queue_url])
34
+ message_id, _ = queue[:receipt_handles].find { |msg_id, receipts|
35
+ receipts.keys.include?(receipt_handle)
36
+ }
37
+
38
+ if message_id
39
+ queue[:receipt_handles].delete(message_id)
40
+ queue[:messages].delete(message_id)
41
+ queue['Attributes']['LastModifiedTimestamp'] = Time.now
42
+ end
43
+
44
+ response.body = {
45
+ 'ResponseMetadata' => {
46
+ 'RequestId' => Fog::AWS::Mock.request_id
47
+ }
48
+ }
49
+ response.status = 200
50
+ else
51
+ response.status = 404
52
+ raise(Excon::Errors.status_error({:expects => 200}, response))
53
+ end
54
+ end
55
+ end
56
+
57
+ end
29
58
  end
30
59
  end
31
60
  end
@@ -23,7 +23,30 @@ module Fog
23
23
  end
24
24
 
25
25
  end
26
-
26
+
27
+ class Mock
28
+
29
+ def delete_queue(queue_url)
30
+ Excon::Response.new.tap do |response|
31
+ if (queue = data[:queues][queue_url])
32
+ response.status = 200
33
+
34
+ data[:queues].delete(queue_url)
35
+
36
+ response.body = {
37
+ 'ResponseMetadata' => {
38
+ 'RequestId' => Fog::AWS::Mock.request_id
39
+ }
40
+ }
41
+ else
42
+ response.status = 404
43
+ raise(Excon::Errors.status_error({:expects => 200}, response))
44
+ end
45
+ end
46
+ end
47
+
48
+ end
49
+
27
50
  end
28
51
  end
29
52
  end
@@ -25,7 +25,28 @@ module Fog
25
25
  end
26
26
 
27
27
  end
28
-
28
+
29
+ class Mock
30
+
31
+ def get_queue_attributes(queue_url, attribute_name)
32
+ Excon::Response.new.tap do |response|
33
+ if (queue = data[:queues][queue_url])
34
+ response.status = 200
35
+
36
+ response.body = {
37
+ 'ResponseMetadata' => {
38
+ 'RequestId' => Fog::AWS::Mock.request_id
39
+ },
40
+ 'Attributes' => queue['Attributes']
41
+ }
42
+ else
43
+ response.status = 404
44
+ raise(Excon::Errors.status_error({:expects => 200}, response))
45
+ end
46
+ end
47
+ end
48
+
49
+ end
29
50
  end
30
51
  end
31
52
  end
@@ -22,7 +22,21 @@ module Fog
22
22
  }.merge!(options))
23
23
  end
24
24
  end
25
-
25
+
26
+ class Mock
27
+ def list_queues(options = {})
28
+ Excon::Response.new.tap do |response|
29
+ response.status = 200
30
+
31
+ response.body = {
32
+ 'ResponseMetadata' => {
33
+ 'RequestId' => Fog::AWS::Mock.request_id
34
+ },
35
+ 'QueueUrls' => data[:queues].keys
36
+ }
37
+ end
38
+ end
39
+ end
26
40
  end
27
41
  end
28
42
  end