brightbox-cli 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +18 -19
- data/bin/_brightbox-bash-completer +42 -0
- data/brightbox-cli.gemspec +5 -5
- data/lib/brightbox-cli/accounts.rb +1 -3
- data/lib/brightbox-cli/api.rb +27 -8
- data/lib/brightbox-cli/cloud_ips.rb +11 -15
- data/lib/brightbox-cli/collaborating_account.rb +23 -26
- data/lib/brightbox-cli/collaboration.rb +1 -1
- data/lib/brightbox-cli/commands/{accounts-accept-invite.rb → accounts/accept-invite.rb} +2 -3
- data/lib/brightbox-cli/commands/{accounts-default.rb → accounts/default.rb} +1 -3
- data/lib/brightbox-cli/commands/{accounts-list.rb → accounts/list.rb} +1 -1
- data/lib/brightbox-cli/commands/{accounts-remove.rb → accounts/remove.rb} +1 -2
- data/lib/brightbox-cli/commands/{accounts-reset-ftp-password.rb → accounts/reset-ftp-password.rb} +10 -5
- data/lib/brightbox-cli/commands/{accounts-show.rb → accounts/show.rb} +14 -6
- data/lib/brightbox-cli/commands/{cloudips-create.rb → cloudips/create.rb} +4 -4
- data/lib/brightbox-cli/commands/{cloudips-destroy.rb → cloudips/destroy.rb} +1 -1
- data/lib/brightbox-cli/commands/{cloudips-list.rb → cloudips/list.rb} +2 -10
- data/lib/brightbox-cli/commands/{cloudips-map.rb → cloudips/map.rb} +2 -8
- data/lib/brightbox-cli/commands/{cloudips-show.rb → cloudips/show.rb} +13 -3
- data/lib/brightbox-cli/commands/{cloudips-unmap.rb → cloudips/unmap.rb} +1 -1
- data/lib/brightbox-cli/commands/{cloudips-update.rb → cloudips/update.rb} +5 -6
- data/lib/brightbox-cli/commands/collaborations.rb +3 -9
- data/lib/brightbox-cli/commands/{config-client-add.rb → config/client-add.rb} +2 -2
- data/lib/brightbox-cli/commands/{config-client-default.rb → config/client-default.rb} +1 -1
- data/lib/brightbox-cli/commands/{config-client-list.rb → config/client-list.rb} +3 -3
- data/lib/brightbox-cli/commands/{config-client-remove.rb → config/client-remove.rb} +4 -1
- data/lib/brightbox-cli/commands/{config-user-add.rb → config/user-add.rb} +1 -1
- data/lib/brightbox-cli/commands/{firewall-policies-apply.rb → firewall/policies-apply.rb} +3 -4
- data/lib/brightbox-cli/commands/{firewall-policies-create.rb → firewall/policies-create.rb} +3 -4
- data/lib/brightbox-cli/commands/{firewall-policies-destroy.rb → firewall/policies-destroy.rb} +2 -3
- data/lib/brightbox-cli/commands/{firewall-policies-list.rb → firewall/policies-list.rb} +2 -9
- data/lib/brightbox-cli/commands/{firewall-policies-remove.rb → firewall/policies-remove.rb} +2 -3
- data/lib/brightbox-cli/commands/{firewall-policies-show.rb → firewall/policies-show.rb} +11 -3
- data/lib/brightbox-cli/commands/{firewall-policies-update.rb → firewall/policies-update.rb} +3 -3
- data/lib/brightbox-cli/commands/{firewall-rules-create.rb → firewall/rules-create.rb} +4 -4
- data/lib/brightbox-cli/commands/{firewall-rules-destroy.rb → firewall/rules-destroy.rb} +2 -4
- data/lib/brightbox-cli/commands/{firewall-rules-list.rb → firewall/rules-list.rb} +2 -2
- data/lib/brightbox-cli/commands/{firewall-rules-show.rb → firewall/rules-show.rb} +10 -4
- data/lib/brightbox-cli/commands/{firewall-rules-update.rb → firewall/rules-update.rb} +3 -3
- data/lib/brightbox-cli/commands/{groups-add-server.rb → groups/add-server.rb} +2 -2
- data/lib/brightbox-cli/commands/{groups-create.rb → groups/create.rb} +3 -3
- data/lib/brightbox-cli/commands/{groups-destroy.rb → groups/destroy.rb} +2 -2
- data/lib/brightbox-cli/commands/groups/list.rb +14 -0
- data/lib/brightbox-cli/commands/{groups-move_servers.rb → groups/move_servers.rb} +1 -2
- data/lib/brightbox-cli/commands/{groups-remove-servers.rb → groups/remove-servers.rb} +1 -1
- data/lib/brightbox-cli/commands/{groups-show.rb → groups/show.rb} +1 -1
- data/lib/brightbox-cli/commands/{groups-update.rb → groups/update.rb} +5 -10
- data/lib/brightbox-cli/commands/{images-destroy.rb → images/destroy.rb} +2 -2
- data/lib/brightbox-cli/commands/{images-list.rb → images/list.rb} +2 -10
- data/lib/brightbox-cli/commands/{images-register.rb → images/register.rb} +6 -6
- data/lib/brightbox-cli/commands/{images-show.rb → images/show.rb} +2 -11
- data/lib/brightbox-cli/commands/{images-update.rb → images/update.rb} +8 -8
- data/lib/brightbox-cli/commands/{lbs-add-nodes.rb → lbs/add-nodes.rb} +2 -2
- data/lib/brightbox-cli/commands/{lbs-create.rb → lbs/create.rb} +16 -10
- data/lib/brightbox-cli/commands/{lbs-destroy.rb → lbs/destroy.rb} +1 -1
- data/lib/brightbox-cli/commands/{lbs-list.rb → lbs/list.rb} +2 -10
- data/lib/brightbox-cli/commands/{lbs-remove-nodes.rb → lbs/remove-nodes.rb} +2 -2
- data/lib/brightbox-cli/commands/{lbs-show.rb → lbs/show.rb} +4 -7
- data/lib/brightbox-cli/commands/{lbs-update.rb → lbs/update.rb} +16 -10
- data/lib/brightbox-cli/commands/{servers-activate-console.rb → servers/activate-console.rb} +3 -3
- data/lib/brightbox-cli/commands/{servers-create.rb → servers/create.rb} +4 -4
- data/lib/brightbox-cli/commands/{servers-destroy.rb → servers/destroy.rb} +2 -2
- data/lib/brightbox-cli/commands/{servers-list.rb → servers/list.rb} +7 -8
- data/lib/brightbox-cli/commands/{servers-show.rb → servers/show.rb} +1 -6
- data/lib/brightbox-cli/commands/{servers-shutdown.rb → servers/shutdown.rb} +1 -1
- data/lib/brightbox-cli/commands/{servers-snapshot.rb → servers/snapshot.rb} +1 -1
- data/lib/brightbox-cli/commands/{servers-start.rb → servers/start.rb} +1 -1
- data/lib/brightbox-cli/commands/{servers-stop.rb → servers/stop.rb} +1 -1
- data/lib/brightbox-cli/commands/{servers-update.rb → servers/update.rb} +2 -2
- data/lib/brightbox-cli/commands/sql/instances_create.rb +66 -0
- data/lib/brightbox-cli/commands/sql/instances_destroy.rb +28 -0
- data/lib/brightbox-cli/commands/sql/instances_list.rb +27 -0
- data/lib/brightbox-cli/commands/sql/instances_reset_password.rb +33 -0
- data/lib/brightbox-cli/commands/sql/instances_show.rb +26 -0
- data/lib/brightbox-cli/commands/sql/instances_snapshot.rb +25 -0
- data/lib/brightbox-cli/commands/sql/instances_update.rb +45 -0
- data/lib/brightbox-cli/commands/sql/snapshots_destroy.rb +31 -0
- data/lib/brightbox-cli/commands/sql/snapshots_list.rb +25 -0
- data/lib/brightbox-cli/commands/sql/snapshots_show.rb +26 -0
- data/lib/brightbox-cli/commands/sql/snapshots_update.rb +37 -0
- data/lib/brightbox-cli/commands/sql/types.rb +53 -0
- data/lib/brightbox-cli/commands/types.rb +1 -1
- data/lib/brightbox-cli/commands/users/list.rb +17 -0
- data/lib/brightbox-cli/commands/{users-show.rb → users/show.rb} +5 -13
- data/lib/brightbox-cli/commands/{users-update.rb → users/update.rb} +3 -3
- data/lib/brightbox-cli/config.rb +4 -7
- data/lib/brightbox-cli/config/accounts.rb +3 -6
- data/lib/brightbox-cli/config/api_client.rb +12 -4
- data/lib/brightbox-cli/config/authentication_tokens.rb +8 -14
- data/lib/brightbox-cli/config/clients.rb +6 -7
- data/lib/brightbox-cli/config/section_name_deduplicator.rb +4 -5
- data/lib/brightbox-cli/config/sections.rb +7 -10
- data/lib/brightbox-cli/config/user_application.rb +15 -7
- data/lib/brightbox-cli/connection_manager.rb +1 -2
- data/lib/brightbox-cli/database_server.rb +100 -0
- data/lib/brightbox-cli/database_snapshot.rb +36 -0
- data/lib/brightbox-cli/database_type.rb +44 -0
- data/lib/brightbox-cli/detailed_server.rb +8 -7
- data/lib/brightbox-cli/error_parser.rb +8 -4
- data/lib/brightbox-cli/firewall_rule.rb +5 -5
- data/lib/brightbox-cli/firewall_rules.rb +2 -3
- data/lib/brightbox-cli/gli_global_hooks.rb +7 -7
- data/lib/brightbox-cli/images.rb +13 -14
- data/lib/brightbox-cli/legacy/args_adjuster.rb +5 -6
- data/lib/brightbox-cli/load_balancers.rb +10 -13
- data/lib/brightbox-cli/logging.rb +3 -3
- data/lib/brightbox-cli/nilable_hash.rb +1 -1
- data/lib/brightbox-cli/ruby_core_ext.rb +1 -2
- data/lib/brightbox-cli/server_groups.rb +5 -5
- data/lib/brightbox-cli/servers.rb +9 -9
- data/lib/brightbox-cli/tables.rb +24 -25
- data/lib/brightbox-cli/types.rb +6 -5
- data/lib/brightbox-cli/user_collaboration.rb +2 -3
- data/lib/brightbox-cli/users.rb +3 -3
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +10 -2
- data/locales/en.yml +205 -0
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_a_collection_of_Accounts.yml +10 -10
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_resources_on_the_same_connection.yml +4 -4
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_a_collection_of_Accounts.yml +8 -8
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_resources_on_the_same_connection.yml +4 -4
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_changes_to_the_config_file.yml +4 -4
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_default_account.yml +4 -4
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_new_client_as_the_default.yml +4 -4
- data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_is_not_authenticated/does_not_raise_an_error.yml +176 -176
- data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_may_access_one_account/updates_the_setting.yml +176 -176
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_config_in_use_is_not_the_default/uses_correct_credentials.yml +2 -2
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_a_cached_refresh_token/caches_the_new_tokens.yml +2 -2
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_an_expired_refresh_token/caches_the_new_tokens.yml +4 -4
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/caches_the_new_tokens.yml +2 -2
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/prompts_user_to_retry_command.yml +2 -2
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_an_API_client_with_no_tokens/caches_a_new_access_token.yml +2 -2
- data/spec/cassettes/Brightbox_CloudIP/_find_all_/when_a_Cloud_IP_exists/returns_a_suitable.yml +28 -28
- data/spec/cassettes/Brightbox_FirewallPolicy/_apply_to/should_apply_firewall_policy.yml +24 -24
- data/spec/cassettes/Brightbox_FirewallPolicy/_create/should_create_firewall_policy.yml +24 -24
- data/spec/cassettes/Brightbox_FirewallPolicy/_destroy/should_destroy_firewall_policy.yml +28 -28
- data/spec/cassettes/Brightbox_FirewallPolicy/_find_all_/when_a_policy_exists/should_list_firewall_policy.yml +24 -24
- data/spec/cassettes/Brightbox_FirewallPolicy/_find_or_call/when_a_policy_exists/should_show_firewall_policy.yml +20 -20
- data/spec/cassettes/Brightbox_FirewallRule/_create/when_policy_exists/creates_the_rule_successfully.yml +24 -24
- data/spec/cassettes/Brightbox_FirewallRule/_destroy/when_rule_exists/destroys_a_rule.yml +20 -20
- data/spec/cassettes/Brightbox_FirewallRule/_find/when_rule_exists/can_display_the_result.yml +24 -24
- data/spec/cassettes/Brightbox_FirewallRule/_from_policy/when_policy_exists_with_a_rule/lists_all_rules.yml +32 -32
- data/spec/cassettes/Brightbox_Server/_destroy/when_server_exists/should_work.yml +20 -20
- data/spec/cassettes/Brightbox_Server/_find_all_/when_a_server_exists/should_print_server_list.yml +28 -28
- data/spec/cassettes/Brightbox_Server/_show/when_server_exists/shows_detailed_attributes_of_a_server.yml +32 -32
- data/spec/cassettes/Brightbox_Server/_shutdown/should_work.yml +32 -32
- data/spec/cassettes/Brightbox_Server/_start/should_work.yml +44 -44
- data/spec/cassettes/Brightbox_Server/_stop/should_work.yml +32 -32
- data/spec/cassettes/Brightbox_Server/_update/when_passing_new_group_membership/should_update_with_group.yml +40 -40
- data/spec/cassettes/Brightbox_ServerGroup/_find_all_/when_a_group_exists/list_server_groups.yml +24 -24
- data/spec/cassettes/Firewall_policies/update/when_the_policy_does_not_exist/prints_error_to_STDERR.yml +6 -6
- data/spec/cassettes/brightbox_accounts/list/_when_access_token_expired_/does_not_report_invalid_token_errors.yml +18 -18
- data/spec/cassettes/brightbox_accounts/list/_when_both_tokens_expired_/does_not_report_invalid_token_errors.yml +18 -18
- data/spec/cassettes/brightbox_accounts/list/_when_invalid_tokens_/does_not_report_invalid_token_errors.yml +18 -18
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/does_not_report_invalid_token_errors.yml +16 -16
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/reports_they_were_updated.yml +14 -14
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/does_not_report_invalid_token_errors.yml +14 -14
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/reports_unable_to_authenticate.yml +12 -12
- data/spec/cassettes/brightbox_accounts/list/does_not_error.yml +6 -6
- data/spec/cassettes/brightbox_cloudips/map/when_destination_is_a_server_ID/passes_the_interface_identifier_to_the_API.yml +542 -0
- data/spec/cassettes/brightbox_cloudips/map/when_destination_is_another_value/passes_the_identifier_to_the_API.yml +317 -0
- data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/does_not_error.yml +154 -154
- data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/sets_up_the_config.yml +154 -154
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_change_the_default_client.yml +154 -154
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_error.yml +154 -154
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +154 -154
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +154 -154
- data/spec/cassettes/brightbox_config/user_add/when_NO_config_file_on_disk/sets_up_the_config.yml +10 -10
- data/spec/cassettes/brightbox_config/user_add/when_a_default_client_is_already_set/does_not_change_the_default_client.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/display_an_warning_about_preselected_default.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/selects_the_active_account_for_the_default.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/display_an_warning_about_preselected_default.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/does_not_prompt_to_rerun_the_command.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/requests_access_tokens.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +10 -10
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_prompt_to_rerun_the_command.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/requests_access_tokens.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/sets_up_the_config.yml +6 -6
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/requests_access_tokens.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_database-servers/create/--allow-access_10_0_0_0/correctly_sends_API_parameters.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/create/--allow-access_srv-12345_grp-12345/correctly_sends_API_parameters.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/create/--engine_mysql/correctly_sends_API_parameters.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/create/--engine_mysql_--engine-version_5_6/correctly_sends_API_parameters.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_password.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_username.yml +93 -0
- data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_active/correctly_sends_API_parameters.yml +181 -0
- data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_can_not_be_snapshotted/reports_an_error_to_the_user.yml +91 -0
- data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/does_not_output_to_stderr.yml +93 -0
- data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/outputs_table_details_to_stdout.yml +93 -0
- data/spec/cassettes/brightbox_database-snapshots/show/when_resource_exists/does_not_output_to_stderr.yml +93 -0
- data/spec/commands/accounts/list_spec.rb +1 -1
- data/spec/commands/cloudips/map_spec.rb +23 -4
- data/spec/commands/config/user_add_spec.rb +1 -1
- data/spec/commands/sql/instances/create_spec.rb +69 -0
- data/spec/commands/sql/instances/snapshot_spec.rb +36 -0
- data/spec/commands/sql/snapshots/list_spec.rb +29 -0
- data/spec/commands/sql/snapshots/show_spec.rb +29 -0
- data/spec/commands/sql/types/list_spec.rb +18 -0
- data/spec/spec_helper.rb +1 -3
- data/spec/support/vcr.rb +1 -1
- data/spec/unit/brightbox/api/conn_spec.rb +1 -1
- data/spec/unit/brightbox/bb_config/add_section_spec.rb +1 -1
- data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +1 -1
- data/spec/unit/brightbox/database_server_spec.rb +9 -0
- data/spec/unit/brightbox/database_snapshot_spec.rb +9 -0
- data/spec/unit/brightbox/database_type_spec.rb +9 -0
- data/spec/unit/brightbox/firewall_policy/create_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/create_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/find_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +1 -1
- data/spec/unit/brightbox/server/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/server/find_or_call_spec.rb +1 -1
- data/spec/unit/brightbox/server/shutdown_spec.rb +1 -1
- data/spec/unit/brightbox/server/start_spec.rb +1 -1
- data/spec/unit/brightbox/server/stop_spec.rb +1 -1
- data/spec/unit/brightbox/server/update_spec.rb +1 -1
- data/spec/unit/brightbox/server_group/find_spec.rb +1 -1
- data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +3 -3
- metadata +160 -115
- data/lib/brightbox-cli/commands/groups-list.rb +0 -21
- data/lib/brightbox-cli/commands/users-list.rb +0 -25
@@ -1,12 +1,15 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:images] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("images.update.desc")
|
5
5
|
cmd.arg_name "img-id"
|
6
6
|
cmd.command [:update] do |c|
|
7
7
|
|
8
|
-
c.desc "
|
9
|
-
c.flag [:n,
|
8
|
+
c.desc I18n.t("options.name.desc")
|
9
|
+
c.flag [:n, :name]
|
10
|
+
|
11
|
+
c.desc I18n.t("options.description.desc")
|
12
|
+
c.flag [:d, :description]
|
10
13
|
|
11
14
|
c.desc "Architecture of the image (i686 or x86_64)"
|
12
15
|
c.flag [:a, "arch"]
|
@@ -20,17 +23,14 @@ module Brightbox
|
|
20
23
|
c.desc "Set image to be deprecated (true or false)"
|
21
24
|
c.flag "deprecated"
|
22
25
|
|
23
|
-
c.desc "Image description"
|
24
|
-
c.flag [:d, "description"]
|
25
|
-
|
26
26
|
c.desc "Image Username"
|
27
27
|
c.flag [:u, "username"]
|
28
28
|
|
29
29
|
c.action do |global_options, options, args|
|
30
30
|
img_id = args.shift
|
31
31
|
raise "You must specify the image to update as the first argument" unless img_id =~ /^img-/
|
32
|
-
|
33
|
-
|
32
|
+
if options[:m]
|
33
|
+
raise "Mode must be 'virtio' or 'compatibility'" unless options[:m] == "virtio" || options[:m] == "compatibility"
|
34
34
|
end
|
35
35
|
if options[:p]
|
36
36
|
raise "Public must be true or false" unless options[:p] == "true" || options[:p] == "false"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Brightbox
|
2
|
-
desc "
|
2
|
+
desc I18n.t("lbs.desc")
|
3
3
|
command [:lbs] do |cmd|
|
4
4
|
|
5
|
-
cmd.desc "
|
5
|
+
cmd.desc I18n.t("lbs.add_nodes.desc")
|
6
6
|
cmd.arg_name "lb-id node-id..."
|
7
7
|
cmd.command [:add_nodes] do |c|
|
8
8
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:lbs] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
5
|
-
cmd.long_desc "
|
4
|
+
cmd.desc I18n.t("lbs.create.desc")
|
5
|
+
cmd.long_desc I18n.t("lbs.create.long_desc")
|
6
6
|
cmd.arg_name "srv-id..."
|
7
7
|
cmd.command [:create] do |c|
|
8
8
|
|
9
|
-
c.desc "
|
9
|
+
c.desc I18n.t("options.name.desc")
|
10
10
|
c.flag [:n, :name]
|
11
11
|
|
12
12
|
c.desc "Load balancer policy"
|
@@ -53,9 +53,9 @@ module Brightbox
|
|
53
53
|
|
54
54
|
raise "You must specify which servers to balance connections to" if args.empty?
|
55
55
|
|
56
|
-
listeners = options[:l].split(",").
|
56
|
+
listeners = options[:l].split(",").map do |l|
|
57
57
|
inport, outport, protocol, timeout = l.split ":"
|
58
|
-
raise "listener '#{l}' is invalid" if inport.nil?
|
58
|
+
raise "listener '#{l}' is invalid" if inport.nil? || outport.nil? || protocol.nil?
|
59
59
|
{ :in => inport, :out => outport, :protocol => protocol, :timeout => timeout }
|
60
60
|
end
|
61
61
|
|
@@ -70,14 +70,20 @@ module Brightbox
|
|
70
70
|
options[:y] = listeners.first[:protocol]
|
71
71
|
end
|
72
72
|
|
73
|
-
hc_arg_lookup = {
|
74
|
-
|
75
|
-
|
73
|
+
hc_arg_lookup = {
|
74
|
+
:k => :port,
|
75
|
+
:y => :type,
|
76
|
+
:t => :timeout,
|
77
|
+
:s => :request,
|
78
|
+
:e => :interval,
|
79
|
+
:u => :threshold_up,
|
80
|
+
:d => :threshold_down
|
81
|
+
}
|
76
82
|
|
77
83
|
healthcheck = {}
|
78
84
|
|
79
85
|
options.keys.each do |k|
|
80
|
-
if options[k]
|
86
|
+
if options[k] && hc_arg_lookup[k]
|
81
87
|
healthcheck[hc_arg_lookup[k]] = options[k]
|
82
88
|
end
|
83
89
|
end
|
@@ -94,7 +100,7 @@ module Brightbox
|
|
94
100
|
ssl_key = File.read(File.expand_path(ssl_key_path))
|
95
101
|
end
|
96
102
|
|
97
|
-
nodes = args.
|
103
|
+
nodes = args.map { |i| { :node => i } }
|
98
104
|
|
99
105
|
msg = "Creating a new load balancer"
|
100
106
|
info msg
|
@@ -3,19 +3,11 @@ module Brightbox
|
|
3
3
|
|
4
4
|
cmd.default_command :list
|
5
5
|
|
6
|
-
cmd.desc "
|
6
|
+
cmd.desc I18n.t("lbs.list.desc")
|
7
7
|
cmd.arg_name "[lb-id...]"
|
8
8
|
cmd.command [:list] do |c|
|
9
9
|
c.action do |global_options, options, args|
|
10
|
-
|
11
|
-
if args.empty?
|
12
|
-
lbs = LoadBalancer.find(:all)
|
13
|
-
else
|
14
|
-
lbs = LoadBalancer.find_or_call(args) do |id|
|
15
|
-
warn "Couldn't find load balancer #{id}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
10
|
+
lbs = LoadBalancer.find_all_or_warn(args)
|
19
11
|
render_table(lbs, global_options)
|
20
12
|
end
|
21
13
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:lbs] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("lbs.remove_nodes.desc")
|
5
5
|
cmd.arg_name "lb-id node-id..."
|
6
6
|
cmd.command [:remove_nodes] do |c|
|
7
7
|
|
@@ -13,7 +13,7 @@ module Brightbox
|
|
13
13
|
|
14
14
|
# We don't want to check servers exist as you can remove deleted
|
15
15
|
# servers from a load balancer.
|
16
|
-
nodes = args.
|
16
|
+
nodes = args.map { |a| Server.new(a) }
|
17
17
|
|
18
18
|
info "Removing #{nodes.size} nodes from load balancer #{lb.id}"
|
19
19
|
lb.remove_nodes nodes
|
@@ -1,17 +1,12 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:lbs] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("lbs.show.desc")
|
5
5
|
cmd.arg_name "lbs-id..."
|
6
6
|
cmd.command [:show] do |c|
|
7
7
|
|
8
8
|
c.action do |global_options, options, args|
|
9
|
-
|
10
|
-
raise "You must specify load balancers to show" if args.empty?
|
11
|
-
|
12
|
-
lbs = LoadBalancer.find_or_call(args) do |id|
|
13
|
-
raise "Couldn't find lb #{id}"
|
14
|
-
end
|
9
|
+
lbs = LoadBalancer.find_all_or_warn(args)
|
15
10
|
|
16
11
|
table_opts = global_options.merge(
|
17
12
|
:vertical => true,
|
@@ -22,7 +17,9 @@ module Brightbox
|
|
22
17
|
:created_at,
|
23
18
|
:deleted_at,
|
24
19
|
:policy,
|
20
|
+
:ssl_issuer,
|
25
21
|
:ssl_subject,
|
22
|
+
:ssl_valid_from,
|
26
23
|
:ssl_expires_at,
|
27
24
|
:cloud_ips,
|
28
25
|
:nodes,
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:lbs] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
5
|
-
cmd.long_desc "
|
4
|
+
cmd.desc I18n.t("lbs.update.desc")
|
5
|
+
cmd.long_desc I18n.t("lbs.update.long_desc")
|
6
6
|
cmd.arg_name "lba-id [node-id...]"
|
7
7
|
cmd.command [:update] do |c|
|
8
8
|
|
9
|
-
c.desc "
|
9
|
+
c.desc I18n.t("options.name.desc")
|
10
10
|
c.flag [:n, :name]
|
11
11
|
|
12
12
|
c.desc "Load balancer policy"
|
@@ -50,20 +50,26 @@ module Brightbox
|
|
50
50
|
lb_id = args.shift
|
51
51
|
raise "You must specify the load balancer to update as the first argument" unless lb_id =~ /^lba-/
|
52
52
|
|
53
|
-
|
53
|
+
lbopts = NilableHash.new
|
54
54
|
|
55
55
|
unless args.empty?
|
56
|
-
lbopts[:nodes] = args.
|
56
|
+
lbopts[:nodes] = args.map { |a| { :node => a } }
|
57
57
|
end
|
58
58
|
|
59
|
-
hc_arg_lookup = {
|
60
|
-
|
61
|
-
|
59
|
+
hc_arg_lookup = {
|
60
|
+
:k => :port,
|
61
|
+
:y => :type,
|
62
|
+
:t => :timeout,
|
63
|
+
:s => :request,
|
64
|
+
:e => :interval,
|
65
|
+
:u => :threshold_up,
|
66
|
+
:d => :threshold_down
|
67
|
+
}
|
62
68
|
|
63
69
|
healthcheck = {}
|
64
70
|
|
65
71
|
options.keys.each do |k|
|
66
|
-
if options[k]
|
72
|
+
if options[k] && hc_arg_lookup[k]
|
67
73
|
healthcheck[hc_arg_lookup[k]] = options[k]
|
68
74
|
end
|
69
75
|
end
|
@@ -73,7 +79,7 @@ module Brightbox
|
|
73
79
|
end
|
74
80
|
|
75
81
|
if options[:l]
|
76
|
-
lbopts[:listeners] = options[:l].split(",").
|
82
|
+
lbopts[:listeners] = options[:l].split(",").map do |l|
|
77
83
|
inport, output, protocol, timeout = l.split ":"
|
78
84
|
{ :in => inport, :out => output, :protocol => protocol, :timeout => timeout }
|
79
85
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Brightbox
|
2
|
-
desc "
|
2
|
+
desc I18n.t("servers.desc")
|
3
3
|
command [:servers] do |cmd|
|
4
4
|
|
5
|
-
cmd.desc "
|
5
|
+
cmd.desc I18n.t("servers.activate_console.desc")
|
6
6
|
cmd.arg_name "server-id..."
|
7
7
|
cmd.command [:activate_console] do |c|
|
8
8
|
|
@@ -20,7 +20,7 @@ module Brightbox
|
|
20
20
|
info "Activating console for server #{s}"
|
21
21
|
r = s.activate_console
|
22
22
|
url = "#{r["console_url"]}/?password=#{r["console_token"]}"
|
23
|
-
|
23
|
+
expires = Time.parse(r["console_token_expires"])
|
24
24
|
consoles << { :url => url, :token => r["console_token"], :expires => expires.localtime.to_s }
|
25
25
|
end
|
26
26
|
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:servers] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("servers.create.desc")
|
5
5
|
cmd.arg_name "image_id"
|
6
6
|
cmd.command [:create] do |c|
|
7
7
|
|
8
|
+
c.desc I18n.t("options.name.desc")
|
9
|
+
c.flag [:n, :name]
|
10
|
+
|
8
11
|
c.desc "Number of servers to create"
|
9
12
|
c.default_value 1
|
10
13
|
c.flag [:i, "server-count"], :type => Integer
|
@@ -16,9 +19,6 @@ module Brightbox
|
|
16
19
|
c.default_value "nano"
|
17
20
|
c.flag [:t, :type]
|
18
21
|
|
19
|
-
c.desc "Friendly name of server"
|
20
|
-
c.flag [:n, :name]
|
21
|
-
|
22
22
|
c.desc "Specify user data"
|
23
23
|
c.flag [:m, "user-data"]
|
24
24
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:servers] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("servers.destroy.desc")
|
5
5
|
cmd.arg_name "[server-id...]"
|
6
6
|
cmd.command [:destroy] do |c|
|
7
7
|
c.action do |global_options, options, args|
|
@@ -16,7 +16,7 @@ module Brightbox
|
|
16
16
|
info "Destroying server #{server}"
|
17
17
|
begin
|
18
18
|
server.destroy
|
19
|
-
rescue Brightbox::Api::Conflict
|
19
|
+
rescue Brightbox::Api::Conflict
|
20
20
|
error "Could not destroy #{server}"
|
21
21
|
end
|
22
22
|
end
|
@@ -13,18 +13,17 @@ module Brightbox
|
|
13
13
|
c.action do |global_options, options, args|
|
14
14
|
# Check this here before we make any network connections
|
15
15
|
raise "A valid server group identifier is required for the group argument" unless options[:g].nil? || options[:g] =~ /^grp-.{5}$/
|
16
|
+
servers = Server.find_all_or_warn(args)
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
# Scope by group if a group identifier is specified
|
19
|
+
if options[:g]
|
20
|
+
servers = servers.select do
|
21
|
+
|server| server.server_groups.any? do |grp|
|
22
|
+
grp["id"] == options[:g]
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
# Scope by group if a group identifier is specified
|
26
|
-
servers = servers.select {|server| server.server_groups.any? {|grp| grp["id"] == options[:g] } } if options[:g]
|
27
|
-
|
28
27
|
render_table(servers, global_options)
|
29
28
|
end
|
30
29
|
end
|
@@ -6,12 +6,7 @@ module Brightbox
|
|
6
6
|
cmd.command [:show] do |c|
|
7
7
|
|
8
8
|
c.action do |global_options, options, args|
|
9
|
-
|
10
|
-
raise "You must specify servers to show" if args.empty?
|
11
|
-
|
12
|
-
servers = DetailedServer.find_or_call(args) do |id|
|
13
|
-
raise "Couldn't find server #{id}"
|
14
|
-
end
|
9
|
+
servers = DetailedServer.find_all_or_warn(args)
|
15
10
|
|
16
11
|
table_opts = global_options.merge(:vertical => true)
|
17
12
|
render_table(servers, table_opts)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:servers] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("servers.shutdown.desc")
|
5
5
|
cmd.arg_name "server-id..."
|
6
6
|
cmd.command [:shutdown] do |c|
|
7
7
|
c.action do |global_options, options, args|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Brightbox
|
2
2
|
command [:servers] do |cmd|
|
3
3
|
|
4
|
-
cmd.desc "
|
4
|
+
cmd.desc I18n.t("servers.update.desc")
|
5
5
|
cmd.arg_name "server-id"
|
6
6
|
cmd.command [:update] do |c|
|
7
7
|
|
8
|
-
c.desc "
|
8
|
+
c.desc I18n.t("options.name.desc")
|
9
9
|
c.flag [:n, :name]
|
10
10
|
|
11
11
|
c.desc "Specify user data"
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Brightbox
|
2
|
+
desc I18n.t("sql.desc")
|
3
|
+
command [:sql] do |product|
|
4
|
+
|
5
|
+
product.desc I18n.t("sql.instances.desc")
|
6
|
+
product.command [:instances] do |cmd|
|
7
|
+
|
8
|
+
cmd.desc I18n.t("sql.instances.create.desc")
|
9
|
+
cmd.command [:create] do |c|
|
10
|
+
|
11
|
+
c.desc I18n.t("options.name.desc")
|
12
|
+
c.flag [:n, :name]
|
13
|
+
|
14
|
+
c.desc I18n.t("options.description.desc")
|
15
|
+
c.flag [:d, "description"]
|
16
|
+
|
17
|
+
c.desc I18n.t("sql.instances.options.allow_access.desc")
|
18
|
+
c.flag [:"allow-access"]
|
19
|
+
|
20
|
+
# Database type
|
21
|
+
c.desc I18n.t("sql.instances.options.type.desc")
|
22
|
+
c.flag [:t, :type]
|
23
|
+
|
24
|
+
# Database Engine / Version (e.g. "mysql-5.6"
|
25
|
+
c.desc I18n.t("sql.instances.options.engine.desc")
|
26
|
+
c.flag [:engine]
|
27
|
+
c.desc I18n.t("sql.instances.options.engine_version.desc")
|
28
|
+
c.flag ["engine-version"]
|
29
|
+
|
30
|
+
# Snapshot
|
31
|
+
c.desc I18n.t("sql.instances.options.snapshot.desc")
|
32
|
+
c.flag [:snapshot]
|
33
|
+
|
34
|
+
# Zone
|
35
|
+
c.desc I18n.t("sql.instances.options.zone.desc")
|
36
|
+
c.flag [:z, "zone"]
|
37
|
+
|
38
|
+
c.action do |global_options, options, args|
|
39
|
+
params = {}
|
40
|
+
|
41
|
+
params[:name] = options[:n] if options[:n]
|
42
|
+
params[:description] = options[:d] if options[:d]
|
43
|
+
|
44
|
+
if options[:"allow-access"]
|
45
|
+
access_items = options[:"allow-access"].split(",")
|
46
|
+
params[:allow_access] = access_items
|
47
|
+
end
|
48
|
+
|
49
|
+
params[:database_engine] = options[:engine] if options[:engine]
|
50
|
+
params[:database_version] = options["engine-version"] if options["engine-version"]
|
51
|
+
params[:snapshot_id] = options[:snapshot] if options[:snapshot]
|
52
|
+
params[:flavor_id] = options[:type] if options[:type]
|
53
|
+
params[:zone_id] = options[:zone] if options[:zone]
|
54
|
+
|
55
|
+
server = DatabaseServer.create(params)
|
56
|
+
table_options = global_options.merge(
|
57
|
+
:vertical => true,
|
58
|
+
:fields => DatabaseServer.detailed_fields
|
59
|
+
)
|
60
|
+
|
61
|
+
render_table([server], table_options)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|