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
@@ -1,140 +1,284 @@
1
1
  # brightbox cli tools completion
2
2
  #
3
3
 
4
+ __brightbox_list_ids()
5
+ {
6
+ local plist
7
+ test -d ~/.brightbox/cache && plist=`cd ~/.brightbox/cache/ && ls -t $1 2>/dev/null`
8
+ COMPREPLY=( $( compgen -W '$2 $plist $3' -- "$cur" ) )
9
+ }
10
+
4
11
  _brightbox()
5
12
  {
6
- local cur prev
13
+ local cur prev alist
7
14
 
8
15
  COMPREPLY=()
9
- cur=`_get_cword`
10
- prev=${COMP_WORDS[COMP_CWORD-1]}
16
+ cur=`_get_cword`
17
+ prev=${COMP_WORDS[COMP_CWORD-1]}
11
18
 
12
- command=''
13
- for (( i=1; i < COMP_CWORD; i++ )); do
19
+ command=''
20
+ for (( i=1; i < COMP_CWORD; i++ )); do
14
21
  if [[ "${COMP_WORDS[i]}" != -* ]]; then
15
22
  command=${COMP_WORDS[i]}
16
23
  break
17
24
  fi
18
25
  done
19
26
 
20
- case $1 in
21
- brightbox-servers)
22
- case $command in
23
- create)
24
- case $prev in
25
- -f|--user-data-file)
26
- _filedir
27
- return 0
28
- ;;
29
- -n|--name|-m|--user-data|-i|--server-count)
30
- return 0
31
- ;;
32
- esac
33
- if [[ "$cur" == -* ]] ; then
34
- COMPREPLY=( $( compgen -W '--name --type --zone --server-count --user-data-file --user-data --no-base64' -- "$cur" ) )
35
- else
36
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
37
- fi
38
- ;;
39
- destroy|list|show|shutdown|snapshot|start|stop|activate_console)
40
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
41
- ;;
42
- *)
43
- COMPREPLY=( $( compgen -W 'create destroy help list show shutdown snapshot start stop' -- "$cur" ) )
44
- ;;
45
- esac
46
- ;;
47
- brightbox-images)
48
- case $command in
49
- register)
50
- if [[ "$cur" == -* ]] ; then
51
- COMPREPLY=( $( compgen -W '--unmap' -- "$cur" ) )
52
- fi
53
- ;;
54
- destroy|list|show)
55
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
56
- ;;
57
- *)
58
- COMPREPLY=( $( compgen -W 'destroy help list show register' -- "$cur" ) )
59
- ;;
60
- esac
61
- ;;
62
- brightbox-cloudips)
63
- case $command in
64
- map)
65
- if [[ "$cur" == -* ]] ; then
66
- COMPREPLY=( $( compgen -W '--unmap' -- "$cur" ) )
67
- else
68
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
69
- fi
70
- ;;
71
- create|destroy|list|unmap|show)
72
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
73
- ;;
74
- *)
75
- COMPREPLY=( $( compgen -W 'create destroy list ummap show map help' -- "$cur" ) )
76
- ;;
77
- esac
78
- ;;
79
- brightbox-config)
80
- case $command in
81
- client_add)
82
- if [[ "$cur" == -* ]] ; then
83
- COMPREPLY=( $( compgen -W '--alias --auth-url' -- "$cur" ) )
84
- fi
85
- ;;
86
- client_default|client_remove|client_list)
87
- ;;
88
- *)
89
- COMPREPLY=( $( compgen -W 'client_add client_remove client_default client_list help' -- "$cur" ) )
90
- ;;
91
- esac
92
- ;;
93
- brightbox-users)
94
- case $command in
95
- update)
96
- case $prev in
97
- -f|--ssh-key)
98
- _filedir
99
- return 0
100
- ;;
101
- -n|--name)
102
- return 0
103
- ;;
104
- esac
105
- if [[ "$cur" == -* ]] ; then
106
- COMPREPLY=( $( compgen -W '--ssh-key --name' -- "$cur" ) )
107
- else
108
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
109
- fi
110
- ;;
111
- list|show)
112
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
113
- ;;
114
- *)
115
- COMPREPLY=( $( compgen -W 'list show update help' -- "$cur" ) )
116
- ;;
117
- esac
118
- ;;
119
- brightbox-lbs)
120
- case $command in
121
- create|update)
122
- if [[ "$cur" == -* ]] ; then
123
- COMPREPLY=( $( compgen -W '--hc-down --hc-interval --port --listeners --name --policy --hc-request --hc-timeout --hc-up --hc-type' -- "$cur" ) )
124
- else
125
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
126
- fi
127
- ;;
128
- destroy|list|show|remove_nodes|add_nodes)
129
- test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
130
- ;;
131
- *)
132
- COMPREPLY=( $( compgen -W 'create destroy help list show shutdown snapshot start stop' -- "$cur" ) )
133
- ;;
134
- esac
135
- ;;
27
+ case $1 in
28
+ brightbox-servers)
29
+ case $command in
30
+ create)
31
+ case $prev in
32
+ -f|--user-data-file)
33
+ _filedir
34
+ return 0
35
+ ;;
36
+ -n|--name|-m|--user-data|-i|--server-count)
37
+ return 0
38
+ ;;
39
+ -g|--server-groups)
40
+ __brightbox_list_ids "grp-*"
41
+ return 0
42
+ ;;
43
+ -z|--zone)
44
+ COMPREPLY=( $( compgen -W 'gb1-a gb1-b' -- "$cur" ) )
45
+ return 0
46
+ ;;
47
+ -t|--type)
48
+ COMPREPLY=( $( compgen -W 'nano mini small medium large' -- "$cur" ) )
49
+ return 0
50
+ ;;
51
+ esac
52
+ if [[ "$cur" == -* ]] ; then
53
+ COMPREPLY=( $( compgen -W '--name --type --zone --server-count --user-data-file --user-data --no-base64 --server-groups' -- "$cur" ) )
54
+ else
55
+ __brightbox_list_ids "img-*"
56
+ fi
57
+ ;;
58
+ destroy|list|show|shutdown|snapshot|start|stop|activate_console)
59
+ __brightbox_list_ids "srv-*"
60
+ ;;
61
+ *)
62
+ COMPREPLY=( $( compgen -W 'create destroy help list show shutdown snapshot start stop update activate_console' -- "$cur" ) )
63
+ ;;
64
+ esac
65
+ ;;
66
+ brightbox-images)
67
+ case $command in
68
+ register|update)
69
+ case $prev in
70
+ -a|--arch)
71
+ COMPREPLY=( $( compgen -W 'i686 x86_64' -- "$cur" ) )
72
+ return 0
73
+ ;;
74
+ -m|--mode)
75
+ COMPREPLY=( $( compgen -W 'virtio compatability' -- "$cur" ) )
76
+ return 0
77
+ ;;
78
+ -p|--public)
79
+ COMPREPLY=( $( compgen -W 'true false' -- "$cur" ) )
80
+ return 0
81
+ ;;
82
+ esac
83
+ if [[ "$cur" == -* ]] ; then
84
+ alist="--arch --description --mode --name --public --username"
85
+ if [[ $command == "register" ]] ; then
86
+ alist="$alist --source"
87
+ fi
88
+ COMPREPLY=( $( compgen -W '$alist' -- "$cur" ) )
89
+ fi
90
+ ;;
91
+ destroy|list|show)
92
+ __brightbox_list_ids "img-*"
93
+ ;;
94
+ *)
95
+ COMPREPLY=( $( compgen -W 'destroy help list show register update' -- "$cur" ) )
96
+ ;;
97
+ esac
98
+ ;;
99
+ brightbox-cloudips)
100
+ case $command in
101
+ map)
102
+ if [[ "$cur" == -* ]] ; then
103
+ COMPREPLY=( $( compgen -W '--unmap' -- "$cur" ) )
104
+ else
105
+ __brightbox_list_ids "cip-* srv-* lba-*"
106
+ fi
107
+ ;;
108
+ update)
109
+ if [[ "$cur" == -* ]] ; then
110
+ COMPREPLY=( $( compgen -W '--delete-reverse-dns --reverse-dns' -- "$cur" ) )
111
+ else
112
+ __brightbox_list_ids "cip-* srv-*"
113
+ fi
114
+ ;;
115
+ destroy|list|unmap|show)
116
+ __brightbox_list_ids "cip-*"
117
+ ;;
118
+ *)
119
+ COMPREPLY=( $( compgen -W 'create destroy list ummap show map help update' -- "$cur" ) )
120
+ ;;
121
+ esac
122
+ ;;
123
+ brightbox-config)
124
+ case $command in
125
+ client_add)
126
+ if [[ "$cur" == -* ]] ; then
127
+ COMPREPLY=( $( compgen -W '--alias --auth-url' -- "$cur" ) )
128
+ fi
129
+ ;;
130
+ client_default|client_remove|client_list)
131
+ ;;
132
+ *)
133
+ COMPREPLY=( $( compgen -W 'client_add client_remove client_default client_list help' -- "$cur" ) )
134
+ ;;
135
+ esac
136
+ ;;
137
+ brightbox-users)
138
+ case $command in
139
+ update)
140
+ case $prev in
141
+ -f|--ssh-key)
142
+ _filedir
143
+ return 0
144
+ ;;
145
+ -n|--name)
146
+ return 0
147
+ ;;
148
+ esac
149
+ if [[ "$cur" == -* ]] ; then
150
+ COMPREPLY=( $( compgen -W '--ssh-key --name' -- "$cur" ) )
151
+ else
152
+ __brightbox_list_ids "usr-*"
153
+ fi
154
+ ;;
155
+ list|show)
156
+ __brightbox_list_ids "usr-*"
157
+ ;;
158
+ *)
159
+ COMPREPLY=( $( compgen -W 'list show update help' -- "$cur" ) )
160
+ ;;
161
+ esac
162
+ ;;
163
+ brightbox-lbs)
164
+ case $command in
165
+ create|update)
166
+ if [[ "$cur" == -* ]] ; then
167
+ COMPREPLY=( $( compgen -W '--hc-down --hc-interval --port --listeners --name --policy --hc-request --hc-timeout --hc-up --hc-type' -- "$cur" ) )
168
+ else
169
+ if [[ $command == "update" ]] ; then
170
+ __brightbox_list_ids "lba-*"
171
+ fi
172
+ fi
173
+ ;;
174
+ destroy|list|show)
175
+ __brightbox_list_ids "lba-*"
176
+ ;;
177
+ remove_nodes|add_nodes)
178
+ __brightbox_list_ids "lba-* srv-*"
179
+ ;;
180
+ *)
181
+ COMPREPLY=( $( compgen -W 'create destroy help list show shutdown snapshot start stop add_nodes remove_nodes update' -- "$cur" ) )
182
+ ;;
183
+ esac
184
+ ;;
185
+ brightbox-groups)
186
+ case $command in
187
+ create)
188
+ if [[ "$cur" == -* ]] ; then
189
+ COMPREPLY=( $( compgen -W '--name --description' -- "$cur" ) )
190
+ fi
191
+ ;;
192
+ update)
193
+ if [[ "$cur" == -* ]] ; then
194
+ COMPREPLY=( $( compgen -W '--name --description' -- "$cur" ) )
195
+ else
196
+ __brightbox_list_ids "grp-*"
197
+ fi
198
+ ;;
199
+ destroy|list|show)
200
+ __brightbox_list_ids "grp-*"
201
+ ;;
202
+ move_servers|remove_servers|add_servers)
203
+ __brightbox_list_ids "grp-* srv-*"
204
+ ;;
205
+ *)
206
+ COMPREPLY=( $( compgen -W 'add_servers create destroy list show move_servers remove_servers update' -- "$cur" ) )
207
+ ;;
208
+ esac
209
+ ;;
210
+ brightbox-firewall-policies)
211
+ case $command in
212
+ create)
213
+ if [[ "$cur" == -* ]] ; then
214
+ COMPREPLY=( $( compgen -W '--name --description' -- "$cur" ) )
215
+ fi
216
+ ;;
217
+ update)
218
+ if [[ "$cur" == -* ]] ; then
219
+ COMPREPLY=( $( compgen -W '--name --description' -- "$cur" ) )
220
+ else
221
+ __brightbox_list_ids "fwp-*"
222
+ fi
223
+ ;;
224
+ destroy|list|show)
225
+ __brightbox_list_ids "fwp-*"
226
+ ;;
227
+ apply|remove)
228
+ __brightbox_list_ids "fwp-* grp-*"
229
+ ;;
230
+ *)
231
+ COMPREPLY=( $( compgen -W 'create apply destroy list remove show help' -- "$cur" ) )
232
+ ;;
233
+ esac
234
+ ;;
235
+ brightbox-firewall-rules)
236
+ case $command in
237
+ create)
238
+ case $prev in
239
+ -d|--destination)
240
+ __brightbox_list_ids "grp-* srv-* lba-*" "any"
241
+ return 0
242
+ ;;
243
+ -s|--source)
244
+ __brightbox_list_ids "grp-* srv-* lba-*" "any"
245
+ return 0
246
+ ;;
247
+ -e|--dport)
248
+ COMPREPLY=( $( compgen -W '22 80,443 6667-6669' -- "$cur" ) )
249
+ return 0
250
+ ;;
251
+ -t|--sport)
252
+ return 0
253
+ ;;
254
+ -i|--icmptype)
255
+ COMPREPLY=( $( compgen -W 'echo-request echo-reply port-unreachable destination-unreachable time-exceeded' -- "$cur" ) )
256
+ return 0
257
+ ;;
258
+ -p|--protocol)
259
+ COMPREPLY=( $( compgen -W 'tcp udp icmp' -- "$cur" ) )
260
+ return 0
261
+ ;;
262
+ esac
263
+ if [[ "$cur" == -* ]] ; then
264
+ COMPREPLY=( $( compgen -W '--destination --dport --icmptype --protocol --source --sport' -- "$cur" ) )
265
+ else
266
+ __brightbox_list_ids "fwp-*"
267
+ fi
268
+ ;;
269
+ list)
270
+ __brightbox_list_ids "fwp-*"
271
+ ;;
272
+ destroy|show)
273
+ __brightbox_list_ids "fwr-*"
274
+ ;;
275
+ *)
276
+ COMPREPLY=( $( compgen -W 'create destroy list show help' -- "$cur" ) )
277
+ ;;
278
+ esac
279
+ ;;
136
280
 
137
- esac
281
+ esac
138
282
 
139
283
  }
140
284
  complete -F _brightbox -o filenames brightbox-servers
@@ -143,6 +287,9 @@ complete -F _brightbox -o filenames brightbox-cloudips
143
287
  complete -F _brightbox -o filenames brightbox-config
144
288
  complete -F _brightbox -o filenames brightbox-users
145
289
  complete -F _brightbox -o filenames brightbox-lbs
290
+ complete -F _brightbox -o filenames brightbox-groups
291
+ complete -F _brightbox -o filenames brightbox-firewall-policies
292
+ complete -F _brightbox -o filenames brightbox-firewall-rules
146
293
 
147
294
  # Local variables:
148
295
  # mode: shell-script