bbcloud 0.11.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/Gemfile +3 -0
- data/README +11 -1
- data/README.rdoc +11 -1
- data/Rakefile +12 -0
- data/bbcloud.gemspec +10 -10
- data/bin/brightbox-accounts +7 -2
- data/bin/brightbox-cloudips +7 -2
- data/bin/brightbox-config +7 -2
- data/bin/brightbox-images +7 -2
- data/bin/brightbox-lbs +7 -2
- data/bin/brightbox-servers +7 -2
- data/bin/brightbox-types +7 -2
- data/bin/brightbox-users +7 -2
- data/bin/brightbox-zones +7 -2
- data/lib/bbcloud.rb +43 -0
- data/lib/bbcloud/accounts.rb +5 -3
- data/lib/bbcloud/command_generator.rb +50 -0
- data/lib/bbcloud/commands/accounts-list.rb +13 -11
- data/lib/bbcloud/commands/accounts-reset-ftp-password.rb +26 -23
- data/lib/bbcloud/commands/accounts-show.rb +20 -16
- data/lib/bbcloud/commands/cloudips-create.rb +16 -14
- data/lib/bbcloud/commands/cloudips-destroy.rb +29 -26
- data/lib/bbcloud/commands/cloudips-list.rb +13 -11
- data/lib/bbcloud/commands/cloudips-map.rb +48 -46
- data/lib/bbcloud/commands/cloudips-show.rb +15 -12
- data/lib/bbcloud/commands/cloudips-unmap.rb +28 -25
- data/lib/bbcloud/commands/config-client-add.rb +33 -31
- data/lib/bbcloud/commands/config-client-default.rb +18 -16
- data/lib/bbcloud/commands/config-client-list.rb +19 -16
- data/lib/bbcloud/commands/config-client-remove.rb +18 -16
- data/lib/bbcloud/commands/images-destroy.rb +18 -16
- data/lib/bbcloud/commands/images-list.rb +20 -18
- data/lib/bbcloud/commands/images-register.rb +21 -19
- data/lib/bbcloud/commands/images-show.rb +17 -15
- data/lib/bbcloud/commands/lbs-add-nodes.rb +15 -13
- data/lib/bbcloud/commands/lbs-create.rb +65 -63
- data/lib/bbcloud/commands/lbs-destroy.rb +13 -11
- data/lib/bbcloud/commands/lbs-list.rb +13 -11
- data/lib/bbcloud/commands/lbs-remove-nodes.rb +15 -13
- data/lib/bbcloud/commands/lbs-show.rb +15 -13
- data/lib/bbcloud/commands/lbs-update.rb +59 -57
- data/lib/bbcloud/commands/servers-activate-cloud.rb +18 -16
- data/lib/bbcloud/commands/servers-create.rb +80 -77
- data/lib/bbcloud/commands/servers-destroy.rb +17 -15
- data/lib/bbcloud/commands/servers-list.rb +14 -14
- data/lib/bbcloud/commands/servers-show.rb +39 -37
- data/lib/bbcloud/commands/servers-shutdown.rb +14 -12
- data/lib/bbcloud/commands/servers-snapshot.rb +14 -12
- data/lib/bbcloud/commands/servers-start.rb +15 -13
- data/lib/bbcloud/commands/servers-stop.rb +14 -12
- data/lib/bbcloud/commands/types-list.rb +13 -11
- data/lib/bbcloud/commands/types-show.rb +18 -16
- data/lib/bbcloud/commands/users-list.rb +13 -11
- data/lib/bbcloud/commands/users-show.rb +17 -15
- data/lib/bbcloud/commands/users-update.rb +27 -25
- data/lib/bbcloud/commands/zones-list.rb +13 -11
- data/lib/bbcloud/config.rb +125 -111
- data/lib/bbcloud/error_parser.rb +34 -0
- data/lib/bbcloud/fog_extensions.rb +19 -0
- data/lib/bbcloud/gli_global_hooks.rb +56 -0
- data/lib/bbcloud/logging.rb +40 -0
- data/lib/bbcloud/ruby_core_ext.rb +9 -0
- data/lib/bbcloud/servers.rb +7 -2
- data/lib/bbcloud/tables.rb +78 -73
- data/lib/bbcloud/vendor/gli/.gitignore +10 -0
- data/lib/bbcloud/vendor/gli/.rvmrc +1 -0
- data/lib/bbcloud/vendor/gli/Gemfile +5 -0
- data/lib/bbcloud/vendor/gli/LICENSE.txt +201 -0
- data/lib/bbcloud/vendor/gli/README.rdoc +54 -0
- data/lib/bbcloud/vendor/gli/Rakefile +84 -0
- data/lib/bbcloud/vendor/gli/bin/gli +72 -0
- data/lib/bbcloud/vendor/gli/bin/report_on_rake_results +10 -0
- data/lib/bbcloud/vendor/gli/bin/test_all_rubies.sh +2 -0
- data/lib/bbcloud/vendor/gli/features/gli_executable.feature +88 -0
- data/lib/bbcloud/vendor/gli/features/gli_init.feature +122 -0
- data/lib/bbcloud/vendor/gli/features/step_definitions/gli_executable_steps.rb +12 -0
- data/lib/bbcloud/vendor/gli/features/step_definitions/gli_init_steps.rb +4 -0
- data/lib/bbcloud/vendor/gli/features/support/env.rb +21 -0
- data/lib/bbcloud/vendor/gli/gli.cheat +80 -0
- data/lib/bbcloud/vendor/gli/gli.gemspec +46 -0
- data/lib/bbcloud/vendor/gli/gli.rdoc +51 -0
- data/lib/bbcloud/vendor/gli/lib/gli.rb +560 -0
- data/lib/bbcloud/vendor/gli/lib/gli/command.rb +124 -0
- data/lib/bbcloud/vendor/gli/lib/gli/command_line_token.rb +58 -0
- data/lib/bbcloud/vendor/gli/lib/gli/copy_options_to_aliases.rb +33 -0
- data/lib/bbcloud/vendor/gli/lib/gli/exceptions.rb +45 -0
- data/lib/bbcloud/vendor/gli/lib/gli/flag.rb +67 -0
- data/lib/bbcloud/vendor/gli/lib/gli/options.rb +19 -0
- data/lib/bbcloud/vendor/gli/lib/gli/switch.rb +63 -0
- data/lib/bbcloud/vendor/gli/lib/gli/terminal.rb +79 -0
- data/lib/bbcloud/vendor/gli/lib/gli_version.rb +3 -0
- data/lib/bbcloud/vendor/gli/lib/support/help.rb +180 -0
- data/lib/bbcloud/vendor/gli/lib/support/initconfig.rb +34 -0
- data/lib/bbcloud/vendor/gli/lib/support/rdoc.rb +119 -0
- data/lib/bbcloud/vendor/gli/lib/support/scaffold.rb +284 -0
- data/lib/bbcloud/vendor/gli/test/config.yaml +9 -0
- data/lib/bbcloud/vendor/gli/test/gli.reek +116 -0
- data/lib/bbcloud/vendor/gli/test/roodi.yaml +9 -0
- data/lib/bbcloud/vendor/gli/test/tc_command.rb +329 -0
- data/lib/bbcloud/vendor/gli/test/tc_flag.rb +67 -0
- data/lib/bbcloud/vendor/gli/test/tc_gli.rb +429 -0
- data/lib/bbcloud/vendor/gli/test/tc_options.rb +31 -0
- data/lib/bbcloud/vendor/gli/test/tc_parsing.rb +279 -0
- data/lib/bbcloud/vendor/gli/test/tc_switch.rb +80 -0
- data/lib/bbcloud/vendor/gli/test/tc_terminal.rb +91 -0
- data/lib/bbcloud/version.rb +1 -1
- data/pkg/bbcloud-0.12.0.gem +0 -0
- data/spec/fixtures/vcr_cassettes/server_list.yml +117 -0
- data/spec/servers_spec.rb +36 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/support/common_helpers.rb +47 -0
- metadata +129 -135
- data/lib/bbcloud/cli.rb +0 -160
- data/lib/bbcloud/vendor/fog/lib/fog.rb +0 -14
- data/lib/bbcloud/vendor/fog/lib/fog/compute.rb +0 -43
- data/lib/bbcloud/vendor/fog/lib/fog/compute/brightbox.rb +0 -162
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/account.rb +0 -51
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/cloud_ip.rb +0 -47
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/cloud_ips.rb +0 -34
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/flavor.rb +0 -33
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/flavors.rb +0 -28
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/image.rb +0 -56
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/images.rb +0 -28
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancer.rb +0 -50
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancers.rb +0 -28
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/server.rb +0 -108
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/servers.rb +0 -29
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/user.rb +0 -39
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/users.rb +0 -29
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/zone.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/zones.rb +0 -29
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/activate_console_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_api_client.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_image.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_load_balancer.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_server.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_api_client.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_image.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_account.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_api_client.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_image.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_interface.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_server_type.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_user.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_zone.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_api_clients.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_images.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_load_balancers.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_server_types.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_servers.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_users.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_zones.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/resize_server.rb +0 -19
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/shutdown_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/snapshot_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/start_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/stop_server.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_account.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_api_client.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_image.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_load_balancer.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_server.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_user.rb +0 -21
- data/lib/bbcloud/vendor/fog/lib/fog/core.rb +0 -32
- data/lib/bbcloud/vendor/fog/lib/fog/core/attributes.rb +0 -178
- data/lib/bbcloud/vendor/fog/lib/fog/core/collection.rb +0 -127
- data/lib/bbcloud/vendor/fog/lib/fog/core/connection.rb +0 -35
- data/lib/bbcloud/vendor/fog/lib/fog/core/credentials.rb +0 -92
- data/lib/bbcloud/vendor/fog/lib/fog/core/deprecation.rb +0 -23
- data/lib/bbcloud/vendor/fog/lib/fog/core/errors.rb +0 -20
- data/lib/bbcloud/vendor/fog/lib/fog/core/hmac.rb +0 -48
- data/lib/bbcloud/vendor/fog/lib/fog/core/mock.rb +0 -68
- data/lib/bbcloud/vendor/fog/lib/fog/core/model.rb +0 -57
- data/lib/bbcloud/vendor/fog/lib/fog/core/parser.rb +0 -99
- data/lib/bbcloud/vendor/fog/lib/fog/core/provider.rb +0 -18
- data/lib/bbcloud/vendor/fog/lib/fog/core/scp.rb +0 -67
- data/lib/bbcloud/vendor/fog/lib/fog/core/service.rb +0 -175
- data/lib/bbcloud/vendor/fog/lib/fog/core/ssh.rb +0 -120
- data/lib/bbcloud/vendor/fog/lib/fog/core/time.rb +0 -27
- data/lib/bbcloud/vendor/fog/lib/fog/core/wait_for.rb +0 -17
- data/lib/bbcloud/vendor/fog/lib/fog/providers.rb +0 -9
- data/lib/bbcloud/vendor/fog/lib/fog/providers/brightbox.rb +0 -9
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/README
CHANGED
@@ -7,11 +7,21 @@ http://beta.brightbox.com
|
|
7
7
|
|
8
8
|
http://docs.brightbox.com/cli
|
9
9
|
|
10
|
+
== Dependencies
|
11
|
+
|
12
|
+
It has following dependencies and if you are trying to install the gem from
|
13
|
+
a gem file (rather than via gem command), you might have to install the
|
14
|
+
following:
|
15
|
+
|
16
|
+
* fog - 0.8.2
|
17
|
+
* json - 1.5.3
|
18
|
+
* hirb - 0.3.5
|
19
|
+
|
10
20
|
== Packaging
|
11
21
|
|
12
22
|
=== Vendoring libraries
|
13
23
|
|
14
|
-
gems can be vendored into
|
24
|
+
gems can be vendored into vendor/ for packaging and will be
|
15
25
|
prioritized over any gems.
|
16
26
|
|
17
27
|
=== Debian/Ubuntu packaging
|
data/README.rdoc
CHANGED
@@ -7,11 +7,21 @@ http://beta.brightbox.com
|
|
7
7
|
|
8
8
|
http://docs.brightbox.com/cli
|
9
9
|
|
10
|
+
== Dependencies
|
11
|
+
|
12
|
+
It has following dependencies and if you are trying to install the gem from
|
13
|
+
a gem file (rather than via gem command), you might have to install the
|
14
|
+
following:
|
15
|
+
|
16
|
+
* fog - 0.8.2
|
17
|
+
* json - 1.5.3
|
18
|
+
* hirb - 0.3.5
|
19
|
+
|
10
20
|
== Packaging
|
11
21
|
|
12
22
|
=== Vendoring libraries
|
13
23
|
|
14
|
-
gems can be vendored into
|
24
|
+
gems can be vendored into vendor/ for packaging and will be
|
15
25
|
prioritized over any gems.
|
16
26
|
|
17
27
|
=== Debian/Ubuntu packaging
|
data/Rakefile
CHANGED
@@ -1,2 +1,14 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
bbcloud_path = File.expand_path('./lib', File.dirname(__FILE__))
|
5
|
+
$:.unshift(bbcloud_path)
|
6
|
+
require "bbcloud/command_generator"
|
7
|
+
|
8
|
+
desc "generate brightbox-commands"
|
9
|
+
task :generate_commands do
|
10
|
+
Brightbox::CommandGenerator.new(bbcloud_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'rspec/core/rake_task'
|
14
|
+
RSpec::Core::RakeTask.new
|
data/bbcloud.gemspec
CHANGED
@@ -18,14 +18,14 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
s.add_dependency 'json', '~> 1.5.3'
|
22
|
+
s.add_dependency 'hirb', '0.3.5'
|
23
|
+
s.add_dependency 'formatador', '~> 0.1.4'
|
24
|
+
s.add_dependency 'excon', '~> 0.6.1'
|
25
|
+
s.add_dependency 'fog', '~> 0.8.0'
|
26
|
+
s.add_development_dependency('rake', '~> 0.8.0')
|
27
|
+
s.add_development_dependency('vcr')
|
28
|
+
s.add_development_dependency('rspec')
|
29
|
+
s.add_development_dependency('mocha')
|
31
30
|
end
|
31
|
+
|
data/bin/brightbox-accounts
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-cloudips
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-config
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-images
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-lbs
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-servers
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-types
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-users
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/bin/brightbox-zones
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require "bbcloud
|
4
|
+
require "bbcloud"
|
5
5
|
rescue LoadError
|
6
6
|
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
7
7
|
$:.unshift(bbcloud_path)
|
8
|
-
require "bbcloud
|
8
|
+
require "bbcloud"
|
9
|
+
end
|
10
|
+
|
11
|
+
Brightbox::BBConfig.config do
|
12
|
+
include GLI
|
13
|
+
run ARGV
|
9
14
|
end
|
data/lib/bbcloud.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
lib_dir = File.expand_path(File.dirname(__FILE__))
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include?(lib_dir)
|
4
|
+
|
5
|
+
os_config = File.join(lib_dir,"bbcloud","os_config.rb")
|
6
|
+
require os_config if File.exist? os_config
|
7
|
+
|
8
|
+
vendor_dir = File.expand_path(File.join(lib_dir, 'bbcloud','vendor'))
|
9
|
+
|
10
|
+
unless defined?(DISABLE_RUBYGEMS)
|
11
|
+
require "rubygems"
|
12
|
+
gem "json", "~> 1.5.3"
|
13
|
+
gem "fog", "~> 0.8.0"
|
14
|
+
end
|
15
|
+
|
16
|
+
# Add any vendored libraries into search path
|
17
|
+
Dir.glob(vendor_dir + '/*').each do |f|
|
18
|
+
$:.unshift File.join(f, 'lib')
|
19
|
+
end
|
20
|
+
|
21
|
+
require "json"
|
22
|
+
require 'date'
|
23
|
+
require 'gli'
|
24
|
+
require 'fog'
|
25
|
+
|
26
|
+
|
27
|
+
require 'bbcloud/tables'
|
28
|
+
require "bbcloud/fog_extensions"
|
29
|
+
require "bbcloud/logging"
|
30
|
+
require "bbcloud/api"
|
31
|
+
require "bbcloud/servers"
|
32
|
+
require "bbcloud/images"
|
33
|
+
require "bbcloud/types"
|
34
|
+
require "bbcloud/zones"
|
35
|
+
require "bbcloud/cloud_ips"
|
36
|
+
require "bbcloud/users"
|
37
|
+
require "bbcloud/accounts"
|
38
|
+
require "bbcloud/config"
|
39
|
+
require "bbcloud/version"
|
40
|
+
require "bbcloud/load_balancers"
|
41
|
+
require "bbcloud/ruby_core_ext"
|
42
|
+
require "bbcloud/error_parser"
|
43
|
+
|
data/lib/bbcloud/accounts.rb
CHANGED
@@ -5,10 +5,12 @@ module Brightbox
|
|
5
5
|
[ram_limit.to_i - ram_used.to_i, 0].max
|
6
6
|
end
|
7
7
|
|
8
|
+
def cloud_ip_limit
|
9
|
+
attributes['cloud_ips_limit']
|
10
|
+
end
|
11
|
+
|
8
12
|
def to_row
|
9
|
-
attributes.merge(
|
10
|
-
:cloud_ip_limit => limits_cloudips
|
11
|
-
})
|
13
|
+
attributes.merge(:ram_free => ram_free, :cloud_ip_limit => cloud_ip_limit)
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.all
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Brightbox
|
2
|
+
class CommandGenerator
|
3
|
+
COMMAND_LIST = [
|
4
|
+
'brightbox-accounts',
|
5
|
+
'brightbox-cloudips',
|
6
|
+
'brightbox-config',
|
7
|
+
'brightbox-images',
|
8
|
+
'brightbox-lbs',
|
9
|
+
'brightbox-servers',
|
10
|
+
'brightbox-types',
|
11
|
+
'brightbox-users',
|
12
|
+
'brightbox-zones'
|
13
|
+
]
|
14
|
+
|
15
|
+
def initialize(bbcloud_path)
|
16
|
+
@bbcloud_path = bbcloud_path
|
17
|
+
COMMAND_LIST.each do |command|
|
18
|
+
File.open("#{cli_binary_path}/#{command}","w+") do |fl|
|
19
|
+
fl.write(command_template)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def command_template
|
26
|
+
brightbox_command =<<-EOF
|
27
|
+
#!/usr/bin/env ruby
|
28
|
+
|
29
|
+
begin
|
30
|
+
require "bbcloud"
|
31
|
+
rescue LoadError
|
32
|
+
bbcloud_path = File.expand_path('../../lib', __FILE__)
|
33
|
+
$:.unshift(bbcloud_path)
|
34
|
+
require "bbcloud"
|
35
|
+
end
|
36
|
+
|
37
|
+
Brightbox::BBConfig.config do
|
38
|
+
include GLI
|
39
|
+
run ARGV
|
40
|
+
end
|
41
|
+
EOF
|
42
|
+
brightbox_command
|
43
|
+
end
|
44
|
+
|
45
|
+
def cli_binary_path
|
46
|
+
File.join(@bbcloud_path,"..","bin")
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Brightbox
|
2
|
+
desc 'List accounts'
|
3
|
+
arg_name '[account-id...]'
|
4
|
+
command [:list] do |c|
|
5
|
+
c.action do |global_options, options, args|
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if args.empty?
|
8
|
+
accounts = Account.find(:all)
|
9
|
+
else
|
10
|
+
accounts = Account.find_or_call(args) do |id|
|
11
|
+
warn "Couldn't find account #{id}"
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
+
render_table(accounts, global_options)
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,33 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Brightbox
|
2
|
+
desc 'Reset FTP Library password'
|
3
|
+
arg_name 'account-id...'
|
4
|
+
command [:reset_ftp_password] do |c|
|
4
5
|
|
5
|
-
|
6
|
+
c.action do |global_options,options,args|
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
if args.empty?
|
9
|
+
raise "You must specify the accounts to reset ftp passwords for"
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
accounts = Account.find_or_call(args) do |id|
|
13
|
+
raise "Couldn't find account #{id}"
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
+
rows = []
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
accounts.each do |s|
|
19
|
+
info "Resetting ftp password for #{s}"
|
20
|
+
new_password = s.reset_ftp_password
|
21
|
+
o = s.to_row
|
22
|
+
o[:library_ftp_password] = new_password
|
23
|
+
rows << o
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
table_opts = global_options.merge({
|
27
|
+
:vertical => true,
|
28
|
+
:fields => [:id, :name, :library_ftp_host, :library_ftp_user, :library_ftp_password ]
|
29
|
+
})
|
29
30
|
|
30
|
-
|
31
|
+
render_table(rows, table_opts)
|
31
32
|
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
36
|
+
|