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/lib/brightbox-cli/config.rb
CHANGED
@@ -50,7 +50,7 @@ module Brightbox
|
|
50
50
|
#
|
51
51
|
# @return [Boolean]
|
52
52
|
def config_directory_exists?
|
53
|
-
File.
|
53
|
+
File.exist?(config_directory) && File.directory?(config_directory)
|
54
54
|
end
|
55
55
|
|
56
56
|
# The String path to the configuration file itself (in .ini format)
|
@@ -126,7 +126,7 @@ module Brightbox
|
|
126
126
|
# in
|
127
127
|
#
|
128
128
|
def create_directory
|
129
|
-
unless File.
|
129
|
+
unless File.exist? config_directory
|
130
130
|
begin
|
131
131
|
FileUtils.mkdir config_directory
|
132
132
|
rescue Errno::EEXIST
|
@@ -46,7 +46,7 @@ module Brightbox
|
|
46
46
|
# These are all the fields show in the longer table form
|
47
47
|
def self.detailed_fields
|
48
48
|
[
|
49
|
-
:id, :name, :description, :status,
|
49
|
+
:id, :name, :description, :status, :locked,
|
50
50
|
:type, :engine, :version,
|
51
51
|
:zone,
|
52
52
|
:created_on,
|
@@ -71,6 +71,7 @@ module Brightbox
|
|
71
71
|
def to_row
|
72
72
|
a = fog_model.attributes
|
73
73
|
a[:status] = fog_model.state
|
74
|
+
a[:locked] = locked?
|
74
75
|
a[:type] = type_identifier
|
75
76
|
a[:db_engine] = engine_version
|
76
77
|
a[:engine] = database_engine
|
@@ -32,7 +32,7 @@ module Brightbox
|
|
32
32
|
desc "Disable peer SSL certificate verification"
|
33
33
|
switch [:k, :insecure], :negatable => false
|
34
34
|
|
35
|
-
pre do |global_options, command,
|
35
|
+
pre do |global_options, command, _options, _args|
|
36
36
|
if command.topmost_ancestor.name == :config
|
37
37
|
force_default_config = false
|
38
38
|
else
|
@@ -73,7 +73,7 @@ module Brightbox
|
|
73
73
|
true
|
74
74
|
end
|
75
75
|
|
76
|
-
post do |
|
76
|
+
post do |_global_options, _command, _options, _args|
|
77
77
|
begin
|
78
78
|
# Api.conn is another global which holds the authentication tokens so
|
79
79
|
# we need to shuffle data between globals at a higher level rather than
|
data/lib/brightbox-cli/images.rb
CHANGED
@@ -45,7 +45,7 @@ module Brightbox
|
|
45
45
|
end
|
46
46
|
|
47
47
|
snapshots = images.select { |i| i.source_type == 'snapshot' }
|
48
|
-
images
|
48
|
+
images -= snapshots
|
49
49
|
|
50
50
|
images.sort! { |a, b| a.default_sort_fields <=> b.default_sort_fields }
|
51
51
|
snapshots.sort! { |a, b| a.created_at <=> b.created_at }
|
@@ -78,6 +78,7 @@ module Brightbox
|
|
78
78
|
o = fog_model.attributes
|
79
79
|
o[:id] = fog_model.id
|
80
80
|
o[:status] = status
|
81
|
+
o[:locked] = locked?
|
81
82
|
o[:username] = username
|
82
83
|
o[:arch] = arch
|
83
84
|
o[:name] = name.to_s + " (#{arch})"
|
@@ -16,9 +16,9 @@ module Brightbox
|
|
16
16
|
@globals = []
|
17
17
|
|
18
18
|
parser = OptionParser.new do |opts|
|
19
|
-
opts.on("-v", "--version") { |
|
20
|
-
opts.on("-s", "--simple") { |
|
21
|
-
opts.on("-k", "--insecure") { |
|
19
|
+
opts.on("-v", "--version") { |_op| @globals << "-v" }
|
20
|
+
opts.on("-s", "--simple") { |_op| @globals << "-s" }
|
21
|
+
opts.on("-k", "--insecure") { |_op| @globals << "-k" }
|
22
22
|
opts.on("-c", "--client CLIENT") { |op| @globals << "-c" << op }
|
23
23
|
opts.on("--account ACCOUNT") { |op| @globals << "--account" << op }
|
24
24
|
end
|
@@ -3,7 +3,7 @@ module Brightbox
|
|
3
3
|
def self.require_account?; true; end
|
4
4
|
|
5
5
|
def self.create_servers(count, options)
|
6
|
-
(0...count).map { |
|
6
|
+
(0...count).map { |_i| create(options) }
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.create(options)
|
@@ -43,6 +43,7 @@ module Brightbox
|
|
43
43
|
a[:created_on] = created_on
|
44
44
|
a[:type] = server_type['handle']
|
45
45
|
a[:status] = fog_model.state
|
46
|
+
a[:locked] = locked?
|
46
47
|
a[:zone] = zone && zone['handle']
|
47
48
|
a[:hostname] = id
|
48
49
|
a[:public_hostname] = "public.#{fqdn}" unless cloud_ips.empty?
|
@@ -24,7 +24,7 @@ module Brightbox
|
|
24
24
|
#
|
25
25
|
def self.get_for_account(account_id)
|
26
26
|
collaborations = conn.user_collaborations
|
27
|
-
open_collaborations = collaborations.select { |col| %w
|
27
|
+
open_collaborations = collaborations.select { |col| %w(pending accepted).include?(col.status) }
|
28
28
|
collaboration = open_collaborations.find do |col|
|
29
29
|
col.account_id == account_id
|
30
30
|
end
|
data/lib/brightbox_cli.rb
CHANGED
@@ -10,14 +10,14 @@ lib_dir = File.expand_path(File.dirname(__FILE__))
|
|
10
10
|
|
11
11
|
$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include?(lib_dir)
|
12
12
|
|
13
|
-
os_config = File.join(lib_dir,"brightbox-cli","os_config.rb")
|
13
|
+
os_config = File.join(lib_dir, "brightbox-cli", "os_config.rb")
|
14
14
|
require os_config if File.exist? os_config
|
15
15
|
|
16
|
-
vendor_dir = File.expand_path(File.join(lib_dir, 'brightbox-cli','vendor'))
|
16
|
+
vendor_dir = File.expand_path(File.join(lib_dir, 'brightbox-cli', 'vendor'))
|
17
17
|
|
18
18
|
# Add any vendored libraries into search path
|
19
19
|
Dir.glob(vendor_dir + '/*').each do |f|
|
20
|
-
|
20
|
+
$LOAD_PATH.unshift File.join(f, 'lib')
|
21
21
|
end
|
22
22
|
|
23
23
|
require "multi_json"
|
data/locales/en.yml
CHANGED
@@ -104,10 +104,14 @@ en:
|
|
104
104
|
desc: Destroy images
|
105
105
|
list:
|
106
106
|
desc: List images
|
107
|
+
lock:
|
108
|
+
desc: Lock images
|
107
109
|
register:
|
108
110
|
desc: Register an image in the image library
|
109
111
|
show:
|
110
112
|
desc: Show images
|
113
|
+
unlock:
|
114
|
+
desc: Unlock images
|
111
115
|
update:
|
112
116
|
desc: Update an image
|
113
117
|
lbs:
|
@@ -121,10 +125,14 @@ en:
|
|
121
125
|
desc: Destroy load balancers
|
122
126
|
list:
|
123
127
|
desc: List load balancers
|
128
|
+
lock:
|
129
|
+
desc: Lock load balancers
|
124
130
|
remove_nodes:
|
125
131
|
desc: Remove servers from a load balancer
|
126
132
|
show:
|
127
133
|
desc: Show load balancers
|
134
|
+
unlock:
|
135
|
+
desc: Unlock load balancers
|
128
136
|
update:
|
129
137
|
desc: Update a load balancer
|
130
138
|
long_desc: All intervals and timeouts are in milliseconds
|
@@ -136,6 +144,12 @@ en:
|
|
136
144
|
desc: Create servers
|
137
145
|
destroy:
|
138
146
|
desc: Destroy servers
|
147
|
+
lock:
|
148
|
+
desc: Lock servers
|
149
|
+
reboot:
|
150
|
+
desc: Reboot servers (OS reboot issued)
|
151
|
+
reset:
|
152
|
+
desc: Reset servers (Hardward reset issued)
|
139
153
|
show:
|
140
154
|
desc: Show servers
|
141
155
|
shutdown:
|
@@ -146,6 +160,8 @@ en:
|
|
146
160
|
desc: Start servers
|
147
161
|
stop:
|
148
162
|
desc: Stop servers with equivalent of powering off
|
163
|
+
unlock:
|
164
|
+
desc: Unlock servers
|
149
165
|
update:
|
150
166
|
desc: Update a server
|
151
167
|
sql:
|
@@ -169,6 +185,8 @@ en:
|
|
169
185
|
desc: Create a new Cloud SQL instance
|
170
186
|
destroy:
|
171
187
|
desc: Destroy Cloud SQL instances
|
188
|
+
lock:
|
189
|
+
desc: Lock Cloud SQL instances
|
172
190
|
list:
|
173
191
|
desc: List Cloud SQL instances
|
174
192
|
reset_password:
|
@@ -177,16 +195,22 @@ en:
|
|
177
195
|
desc: Show details of Cloud SQL instances
|
178
196
|
snapshot:
|
179
197
|
desc: Create a new Cloud SQL snapshot from an instance
|
198
|
+
unlock:
|
199
|
+
desc: Unlock Cloud SQL instances
|
180
200
|
update:
|
181
201
|
desc: Update a Cloud SQL instance
|
182
202
|
snapshots:
|
183
203
|
desc: Manage Cloud SQL snapshots
|
184
204
|
list:
|
185
205
|
desc: List Cloud SQL snapshots
|
206
|
+
lock:
|
207
|
+
desc: Lock Cloud SQL snapshots
|
186
208
|
destroy:
|
187
209
|
desc: Destroy a number of Cloud SQL snapshots
|
188
210
|
show:
|
189
211
|
desc: Show details of Cloud SQL snapshots
|
212
|
+
unlock:
|
213
|
+
desc: Unlock Cloud SQL snapshots
|
190
214
|
update:
|
191
215
|
desc: Update a Cloud SQL snapshot's metadata
|
192
216
|
types:
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox accounts" do
|
4
4
|
|
5
5
|
describe "default" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(accounts default) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox accounts" do
|
4
4
|
|
5
5
|
describe "list" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "", :vcr do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(accounts list) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -18,7 +18,7 @@ describe "brightbox accounts" do
|
|
18
18
|
context "(when no tokens)", :vcr do
|
19
19
|
let(:password) { default_test_password }
|
20
20
|
|
21
|
-
let(:argv) {
|
21
|
+
let(:argv) { %w(accounts list) }
|
22
22
|
|
23
23
|
before do
|
24
24
|
config_from_contents(USER_APP_CONFIG_CONTENTS)
|
@@ -37,7 +37,7 @@ describe "brightbox accounts" do
|
|
37
37
|
context "(when no tokens and password incorrect)", :vcr do
|
38
38
|
let(:password) { "wrong" }
|
39
39
|
|
40
|
-
let(:argv) {
|
40
|
+
let(:argv) { %w(accounts list) }
|
41
41
|
|
42
42
|
before do
|
43
43
|
config_from_contents(USER_APP_CONFIG_CONTENTS)
|
@@ -56,7 +56,7 @@ describe "brightbox accounts" do
|
|
56
56
|
context "(when access token expired)", :vcr do
|
57
57
|
let(:password) { default_test_password }
|
58
58
|
|
59
|
-
let(:argv) {
|
59
|
+
let(:argv) { %w(accounts list) }
|
60
60
|
|
61
61
|
before do
|
62
62
|
config = config_from_contents(USER_APP_CONFIG_CONTENTS)
|
@@ -74,7 +74,7 @@ describe "brightbox accounts" do
|
|
74
74
|
context "(when both tokens expired)", :vcr do
|
75
75
|
let(:password) { default_test_password }
|
76
76
|
|
77
|
-
let(:argv) {
|
77
|
+
let(:argv) { %w(accounts list) }
|
78
78
|
|
79
79
|
before do
|
80
80
|
config = config_from_contents(USER_APP_CONFIG_CONTENTS)
|
@@ -93,7 +93,7 @@ describe "brightbox accounts" do
|
|
93
93
|
context "(when invalid tokens)", :vcr do
|
94
94
|
let(:password) { default_test_password }
|
95
95
|
|
96
|
-
let(:argv) {
|
96
|
+
let(:argv) { %w(accounts list) }
|
97
97
|
|
98
98
|
before do
|
99
99
|
config = config_from_contents(USER_APP_CONFIG_CONTENTS)
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox accounts" do
|
4
4
|
|
5
5
|
describe "reset_ftp_password" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(accounts reset_ftp_password) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox accounts" do
|
4
4
|
|
5
5
|
describe "show" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(accounts show) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "create" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips create) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "destroy" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips destroy) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "list" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips list) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "map" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
@@ -15,7 +15,7 @@ describe "brightbox cloudips" do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
context "when destination is a server ID", :vcr do
|
18
|
-
let(:argv) { %w
|
18
|
+
let(:argv) { %w(cloudips map cip-12345 srv-12345) }
|
19
19
|
let(:target) { "int-12345" }
|
20
20
|
|
21
21
|
it "passes the interface identifier to the API" do
|
@@ -26,7 +26,7 @@ describe "brightbox cloudips" do
|
|
26
26
|
|
27
27
|
context "when destination is another value", :vcr do
|
28
28
|
let(:target) { "res-12345" }
|
29
|
-
let(:argv) { %w
|
29
|
+
let(:argv) { %w(cloudips map cip-12345 res-12345) }
|
30
30
|
|
31
31
|
it "passes the identifier to the API" do
|
32
32
|
expect_any_instance_of(Brightbox::CloudIP).to receive(:map).with(target)
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "show" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips show) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "unmap" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips unmap) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox cloudips" do
|
4
4
|
|
5
5
|
describe "update" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(cloudips update) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox config" do
|
4
4
|
|
5
5
|
describe "client_add" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
@@ -14,7 +14,7 @@ describe "brightbox config" do
|
|
14
14
|
let(:default_account) { "acc-12345" }
|
15
15
|
|
16
16
|
context "" do
|
17
|
-
let(:argv) {
|
17
|
+
let(:argv) { %w(config client_add) }
|
18
18
|
|
19
19
|
it "does not error" do
|
20
20
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox config" do
|
4
4
|
|
5
5
|
describe "client_default" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(config client_default) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox config" do
|
4
4
|
|
5
5
|
describe "client_list" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(config client_list) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -3,12 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe "brightbox config" do
|
4
4
|
|
5
5
|
describe "client_remove" do
|
6
|
-
let(:output) { FauxIO.new { Brightbox
|
6
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
10
|
context "" do
|
11
|
-
let(:argv) {
|
11
|
+
let(:argv) { %w(config client_remove) }
|
12
12
|
|
13
13
|
it "does not error" do
|
14
14
|
expect { output }.to_not raise_error
|
@@ -7,7 +7,7 @@ require "spec_helper"
|
|
7
7
|
describe "brightbox config" do
|
8
8
|
|
9
9
|
describe "user_add" do
|
10
|
-
let(:output) { FauxIO.new { Brightbox
|
10
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
11
11
|
let(:stdout) { output.stdout }
|
12
12
|
let(:stderr) { output.stderr }
|
13
13
|
|
@@ -21,7 +21,7 @@ describe "brightbox config" do
|
|
21
21
|
let(:client_alias) { email }
|
22
22
|
|
23
23
|
context "" do
|
24
|
-
let(:argv) {
|
24
|
+
let(:argv) { %w(config user_add) }
|
25
25
|
|
26
26
|
it "does not error" do
|
27
27
|
expect { output }.to_not raise_error
|
@@ -34,7 +34,7 @@ describe "brightbox config" do
|
|
34
34
|
before do
|
35
35
|
config_file = File.join(ENV["HOME"], ".brightbox", "config")
|
36
36
|
FileUtils.rm_rf(config_file)
|
37
|
-
expect(File.
|
37
|
+
expect(File.exist?(config_file)).to be false
|
38
38
|
mock_password_entry(password)
|
39
39
|
end
|
40
40
|
|
@@ -92,7 +92,6 @@ describe "brightbox config" do
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
95
|
context "when new client is first and only client", :vcr do
|
97
96
|
let(:argv) { ["config", "user_add", email, client_id, secret] }
|
98
97
|
|
@@ -207,7 +206,6 @@ describe "brightbox config" do
|
|
207
206
|
mock_password_entry(password)
|
208
207
|
end
|
209
208
|
|
210
|
-
|
211
209
|
it "does not error" do
|
212
210
|
expect { output }.to_not raise_error
|
213
211
|
expect(stderr).to_not include("ERROR")
|
@@ -261,7 +259,6 @@ describe "brightbox config" do
|
|
261
259
|
end
|
262
260
|
end
|
263
261
|
|
264
|
-
|
265
262
|
context "when application has access only one active account", :vcr do
|
266
263
|
# Hardcoded in response, different from single account value
|
267
264
|
let(:default_account) { "acc-33333" }
|
@@ -2,16 +2,16 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe "Firewall policies" do
|
4
4
|
before do
|
5
|
-
|
5
|
+
skip "Spec is grabbing global state (from config) and breaking other specs"
|
6
6
|
end
|
7
7
|
|
8
8
|
describe "update" do
|
9
|
-
let(:output) { FauxIO.new { Brightbox
|
9
|
+
let(:output) { FauxIO.new { Brightbox.run(argv) } }
|
10
10
|
let(:stdout) { output.stdout }
|
11
11
|
let(:stderr) { output.stderr }
|
12
12
|
|
13
13
|
context "when no identifier is given", :vcr do
|
14
|
-
let(:argv) {
|
14
|
+
let(:argv) { %w(firewall-policies update) }
|
15
15
|
|
16
16
|
it "prints error to STDERR" do
|
17
17
|
expect(stderr).to include("ERROR: You must specify the firewall-policy-id to update")
|
@@ -19,7 +19,7 @@ describe "Firewall policies" do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
context "when the policy does not exist", :vcr do
|
22
|
-
let(:argv) {
|
22
|
+
let(:argv) { %w(firewall-policies update -n missing fwp-12345) }
|
23
23
|
|
24
24
|
it "prints error to STDERR" do
|
25
25
|
expect(stderr).to include("ERROR: Resource not found using supplied identifier")
|
@@ -32,7 +32,7 @@ describe "Firewall policies" do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
after do
|
35
|
-
#FIXME All specs are pending, why is this trying to run against nil?
|
35
|
+
# FIXME: All specs are pending, why is this trying to run against nil?
|
36
36
|
@policy.destroy if @policy
|
37
37
|
end
|
38
38
|
|
@@ -45,7 +45,7 @@ describe "Firewall policies" do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "has updated the resource" do
|
48
|
-
|
48
|
+
skip "Fails out of sequence"
|
49
49
|
expect { output }.to_not raise_error
|
50
50
|
@updated_policy = Brightbox::FirewallPolicy.find(@policy.id)
|
51
51
|
expect(@updated_policy.attributes[:name]).to eql(name)
|
@@ -61,7 +61,7 @@ describe "Firewall policies" do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it "has updated the resource" do
|
64
|
-
|
64
|
+
skip "Fails out of sequence"
|
65
65
|
expect { output }.to_not raise_error
|
66
66
|
@updated_policy = Brightbox::FirewallPolicy.find(@policy.id)
|
67
67
|
expect(@updated_policy.attributes[:description]).to eql(description)
|