brightbox-cli 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/Gemfile +0 -2
- data/Gemfile.lock +25 -23
- data/Rakefile +1 -1
- data/bin/_brightbox-bash-completer +327 -328
- data/bin/brightbox +2 -2
- data/bin/brightbox-accounts +2 -2
- data/bin/brightbox-cloudips +2 -2
- data/bin/brightbox-config +2 -2
- data/bin/brightbox-firewall-policies +2 -2
- data/bin/brightbox-firewall-rules +2 -2
- data/bin/brightbox-groups +2 -2
- data/bin/brightbox-images +2 -2
- data/bin/brightbox-lbs +2 -2
- data/bin/brightbox-servers +2 -2
- data/bin/brightbox-types +2 -2
- data/bin/brightbox-users +2 -2
- data/bin/brightbox-zones +2 -2
- data/brightbox-cli.gemspec +14 -15
- data/lib/brightbox-cli/api.rb +4 -6
- data/lib/brightbox-cli/collaboration.rb +1 -3
- data/lib/brightbox-cli/commands/accounts/accept-invite.rb +1 -1
- data/lib/brightbox-cli/commands/accounts/default.rb +1 -1
- data/lib/brightbox-cli/commands/accounts/list.rb +1 -1
- data/lib/brightbox-cli/commands/accounts/remove.rb +1 -1
- data/lib/brightbox-cli/commands/accounts/reset-ftp-password.rb +1 -1
- data/lib/brightbox-cli/commands/accounts/show.rb +1 -1
- data/lib/brightbox-cli/commands/cloudips/create.rb +1 -1
- data/lib/brightbox-cli/commands/cloudips/destroy.rb +1 -1
- data/lib/brightbox-cli/commands/cloudips/list.rb +1 -1
- data/lib/brightbox-cli/commands/cloudips/show.rb +1 -1
- data/lib/brightbox-cli/commands/cloudips/unmap.rb +1 -1
- data/lib/brightbox-cli/commands/collaborations.rb +4 -4
- data/lib/brightbox-cli/commands/config/client-add.rb +1 -1
- data/lib/brightbox-cli/commands/config/client-default.rb +1 -1
- data/lib/brightbox-cli/commands/config/client-list.rb +1 -1
- data/lib/brightbox-cli/commands/config/client-remove.rb +1 -1
- data/lib/brightbox-cli/commands/config/user-add.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/policies-destroy.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/policies-list.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/policies-show.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/rules-destroy.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/rules-list.rb +1 -1
- data/lib/brightbox-cli/commands/firewall/rules-show.rb +1 -1
- data/lib/brightbox-cli/commands/groups/add-server.rb +1 -1
- data/lib/brightbox-cli/commands/groups/create.rb +1 -1
- data/lib/brightbox-cli/commands/groups/destroy.rb +1 -1
- data/lib/brightbox-cli/commands/groups/list.rb +1 -1
- data/lib/brightbox-cli/commands/groups/show.rb +1 -1
- data/lib/brightbox-cli/commands/images/destroy.rb +1 -1
- data/lib/brightbox-cli/commands/images/locking.rb +37 -0
- data/lib/brightbox-cli/commands/images/register.rb +1 -1
- data/lib/brightbox-cli/commands/images/show.rb +18 -4
- data/lib/brightbox-cli/commands/lbs/add-nodes.rb +1 -1
- data/lib/brightbox-cli/commands/lbs/destroy.rb +1 -1
- data/lib/brightbox-cli/commands/lbs/list.rb +1 -1
- data/lib/brightbox-cli/commands/lbs/locking.rb +37 -0
- data/lib/brightbox-cli/commands/lbs/remove-nodes.rb +1 -1
- data/lib/brightbox-cli/commands/lbs/show.rb +3 -2
- data/lib/brightbox-cli/commands/servers/activate-console.rb +1 -1
- data/lib/brightbox-cli/commands/servers/destroy.rb +1 -1
- data/lib/brightbox-cli/commands/servers/locking.rb +37 -0
- data/lib/brightbox-cli/commands/servers/reboot.rb +20 -0
- data/lib/brightbox-cli/commands/servers/reset.rb +20 -0
- data/lib/brightbox-cli/commands/servers/show.rb +1 -1
- data/lib/brightbox-cli/commands/servers/shutdown.rb +1 -1
- data/lib/brightbox-cli/commands/servers/snapshot.rb +1 -1
- data/lib/brightbox-cli/commands/servers/start.rb +1 -1
- data/lib/brightbox-cli/commands/servers/stop.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_create.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_destroy.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_list.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_locking.rb +39 -0
- data/lib/brightbox-cli/commands/sql/instances_reset_password.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_show.rb +1 -1
- data/lib/brightbox-cli/commands/sql/instances_snapshot.rb +1 -1
- data/lib/brightbox-cli/commands/sql/snapshots_destroy.rb +1 -1
- data/lib/brightbox-cli/commands/sql/snapshots_list.rb +1 -1
- data/lib/brightbox-cli/commands/sql/snapshots_locking.rb +39 -0
- data/lib/brightbox-cli/commands/sql/snapshots_show.rb +9 -2
- data/lib/brightbox-cli/commands/sql/types.rb +2 -2
- data/lib/brightbox-cli/commands/types.rb +2 -2
- data/lib/brightbox-cli/commands/user-collaborations.rb +2 -2
- data/lib/brightbox-cli/commands/users/list.rb +1 -1
- data/lib/brightbox-cli/commands/users/show.rb +1 -1
- data/lib/brightbox-cli/commands/zones.rb +1 -1
- data/lib/brightbox-cli/config/accounts.rb +1 -1
- data/lib/brightbox-cli/config/api_client.rb +3 -3
- data/lib/brightbox-cli/config/authentication_tokens.rb +2 -2
- data/lib/brightbox-cli/config/cache.rb +1 -1
- data/lib/brightbox-cli/config/dirty.rb +1 -1
- data/lib/brightbox-cli/config/user_application.rb +3 -3
- data/lib/brightbox-cli/config.rb +2 -2
- data/lib/brightbox-cli/database_server.rb +2 -1
- data/lib/brightbox-cli/database_snapshot.rb +1 -0
- data/lib/brightbox-cli/detailed_server.rb +1 -0
- data/lib/brightbox-cli/gli_global_hooks.rb +2 -2
- data/lib/brightbox-cli/images.rb +2 -1
- data/lib/brightbox-cli/legacy/args_adjuster.rb +3 -3
- data/lib/brightbox-cli/load_balancers.rb +1 -0
- data/lib/brightbox-cli/servers.rb +2 -1
- data/lib/brightbox-cli/user_collaboration.rb +1 -1
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +3 -3
- data/locales/en.yml +24 -0
- data/spec/commands/accounts/default_spec.rb +2 -2
- data/spec/commands/accounts/list_spec.rb +7 -7
- data/spec/commands/accounts/reset_ftp_password_spec.rb +2 -2
- data/spec/commands/accounts/show_spec.rb +2 -2
- data/spec/commands/cloudips/create_spec.rb +2 -2
- data/spec/commands/cloudips/destroy_spec.rb +2 -2
- data/spec/commands/cloudips/list_spec.rb +2 -2
- data/spec/commands/cloudips/map_spec.rb +3 -3
- data/spec/commands/cloudips/show_spec.rb +2 -2
- data/spec/commands/cloudips/unmap_spec.rb +2 -2
- data/spec/commands/cloudips/update_spec.rb +2 -2
- data/spec/commands/config/client_add_spec.rb +2 -2
- data/spec/commands/config/client_default_spec.rb +2 -2
- data/spec/commands/config/client_list_spec.rb +2 -2
- data/spec/commands/config/client_remove_spec.rb +2 -2
- data/spec/commands/config/user_add_spec.rb +3 -6
- data/spec/commands/firewall_policies/update_spec.rb +7 -7
- data/spec/commands/groups/add_server_spec.rb +2 -2
- data/spec/commands/groups/create_spec.rb +2 -2
- data/spec/commands/groups/destroy_spec.rb +2 -2
- data/spec/commands/groups/list_spec.rb +2 -2
- data/spec/commands/groups/move_servers_spec.rb +2 -2
- data/spec/commands/groups/remove_servers_spec.rb +2 -2
- data/spec/commands/groups/show_spec.rb +2 -2
- data/spec/commands/groups/update_spec.rb +2 -2
- data/spec/commands/images/destroy_spec.rb +2 -2
- data/spec/commands/images/list_spec.rb +2 -2
- data/spec/commands/images/locking_spec.rb +73 -0
- data/spec/commands/images/register_spec.rb +2 -2
- data/spec/commands/images/show_spec.rb +2 -2
- data/spec/commands/images/update_spec.rb +2 -2
- data/spec/commands/lbs/add_nodes_spec.rb +2 -2
- data/spec/commands/lbs/create_spec.rb +2 -2
- data/spec/commands/lbs/destroy_spec.rb +2 -2
- data/spec/commands/lbs/list_spec.rb +2 -2
- data/spec/commands/lbs/locking_spec.rb +73 -0
- data/spec/commands/lbs/remove_nodes_spec.rb +2 -2
- data/spec/commands/lbs/show_spec.rb +2 -2
- data/spec/commands/lbs/update_spec.rb +2 -2
- data/spec/commands/policies/apply_spec.rb +2 -2
- data/spec/commands/policies/create_spec.rb +2 -2
- data/spec/commands/policies/destroy_spec.rb +2 -2
- data/spec/commands/policies/list_spec.rb +2 -2
- data/spec/commands/policies/remove_spec.rb +2 -2
- data/spec/commands/policies/show_spec.rb +2 -2
- data/spec/commands/policies/update_spec.rb +2 -2
- data/spec/commands/rules/create_spec.rb +2 -2
- data/spec/commands/rules/destroy_spec.rb +2 -2
- data/spec/commands/rules/list_spec.rb +2 -2
- data/spec/commands/rules/show_spec.rb +2 -2
- data/spec/commands/rules/update_spec.rb +2 -2
- data/spec/commands/servers/activate_console_spec.rb +2 -2
- data/spec/commands/servers/create_spec.rb +2 -2
- data/spec/commands/servers/destroy_spec.rb +2 -2
- data/spec/commands/servers/list_spec.rb +2 -2
- data/spec/commands/servers/locking_spec.rb +73 -0
- data/spec/commands/servers/reboot_spec.rb +55 -0
- data/spec/commands/servers/reset_spec.rb +55 -0
- data/spec/commands/servers/show_spec.rb +2 -2
- data/spec/commands/servers/shutdown_spec.rb +2 -2
- data/spec/commands/servers/snapshot_spec.rb +2 -2
- data/spec/commands/servers/start_spec.rb +2 -2
- data/spec/commands/servers/stop_spec.rb +2 -2
- data/spec/commands/servers/update_spec.rb +2 -2
- data/spec/commands/sql/instances/create_spec.rb +4 -4
- data/spec/commands/sql/instances/locking_spec.rb +73 -0
- data/spec/commands/sql/instances/snapshot_spec.rb +2 -2
- data/spec/commands/sql/snapshots/list_spec.rb +1 -1
- data/spec/commands/sql/snapshots/locking_spec.rb +73 -0
- data/spec/commands/sql/snapshots/show_spec.rb +1 -1
- data/spec/commands/sql/types/list_spec.rb +1 -1
- data/spec/commands/types/list_spec.rb +2 -2
- data/spec/commands/users/list_spec.rb +2 -2
- data/spec/commands/users/show_spec.rb +2 -2
- data/spec/commands/users/update_spec.rb +2 -2
- data/spec/commands/zones/list_spec.rb +2 -2
- data/spec/spec_helper.rb +8 -9
- data/spec/support/common_helpers.rb +10 -10
- data/spec/support/config_helpers.rb +0 -1
- data/spec/support/faux_io.rb +10 -14
- data/spec/support/password_prompt_helpers.rb +1 -2
- data/spec/support/server_helper.rb +1 -1
- data/spec/support/shared/api_resource_examples.rb +8 -8
- data/spec/support/shared/collaborating_accounts_context.rb +2 -2
- data/spec/support/shared/config_section_types.rb +2 -2
- data/spec/support/tmp_config.rb +4 -8
- data/spec/support/token_helpers.rb +1 -1
- data/spec/support/vcr.rb +1 -1
- data/spec/unit/brightbox/account/get_spec.rb +1 -1
- data/spec/unit/brightbox/account_spec.rb +3 -3
- data/spec/unit/brightbox/api/find_spec.rb +6 -6
- data/spec/unit/brightbox/api/require_account_spec.rb +1 -1
- data/spec/unit/brightbox/bb_config/account_spec.rb +3 -3
- data/spec/unit/brightbox/bb_config/clear_default_client_spec.rb +8 -8
- data/spec/unit/brightbox/bb_config/client_has_alias_spec.rb +3 -3
- data/spec/unit/brightbox/bb_config/client_name_spec.rb +5 -5
- data/spec/unit/brightbox/bb_config/client_named_spec.rb +6 -6
- data/spec/unit/brightbox/bb_config/config_directory_exists_spec.rb +3 -3
- data/spec/unit/brightbox/bb_config/config_spec.rb +5 -5
- data/spec/unit/brightbox/bb_config/default_account_spec.rb +6 -6
- data/spec/unit/brightbox/bb_config/default_client_spec.rb +2 -2
- data/spec/unit/brightbox/bb_config/find_or_set_default_account_spec.rb +14 -14
- data/spec/unit/brightbox/bb_config/has_multiple_clients_spec.rb +2 -2
- data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +4 -5
- data/spec/unit/brightbox/bb_config/save_spec.rb +2 -2
- data/spec/unit/brightbox/bb_config/to_fog_spec.rb +2 -2
- data/spec/unit/brightbox/bb_config/using_client_spec.rb +10 -10
- data/spec/unit/brightbox/collaborating_account/resource_type_spec.rb +4 -4
- data/spec/unit/brightbox/collaborating_account_spec.rb +3 -3
- data/spec/unit/brightbox/config/api_client/to_fog_spec.rb +2 -2
- data/spec/unit/brightbox/config/api_client/valid_spec.rb +5 -5
- data/spec/unit/brightbox/config/section_name_deduplicator_spec.rb +1 -1
- data/spec/unit/brightbox/config/to_fog_spec.rb +3 -3
- data/spec/unit/brightbox/config/user_application/to_fog_spec.rb +2 -2
- data/spec/unit/brightbox/config/user_application/valid_spec.rb +6 -6
- data/spec/unit/brightbox/connection_manager/fetch_connection_spec.rb +17 -17
- data/spec/unit/brightbox/firewall_policy/apply_to_spec.rb +3 -3
- data/spec/unit/brightbox/firewall_policy/create_spec.rb +5 -5
- data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +4 -4
- data/spec/unit/brightbox/firewall_policy/find_or_call_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/find_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/create_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +2 -2
- data/spec/unit/brightbox/firewall_rule/find_spec.rb +3 -3
- data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +2 -2
- data/spec/unit/brightbox/legacy/args_adjuster_spec.rb +12 -12
- data/spec/unit/brightbox/server/create_spec.rb +2 -2
- data/spec/unit/brightbox/server/destroy_spec.rb +3 -3
- data/spec/unit/brightbox/server/find_or_call_spec.rb +1 -1
- data/spec/unit/brightbox/server/shutdown_spec.rb +2 -4
- data/spec/unit/brightbox/server/start_spec.rb +4 -4
- data/spec/unit/brightbox/server/stop_spec.rb +2 -4
- data/spec/unit/brightbox/server/update_spec.rb +2 -2
- data/spec/unit/brightbox/server_group/find_spec.rb +1 -1
- data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +4 -4
- data/spec/unit/brightbox/user_collaboration/remove_spec.rb +11 -11
- data/spec/unit/nilable_hash_spec.rb +6 -6
- data/spec/unit/tmp_config_spec.rb +1 -1
- metadata +67 -31
data/bin/brightbox
CHANGED
@@ -4,8 +4,8 @@ begin
|
|
4
4
|
require "brightbox_cli"
|
5
5
|
rescue LoadError
|
6
6
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
7
|
-
|
7
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
8
8
|
require "brightbox_cli"
|
9
9
|
end
|
10
10
|
|
11
|
-
Brightbox
|
11
|
+
Brightbox.run ARGV
|
data/bin/brightbox-accounts
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("accounts")
|
data/bin/brightbox-cloudips
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("cloudips")
|
data/bin/brightbox-config
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("config")
|
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("firewall-policies")
|
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("firewall-rules")
|
data/bin/brightbox-groups
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("groups")
|
data/bin/brightbox-images
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("images")
|
data/bin/brightbox-lbs
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("lbs")
|
data/bin/brightbox-servers
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("servers")
|
data/bin/brightbox-types
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("types")
|
data/bin/brightbox-users
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("users")
|
data/bin/brightbox-zones
CHANGED
@@ -5,9 +5,9 @@ begin
|
|
5
5
|
require "brightbox-cli/legacy/args_adjuster"
|
6
6
|
rescue LoadError
|
7
7
|
brightbox_cli_path = File.expand_path('../../lib', __FILE__)
|
8
|
-
|
8
|
+
$LOAD_PATH.unshift(brightbox_cli_path)
|
9
9
|
require "brightbox_cli"
|
10
10
|
require "brightbox-cli/legacy/args_adjuster"
|
11
11
|
end
|
12
12
|
|
13
|
-
Brightbox
|
13
|
+
Brightbox.run Brightbox::Legacy::ArgsAdjuster.new(ARGV).for_command("zones")
|
data/brightbox-cli.gemspec
CHANGED
@@ -8,31 +8,30 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["John Leach"]
|
9
9
|
s.email = ["john@brightbox.co.uk"]
|
10
10
|
s.homepage = "http://docs.brightbox.com/cli"
|
11
|
-
s.summary = %q
|
12
|
-
s.description = %q
|
11
|
+
s.summary = %q(The Brightbox cloud management system)
|
12
|
+
s.description = %q(Scripts to interact with the Brightbox cloud API)
|
13
13
|
s.license = "MIT"
|
14
14
|
|
15
15
|
s.rubyforge_project = "brightbox-cli"
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split("\n") + `find lib/brightbox-cli/vendor`.split("\n")
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
+
s.add_dependency "fog-brightbox", "~> 0.3"
|
22
23
|
s.add_dependency "gli", "~> 2.9"
|
23
|
-
s.add_dependency "fog-brightbox"
|
24
|
-
s.add_dependency "multi_json"
|
25
|
-
s.add_dependency "mime-types", "~> 1.25"
|
26
|
-
|
27
24
|
s.add_dependency "i18n"
|
28
|
-
|
29
|
-
s.add_dependency
|
30
|
-
s.add_dependency
|
31
|
-
|
32
|
-
|
33
|
-
s.add_development_dependency
|
34
|
-
s.add_development_dependency
|
35
|
-
s.add_development_dependency
|
25
|
+
s.add_dependency "mime-types", "~> 1.25"
|
26
|
+
s.add_dependency "multi_json"
|
27
|
+
s.add_dependency "highline", "~> 1.6"
|
28
|
+
s.add_dependency "hirb", "~> 0.6"
|
29
|
+
|
30
|
+
s.add_development_dependency "mocha"
|
31
|
+
s.add_development_dependency "pry"
|
32
|
+
s.add_development_dependency "rake"
|
33
|
+
s.add_development_dependency "rspec", "~> 2.99"
|
34
|
+
s.add_development_dependency "vcr", "~> 2.5"
|
36
35
|
|
37
36
|
s.post_install_message = <<-EOS
|
38
37
|
The CLI command is now `brightbox` with subcommands for the resources.
|
data/lib/brightbox-cli/api.rb
CHANGED
@@ -99,9 +99,7 @@ module Brightbox
|
|
99
99
|
def self.find(args = :all, options = {})
|
100
100
|
raise InvalidArguments, "find(nil)" if args.nil?
|
101
101
|
raise InvalidArguments, "find([])" if args.respond_to?(:empty?) && args.empty?
|
102
|
-
options = {
|
103
|
-
:order => :created_at,
|
104
|
-
}.merge options
|
102
|
+
options = { :order => :created_at }.merge(options)
|
105
103
|
|
106
104
|
objects = nil
|
107
105
|
object = nil
|
@@ -110,11 +108,11 @@ module Brightbox
|
|
110
108
|
objects = all
|
111
109
|
elsif args.is_a? String
|
112
110
|
object = cached_get(args.to_s)
|
113
|
-
raise NotFound, "Couldn't find '#{args
|
111
|
+
raise NotFound, "Couldn't find '#{args}'" if object.nil?
|
114
112
|
elsif args.respond_to? :map
|
115
113
|
objects = args.map do |arg|
|
116
114
|
o = cached_get(arg.to_s)
|
117
|
-
raise NotFound, "Couldn't find '#{arg
|
115
|
+
raise NotFound, "Couldn't find '#{arg}'" if o.nil?
|
118
116
|
o
|
119
117
|
end
|
120
118
|
else
|
@@ -140,7 +138,7 @@ module Brightbox
|
|
140
138
|
|
141
139
|
# Find each id in the given array. Yield the block with any ids
|
142
140
|
# that couldn't be found
|
143
|
-
def self.find_or_call(ids, &
|
141
|
+
def self.find_or_call(ids, &_block)
|
144
142
|
objects = []
|
145
143
|
ids.each do |id|
|
146
144
|
begin
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.desc I18n.t("accounts.accept_invite.desc")
|
6
6
|
cmd.arg_name "account_id"
|
7
7
|
cmd.command [:accept_invite] do |c|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
account_id = args.first
|
10
10
|
|
11
11
|
# Find the collaboration for that account
|
@@ -7,7 +7,7 @@ module Brightbox
|
|
7
7
|
cmd.arg_name "[account-id...]"
|
8
8
|
cmd.command [:list] do |c|
|
9
9
|
|
10
|
-
c.action do |global_options,
|
10
|
+
c.action do |global_options, _options, _args|
|
11
11
|
if $config.using_application?
|
12
12
|
# Collaborating Accounts are combined from owned and collaborations
|
13
13
|
accounts = CollaboratingAccount.all
|
@@ -4,7 +4,7 @@ module Brightbox
|
|
4
4
|
cmd.desc I18n.t("accounts.remove.desc")
|
5
5
|
cmd.arg_name "account_id"
|
6
6
|
cmd.command [:remove] do |c|
|
7
|
-
c.action do |global_options,
|
7
|
+
c.action do |global_options, _options, args|
|
8
8
|
account_id = args.first
|
9
9
|
|
10
10
|
# Find the collaboration for that account
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.arg_name "account-id..."
|
6
6
|
cmd.command [:reset_ftp_password] do |c|
|
7
7
|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
|
10
10
|
if args.empty?
|
11
11
|
raise "You must specify the accounts to reset ftp passwords for"
|
@@ -15,7 +15,7 @@ module Brightbox
|
|
15
15
|
c.desc I18n.t("cloudips.options.port_translators.desc")
|
16
16
|
c.flag [:t, :"port-translators"]
|
17
17
|
|
18
|
-
c.action do |global_options, options,
|
18
|
+
c.action do |global_options, options, _args|
|
19
19
|
|
20
20
|
if options[:i].to_s !~ /^[0-9]+$/
|
21
21
|
raise "count must be a number"
|
@@ -8,7 +8,7 @@ module Brightbox
|
|
8
8
|
c.desc "Unmap mapped IPs before destroying them"
|
9
9
|
c.switch [:u, "unmap"], :negatable => false
|
10
10
|
|
11
|
-
c.action do |
|
11
|
+
c.action do |_global_options, options, args|
|
12
12
|
|
13
13
|
if args.empty?
|
14
14
|
raise "You must specify the Cloud IPs you want to destroy"
|
@@ -7,7 +7,7 @@ module Brightbox
|
|
7
7
|
cmd.desc "List an accounts collaborations"
|
8
8
|
cmd.arg_name "[collaboration-id...]"
|
9
9
|
cmd.command [:list] do |c|
|
10
|
-
c.action do |global_options,
|
10
|
+
c.action do |global_options, _options, args|
|
11
11
|
collaborations = Collaboration.find_all_or_warn(args)
|
12
12
|
render_table(collaborations, global_options)
|
13
13
|
end
|
@@ -32,7 +32,7 @@ module Brightbox
|
|
32
32
|
cmd.desc "Resends an invitation email for a pending collaboration"
|
33
33
|
cmd.arg_name "collaboration-id"
|
34
34
|
cmd.command [:resend] do |c|
|
35
|
-
c.action do |global_options,
|
35
|
+
c.action do |global_options, _options, args|
|
36
36
|
collaborations = Collaboration.find_or_call(args) do |id|
|
37
37
|
warn "Couldn't find collaboration #{id}"
|
38
38
|
end
|
@@ -44,7 +44,7 @@ module Brightbox
|
|
44
44
|
cmd.desc "Show details of collaborations"
|
45
45
|
cmd.arg_name "[collaboration-id...]"
|
46
46
|
cmd.command [:show] do |c|
|
47
|
-
c.action do |global_options,
|
47
|
+
c.action do |global_options, _options, args|
|
48
48
|
collaborations = Collaboration.find_or_call(args) do |id|
|
49
49
|
warn "Couldn't find collaboration #{id}"
|
50
50
|
end
|
@@ -55,7 +55,7 @@ module Brightbox
|
|
55
55
|
cmd.desc "Destroy collaborations"
|
56
56
|
cmd.arg_name "[collaboration-id...]"
|
57
57
|
cmd.command [:destroy] do |c|
|
58
|
-
c.action do |global_options,
|
58
|
+
c.action do |global_options, _options, args|
|
59
59
|
collaborations = Collaboration.find_or_call(args) do |id|
|
60
60
|
warn "Couldn't find collaboration #{id}"
|
61
61
|
end
|
@@ -7,7 +7,7 @@ module Brightbox
|
|
7
7
|
cmd.arg_name "[firewall-policy-id...]"
|
8
8
|
cmd.command [:list] do |c|
|
9
9
|
|
10
|
-
c.action do |global_options,
|
10
|
+
c.action do |global_options, _options, args|
|
11
11
|
firewall_policies = FirewallPolicy.find_all_or_warn(args)
|
12
12
|
render_table(firewall_policies, global_options)
|
13
13
|
end
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.arg_name "firewall-policy-id"
|
6
6
|
cmd.command [:show] do |c|
|
7
7
|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
raise "You must specify server groups to show" if args.empty?
|
10
10
|
|
11
11
|
policies = FirewallPolicy.find_or_call(args) do |id|
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.arg_name "[firewall-rule-id...]"
|
6
6
|
cmd.command [:destroy] do |c|
|
7
7
|
|
8
|
-
c.action do |
|
8
|
+
c.action do |_global_options, _options, args|
|
9
9
|
raise "You must specify firewall-rule-id to destroy" if args.empty?
|
10
10
|
|
11
11
|
firewall_rules = FirewallRule.find_or_call(args) do |id|
|
@@ -7,7 +7,7 @@ module Brightbox
|
|
7
7
|
cmd.arg_name "[firewall-policy-id...]"
|
8
8
|
cmd.command [:list] do |c|
|
9
9
|
|
10
|
-
c.action do |global_options,
|
10
|
+
c.action do |global_options, _options, args|
|
11
11
|
if args.empty?
|
12
12
|
raise "You must specify the firewall policy id as the first argument"
|
13
13
|
end
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.arg_name "firewall-rule-id"
|
6
6
|
cmd.command [:show] do |c|
|
7
7
|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
raise "You must specify server groups to show" if args.empty?
|
10
10
|
|
11
11
|
policies = FirewallRule.find_or_call(args) do |id|
|
@@ -6,7 +6,7 @@ module Brightbox
|
|
6
6
|
cmd.arg_name "grp-id [srv-id...]"
|
7
7
|
cmd.command [:add_servers] do |c|
|
8
8
|
|
9
|
-
c.action do |global_options,
|
9
|
+
c.action do |global_options, _options, args|
|
10
10
|
grp_id = args.shift
|
11
11
|
raise "You must specify the server group and then the server ids to add" unless grp_id && grp_id[/^grp-/] && !args.empty?
|
12
12
|
|
@@ -6,7 +6,7 @@ module Brightbox
|
|
6
6
|
# TODO: add option to remove all servers from group before destroying
|
7
7
|
cmd.command [:destroy] do |c|
|
8
8
|
|
9
|
-
c.action do |
|
9
|
+
c.action do |_global_options, _options, args|
|
10
10
|
raise "You must specify the server groups to destroy" if args.empty?
|
11
11
|
|
12
12
|
sgs = ServerGroup.find_or_call(args) do |id|
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
|
6
6
|
cmd.desc I18n.t("groups.list.desc")
|
7
7
|
cmd.command [:list] do |c|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
server_groups = ServerGroup.find_all_or_warn(args)
|
10
10
|
render_table(server_groups, global_options)
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Brightbox
|
|
5
5
|
cmd.arg_name "[grp-id..]"
|
6
6
|
cmd.command [:show] do |c|
|
7
7
|
|
8
|
-
c.action do |global_options,
|
8
|
+
c.action do |global_options, _options, args|
|
9
9
|
raise "You must specify server groups to show" if args.empty?
|
10
10
|
|
11
11
|
sgs = DetailedServerGroup.find_or_call(args) do |id|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Brightbox
|
2
|
+
command [:images] do |cmd|
|
3
|
+
cmd.desc I18n.t("images.lock.desc")
|
4
|
+
cmd.arg_name "[image-id...]"
|
5
|
+
cmd.command [:lock] do |c|
|
6
|
+
c.action do |_global_options, _options, args|
|
7
|
+
raise "You must specify image as arguments" if args.empty?
|
8
|
+
|
9
|
+
images = Image.find_or_call(args) do |image|
|
10
|
+
raise "Couldn't find #{image}"
|
11
|
+
end
|
12
|
+
|
13
|
+
images.each do |image|
|
14
|
+
info "Locking #{image}"
|
15
|
+
image.lock!
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
cmd.desc I18n.t("images.unlock.desc")
|
21
|
+
cmd.arg_name "[image-id...]"
|
22
|
+
cmd.command [:unlock] do |c|
|
23
|
+
c.action do |_global_options, _options, args|
|
24
|
+
raise "You must specify images as arguments" if args.empty?
|
25
|
+
|
26
|
+
images = Image.find_or_call(args) do |image|
|
27
|
+
raise "Couldn't find #{image}"
|
28
|
+
end
|
29
|
+
|
30
|
+
images.each do |image|
|
31
|
+
info "Unlocking #{image}"
|
32
|
+
image.unlock!
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -27,7 +27,7 @@ module Brightbox
|
|
27
27
|
c.default_value "false"
|
28
28
|
c.flag [:p, "public"]
|
29
29
|
|
30
|
-
c.action do |global_options, options,
|
30
|
+
c.action do |global_options, options, _args|
|
31
31
|
|
32
32
|
raise "You must specify the architecture" unless options[:a]
|
33
33
|
raise "You must specify the source filename" unless options[:s]
|