af 0.3.18.12 → 0.3.19.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/cli/commands/apps.rb +33 -25
- data/lib/cli/commands/base.rb +1 -1
- data/lib/cli/commands/misc.rb +10 -3
- data/lib/cli/commands/services.rb +6 -6
- data/lib/cli/commands/user.rb +23 -19
- data/lib/cli/config.rb +6 -0
- data/lib/cli/frameworks.rb +3 -3
- data/lib/cli/runner.rb +60 -17
- data/lib/cli/version.rb +1 -1
- data/lib/vmc/client.rb +11 -11
- metadata +180 -155
data/README.md
CHANGED
@@ -58,6 +58,7 @@ MIT license, please see the LICENSE file. All rights reserved._
|
|
58
58
|
map <appname> <url> Register the application to the url
|
59
59
|
unmap <appname> <url> Unregister the application from the url
|
60
60
|
instances <appname> <num|delta> Scale the application instances up or down
|
61
|
+
rename <curname> <newname> Change the application's name
|
61
62
|
|
62
63
|
Application Information
|
63
64
|
crashes <appname> List recent application crashes
|
data/lib/cli/commands/apps.rb
CHANGED
@@ -23,7 +23,7 @@ module VMC::Cli::Command
|
|
23
23
|
|
24
24
|
display "\n"
|
25
25
|
return display "No Applications" if apps.nil? || apps.empty?
|
26
|
-
|
26
|
+
|
27
27
|
infra_supported = !apps.detect { |a| a[:infra] }.nil?
|
28
28
|
|
29
29
|
apps_table = table do |t|
|
@@ -34,7 +34,7 @@ module VMC::Cli::Command
|
|
34
34
|
if infra_supported
|
35
35
|
a << ( app[:infra] ? app[:infra][:provider] : " " )
|
36
36
|
end
|
37
|
-
t << a
|
37
|
+
t << a
|
38
38
|
end
|
39
39
|
end
|
40
40
|
display apps_table
|
@@ -58,7 +58,7 @@ module VMC::Cli::Command
|
|
58
58
|
def console(appname, interactive=true)
|
59
59
|
|
60
60
|
app = client.app_info(appname)
|
61
|
-
infra_name = app[:infra] ? app[:infra][:name] : 'aws' # FIXME
|
61
|
+
infra_name = app[:infra] ? app[:infra][:name] : 'aws' # FIXME
|
62
62
|
|
63
63
|
unless defined? Caldecott
|
64
64
|
display "To use `vmc rails-console', you must first install Caldecott:"
|
@@ -213,28 +213,28 @@ module VMC::Cli::Command
|
|
213
213
|
def download(appname, path=nil)
|
214
214
|
path = File.expand_path(path || "#{appname}.zip" )
|
215
215
|
banner = "Downloading last pushed source code to #{path}: "
|
216
|
-
display banner, false
|
216
|
+
display banner, false
|
217
217
|
client.app_download(appname, path)
|
218
218
|
display 'OK'.green
|
219
219
|
end
|
220
|
-
|
220
|
+
|
221
221
|
def pull(appname, path=nil)
|
222
222
|
path = File.expand_path(path || appname)
|
223
223
|
banner = "Pulling last pushed source code: "
|
224
|
-
display banner, false
|
224
|
+
display banner, false
|
225
225
|
client.app_pull(appname, path)
|
226
226
|
display 'OK'.green
|
227
227
|
end
|
228
|
-
|
228
|
+
|
229
229
|
def clone(src_appname, dest_appname, dest_infra=nil)
|
230
|
-
|
230
|
+
|
231
231
|
# FIXME need to ask for dest_appname if nil
|
232
|
-
|
232
|
+
|
233
233
|
err "Application '#{dest_appname}' already exists" if app_exists?(dest_appname)
|
234
234
|
|
235
235
|
app = client.app_info(src_appname)
|
236
236
|
|
237
|
-
if client.infra_supported?
|
237
|
+
if client.infra_supported?
|
238
238
|
dest_infra = @options[:infra] || client.infra_name_for_description(
|
239
239
|
ask("Select Infrastructure",:indexed => true, :choices => client.infra_descriptions))
|
240
240
|
client.infra = dest_infra
|
@@ -251,7 +251,7 @@ module VMC::Cli::Command
|
|
251
251
|
pull(src_appname,zip_path)
|
252
252
|
|
253
253
|
display "Cloning '#{src_appname}' to '#{dest_appname}': "
|
254
|
-
|
254
|
+
|
255
255
|
manifest = {
|
256
256
|
:name => "#{dest_appname}",
|
257
257
|
:staging => app[:staging],
|
@@ -261,9 +261,9 @@ module VMC::Cli::Command
|
|
261
261
|
}
|
262
262
|
manifest[:staging][:command] = app[:staging][:command] if app[:staging][:command]
|
263
263
|
manifest[:infra] = { :provider => dest_infra } if dest_infra
|
264
|
-
|
265
|
-
client.create_app(dest_appname, manifest)
|
266
|
-
|
264
|
+
|
265
|
+
client.create_app(dest_appname, manifest)
|
266
|
+
|
267
267
|
# Stage and upload the app bits.
|
268
268
|
upload_app_bits(dest_appname, zip_path, dest_infra)
|
269
269
|
|
@@ -289,15 +289,15 @@ module VMC::Cli::Command
|
|
289
289
|
display 'OK'.green
|
290
290
|
else
|
291
291
|
err "Import data into '#{service}' failed"
|
292
|
-
end
|
292
|
+
end
|
293
293
|
end
|
294
|
-
|
294
|
+
|
295
295
|
no_start = @options[:nostart]
|
296
|
-
start(dest_appname, true) unless no_start
|
297
|
-
|
296
|
+
start(dest_appname, true) unless no_start
|
297
|
+
|
298
298
|
end
|
299
299
|
end
|
300
|
-
|
300
|
+
|
301
301
|
def logs(appname)
|
302
302
|
# Check if we have an app before progressing further
|
303
303
|
client.app_info(appname)
|
@@ -524,7 +524,7 @@ module VMC::Cli::Command
|
|
524
524
|
check_unreachable_links(path,afi.included_files(files))
|
525
525
|
|
526
526
|
copy_files( path, ignore_sockets( afi.included_files(files)), explode_dir )
|
527
|
-
|
527
|
+
|
528
528
|
end
|
529
529
|
end
|
530
530
|
end
|
@@ -735,9 +735,17 @@ module VMC::Cli::Command
|
|
735
735
|
health = format("%.3f", healthy_instances.to_f / expected_instance).to_f
|
736
736
|
end
|
737
737
|
|
738
|
-
|
739
|
-
|
740
|
-
|
738
|
+
if health
|
739
|
+
if health == 1.0
|
740
|
+
return "RUNNING"
|
741
|
+
else
|
742
|
+
return "#{(health * 100).round}%"
|
743
|
+
end
|
744
|
+
elsif d[:state] == "STARTED"
|
745
|
+
return 'N/A' # unstarted instances
|
746
|
+
else
|
747
|
+
return d[:state]
|
748
|
+
end
|
741
749
|
end
|
742
750
|
|
743
751
|
def app_started_properly(appname, error_on_health)
|
@@ -1111,12 +1119,12 @@ module VMC::Cli::Command
|
|
1111
1119
|
}
|
1112
1120
|
manifest[:staging][:command] = command if command
|
1113
1121
|
manifest[:infra] = { :provider => infra } if infra
|
1114
|
-
|
1122
|
+
|
1115
1123
|
# Send the manifest to the cloud controller
|
1116
1124
|
client.create_app(appname, manifest)
|
1117
1125
|
display 'OK'.green
|
1118
1126
|
|
1119
|
-
|
1127
|
+
|
1120
1128
|
existing = Set.new(client.services.collect { |s| s[:name] })
|
1121
1129
|
|
1122
1130
|
if @app_info && services = @app_info["services"]
|
data/lib/cli/commands/base.rb
CHANGED
data/lib/cli/commands/misc.rb
CHANGED
@@ -83,9 +83,16 @@ module VMC::Cli::Command
|
|
83
83
|
def infras
|
84
84
|
infras_info = client.infras
|
85
85
|
return display "Multiple infras not supported" if infras_info.empty?
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
if infras_info.detect {|i| i.has_key?(:available) && i[:available] == false } # If one or more infras is unavailable
|
87
|
+
itable = table do |t|
|
88
|
+
t.headings = [ 'Name','Description','Message' ]
|
89
|
+
infras_info.each { |i| t << [i[:infra], i[:description], i[:available] ? '' : 'Unavailable - ' + i[:unavail_message]] }
|
90
|
+
end
|
91
|
+
else # All infras are available
|
92
|
+
itable = table do |t|
|
93
|
+
t.headings = [ 'Name','Description' ]
|
94
|
+
infras_info.each { |i| t << [i[:infra], i[:description]] }
|
95
|
+
end
|
89
96
|
end
|
90
97
|
display "\n"
|
91
98
|
display itable
|
@@ -47,7 +47,7 @@ module VMC::Cli::Command
|
|
47
47
|
:indexed => true, :choices => client.infra_descriptions))
|
48
48
|
end
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
create_service_banner(service, name, picked_name, @options[:infra])
|
52
52
|
appname = @options[:bind] unless appname
|
53
53
|
bind_service_banner(name, appname) if appname
|
@@ -93,9 +93,9 @@ module VMC::Cli::Command
|
|
93
93
|
services.each { |service| bind_service_banner(service, dest_app, false) }
|
94
94
|
check_app_for_restart(dest_app)
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
def export_service(service)
|
98
|
-
display "Exporting data from '#{service}': ", false
|
98
|
+
display "Exporting data from '#{service}': ", false
|
99
99
|
export_info = client.export_service(service)
|
100
100
|
if export_info
|
101
101
|
display 'OK'.green
|
@@ -104,7 +104,7 @@ module VMC::Cli::Command
|
|
104
104
|
err "Export data from '#{service}': failed"
|
105
105
|
end
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
108
|
def import_service(service,url)
|
109
109
|
display "Importing data into '#{service}': ", false
|
110
110
|
import_info = client.import_service(service,url)
|
@@ -114,7 +114,7 @@ module VMC::Cli::Command
|
|
114
114
|
err "Import data into '#{service}' failed"
|
115
115
|
end
|
116
116
|
end
|
117
|
-
|
117
|
+
|
118
118
|
def tunnel(service=nil, client_name=nil)
|
119
119
|
unless defined? Caldecott
|
120
120
|
display "To use `af tunnel', you must first install Caldecott:"
|
@@ -154,7 +154,7 @@ module VMC::Cli::Command
|
|
154
154
|
infra_name = info[:infra] ? info[:infra][:name] : default_infra
|
155
155
|
err "Infra '#{infra_name}' is not valid" unless client.infra_valid?(infra_name)
|
156
156
|
end
|
157
|
-
|
157
|
+
|
158
158
|
if not tunnel_pushed?(infra_name)
|
159
159
|
display "Deploying tunnel application '#{tunnel_appname(infra_name)}'."
|
160
160
|
auth = UUIDTools::UUID.random_create.to_s
|
data/lib/cli/commands/user.rb
CHANGED
@@ -2,6 +2,9 @@ module VMC::Cli::Command
|
|
2
2
|
|
3
3
|
class User < Base
|
4
4
|
|
5
|
+
# Errors
|
6
|
+
class InvalidLogin < VMC::Client::TargetError; end
|
7
|
+
|
5
8
|
def info
|
6
9
|
info = client_info
|
7
10
|
username = info[:user] || 'N/A'
|
@@ -10,27 +13,28 @@ module VMC::Cli::Command
|
|
10
13
|
end
|
11
14
|
|
12
15
|
def login(email=nil)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
display "Attempting login to [#{target_url}]" if target_url
|
17
|
+
begin
|
18
|
+
email = @options[:email] unless email
|
19
|
+
password = @options[:password]
|
20
|
+
tries ||= 0
|
16
21
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
+
unless no_prompt
|
23
|
+
email ||= ask("Email")
|
24
|
+
password ||= ask("Password", :echo => "*")
|
25
|
+
end
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
err "Need a valid email" unless email
|
28
|
+
err "Need a password" unless password
|
29
|
+
login_and_save_token(email, password)
|
30
|
+
say "Successfully logged into [#{target_url}]".green
|
31
|
+
rescue VMC::Client::TargetError
|
32
|
+
if (tries += 1) < 3 && prompt_ok && !@options[:password]
|
33
|
+
display "Problem with login, invalid account or password when attempting to login to '#{target_url}'".red
|
34
|
+
retry
|
35
|
+
end
|
36
|
+
raise InvalidLogin, "Problem with login, invalid account or password when attempting to login to '#{target_url}'"
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
def logout
|
data/lib/cli/config.rb
CHANGED
@@ -15,6 +15,7 @@ module VMC::Cli
|
|
15
15
|
ALIASES_FILE = '~/.af_aliases'
|
16
16
|
CLIENTS_FILE = '~/.af_clients'
|
17
17
|
MICRO_FILE = '~/.af_micro'
|
18
|
+
CRASH_FILE = '~/.af_crash'
|
18
19
|
|
19
20
|
STOCK_CLIENTS = File.expand_path("../../../config/clients.yml", __FILE__)
|
20
21
|
|
@@ -47,6 +48,11 @@ module VMC::Cli
|
|
47
48
|
lock_and_write(target_file, target_host)
|
48
49
|
end
|
49
50
|
|
51
|
+
def store_crash(log)
|
52
|
+
crash_file = File.expand_path(CRASH_FILE)
|
53
|
+
lock_and_write(crash_file, log)
|
54
|
+
end
|
55
|
+
|
50
56
|
def all_tokens(token_file_path=nil)
|
51
57
|
token_file = File.expand_path(token_file_path || TOKEN_FILE)
|
52
58
|
return nil unless File.exists? token_file
|
data/lib/cli/frameworks.rb
CHANGED
@@ -18,7 +18,7 @@ module VMC::Cli
|
|
18
18
|
'Erlang/OTP Rebar' => ['otp_rebar', { :mem => '64M', :description => 'Erlang/OTP Rebar Application'}],
|
19
19
|
'WSGI' => ['wsgi', { :mem => '64M', :description => 'Python WSGI Application'}],
|
20
20
|
'Django' => ['django', { :mem => '128M', :description => 'Python Django Application'}],
|
21
|
-
'
|
21
|
+
'aspdotnet' => ['aspdotnet', { :mem => '128M', :description => 'ASP.NET Application'}],
|
22
22
|
'Rack' => ['rack', { :mem => '128M', :description => 'Rack Application'}],
|
23
23
|
'Play' => ['play', { :mem => '256M', :description => 'Play Framework Application'}]
|
24
24
|
}
|
@@ -114,8 +114,8 @@ module VMC::Cli
|
|
114
114
|
return Framework.lookup('WSGI')
|
115
115
|
|
116
116
|
# .Net
|
117
|
-
elsif !Dir.glob('web.config').empty?
|
118
|
-
return Framework.lookup('
|
117
|
+
elsif !Dir.glob('web.config', File::FNM_CASEFOLD).empty?
|
118
|
+
return Framework.lookup('aspdotnet')
|
119
119
|
|
120
120
|
# Node.js
|
121
121
|
elsif !Dir.glob('*.js').empty?
|
data/lib/cli/runner.rb
CHANGED
@@ -48,6 +48,7 @@ class VMC::Cli::Runner
|
|
48
48
|
# generic tracing and debugging
|
49
49
|
opts.on('-t [TKEY]') { |tkey| @options[:trace] = tkey || true }
|
50
50
|
opts.on('--trace [TKEY]') { |tkey| @options[:trace] = tkey || true }
|
51
|
+
opts.on('--crash') { @options[:crash] = true }
|
51
52
|
|
52
53
|
# start application in debug mode
|
53
54
|
opts.on('-d [MODE]') { |mode| @options[:debug] = mode || "run" }
|
@@ -98,7 +99,7 @@ class VMC::Cli::Runner
|
|
98
99
|
|
99
100
|
# Proxying for another user, requires admin privileges
|
100
101
|
opts.on('-u PROXY') { |proxy| @options[:proxy] = proxy }
|
101
|
-
|
102
|
+
|
102
103
|
# Select infrastructure
|
103
104
|
opts.on('--infra INFRA') { |infra| @options[:infra] = infra }
|
104
105
|
|
@@ -285,7 +286,7 @@ class VMC::Cli::Runner
|
|
285
286
|
else
|
286
287
|
set_cmd(:apps, :files, 2)
|
287
288
|
end
|
288
|
-
|
289
|
+
|
289
290
|
when 'download'
|
290
291
|
usage('af download <appname> [path]')
|
291
292
|
if @args.size == 1
|
@@ -293,7 +294,7 @@ class VMC::Cli::Runner
|
|
293
294
|
else
|
294
295
|
set_cmd(:apps, :download, 2)
|
295
296
|
end
|
296
|
-
|
297
|
+
|
297
298
|
when 'pull'
|
298
299
|
usage('af pull <appname> [path]')
|
299
300
|
if @args.size == 1
|
@@ -389,16 +390,16 @@ class VMC::Cli::Runner
|
|
389
390
|
when 'export-service'
|
390
391
|
usage('af export-service <service-name>')
|
391
392
|
set_cmd(:services, :export_service, 1)
|
392
|
-
|
393
|
+
|
393
394
|
when 'import-service'
|
394
395
|
usage('af import-service <service-name> <url>')
|
395
396
|
set_cmd(:services, :import_service, 2)
|
396
|
-
|
397
|
+
|
397
398
|
when 'clone'
|
398
399
|
usage('af clone <src-app> <dest-app> [<infra>]')
|
399
400
|
set_cmd(:apps, :clone, 2) if @args.size == 2
|
400
401
|
set_cmd(:apps, :clone, 3) if @args.size == 3
|
401
|
-
|
402
|
+
|
402
403
|
when 'aliases'
|
403
404
|
usage('af aliases')
|
404
405
|
set_cmd(:misc, :aliases)
|
@@ -484,7 +485,45 @@ class VMC::Cli::Runner
|
|
484
485
|
@usage_error
|
485
486
|
end
|
486
487
|
|
488
|
+
def crash_log(e, message = nil)
|
489
|
+
@finish_time = Time.now
|
490
|
+
diff = @finish_time - @start_time
|
491
|
+
|
492
|
+
if message != nil
|
493
|
+
message = "#{message} (#{e.message})"
|
494
|
+
else
|
495
|
+
message = e.message
|
496
|
+
end
|
497
|
+
|
498
|
+
say message.red
|
499
|
+
|
500
|
+
@options[:password] = "".rjust(@options[:password].length, '*') if @options[:password]
|
501
|
+
|
502
|
+
log = ""
|
503
|
+
log += "Action: #{@action}\n"
|
504
|
+
log += "Arguments: #{@args.join(' ')}\n" if "#{@action}" != 'environment_add'
|
505
|
+
log += "Options: #{@options.to_json}\n"
|
506
|
+
log += "Execution Time: %.2fs\n" % diff
|
507
|
+
log += "Target: #{VMC::Cli::Config.target_url}\n"
|
508
|
+
log += "Client: v#{VMC::Cli::VERSION}\n"
|
509
|
+
log += "Platform: #{RUBY_PLATFORM} - Ruby:#{RUBY_VERSION}-#{RUBY_PATCHLEVEL}\n"
|
510
|
+
log += "Type: #{e.class}\n"
|
511
|
+
log += "Message: #{e.message}\n"
|
512
|
+
log += "Stack Trace:\n"
|
513
|
+
e.backtrace.each do |trace|
|
514
|
+
log += " #{trace}\n"
|
515
|
+
end
|
516
|
+
|
517
|
+
if @options[:crash] == true
|
518
|
+
say "--- #{File.expand_path(VMC::Cli::Config::CRASH_FILE)} ---"
|
519
|
+
say log
|
520
|
+
end
|
521
|
+
|
522
|
+
VMC::Cli::Config.store_crash(log)
|
523
|
+
end
|
524
|
+
|
487
525
|
def run
|
526
|
+
@start_time = Time.now
|
488
527
|
|
489
528
|
trap('TERM') { print "\nTerminated\n"; exit(false)}
|
490
529
|
|
@@ -512,15 +551,21 @@ class VMC::Cli::Runner
|
|
512
551
|
end
|
513
552
|
|
514
553
|
rescue OptionParser::InvalidOption => e
|
515
|
-
|
554
|
+
crash_log(e)
|
516
555
|
puts("\n")
|
517
556
|
puts(basic_usage)
|
518
557
|
@exit_status = false
|
519
558
|
rescue OptionParser::AmbiguousOption => e
|
520
|
-
|
559
|
+
crash_log(e)
|
521
560
|
puts("\n")
|
522
561
|
puts(basic_usage)
|
523
562
|
@exit_status = false
|
563
|
+
rescue VMC::Cli::Command::User::InvalidLogin => e
|
564
|
+
crash_log(e)
|
565
|
+
@exit_status = false
|
566
|
+
rescue VMC::Client::BadTarget => e
|
567
|
+
crash_log(e, "Problem with login to '#{VMC::Cli::Config.target_url}', try again or register for an account.")
|
568
|
+
@exit_status = false
|
524
569
|
rescue VMC::Client::AuthError => e
|
525
570
|
if VMC::Cli::Config.auth_token.nil?
|
526
571
|
puts "Login Required".red
|
@@ -529,31 +574,29 @@ class VMC::Cli::Runner
|
|
529
574
|
end
|
530
575
|
@exit_status = false
|
531
576
|
rescue VMC::Client::TargetError, VMC::Client::NotFound, VMC::Client::BadTarget => e
|
532
|
-
|
577
|
+
crash_log(e)
|
533
578
|
@exit_status = false
|
534
579
|
rescue VMC::Client::HTTPException => e
|
535
|
-
|
580
|
+
crash_log(e, "There was a problem connecting to the target. Please try again in a few moments.")
|
536
581
|
@exit_status = false
|
537
582
|
rescue VMC::Cli::GracefulExit => e
|
538
583
|
# Redirected commands end up generating this exception (kind of goto)
|
539
584
|
rescue VMC::Cli::CliExit => e
|
540
|
-
|
585
|
+
crash_log(e)
|
541
586
|
@exit_status = false
|
542
587
|
rescue VMC::Cli::CliError => e
|
543
|
-
|
588
|
+
crash_log(e, "Error #{e.error_code}: #{e.message}")
|
544
589
|
@exit_status = false
|
545
590
|
rescue SystemExit => e
|
546
591
|
@exit_status = e.success?
|
547
592
|
rescue SyntaxError => e
|
548
|
-
|
549
|
-
puts e.backtrace
|
593
|
+
crash_log(e)
|
550
594
|
@exit_status = false
|
551
595
|
rescue Interrupt => e
|
552
|
-
|
596
|
+
crash_log(e, "Interrupted")
|
553
597
|
@exit_status = false
|
554
598
|
rescue Exception => e
|
555
|
-
|
556
|
-
puts e.backtrace
|
599
|
+
crash_log(e)
|
557
600
|
@exit_status = false
|
558
601
|
ensure
|
559
602
|
say("\n")
|
data/lib/cli/version.rb
CHANGED
data/lib/vmc/client.rb
CHANGED
@@ -28,7 +28,7 @@ class VMC::Client
|
|
28
28
|
VMC_HTTP_ERROR_CODES = [ 400, 500 ]
|
29
29
|
|
30
30
|
HTTP_TIMEOUT = ENV['TIMEOUT'] ? ENV['TIMEOUT'].to_i : 10*60
|
31
|
-
|
31
|
+
|
32
32
|
# Errors
|
33
33
|
class BadTarget < RuntimeError; end
|
34
34
|
class AuthError < RuntimeError; end
|
@@ -158,7 +158,7 @@ class VMC::Client
|
|
158
158
|
_, body, headers = http_get(url)
|
159
159
|
body
|
160
160
|
end
|
161
|
-
|
161
|
+
|
162
162
|
def app_download(name,path)
|
163
163
|
check_login_status
|
164
164
|
url = path(VMC::APPS_PATH, name, "application")
|
@@ -167,7 +167,7 @@ class VMC::Client
|
|
167
167
|
file.write(body)
|
168
168
|
file.close
|
169
169
|
end
|
170
|
-
|
170
|
+
|
171
171
|
def app_pull(name, dir)
|
172
172
|
check_login_status
|
173
173
|
url = path(VMC::APPS_PATH, name, "application")
|
@@ -247,11 +247,11 @@ class VMC::Client
|
|
247
247
|
app[:services] = services
|
248
248
|
update_app(appname, app)
|
249
249
|
end
|
250
|
-
|
250
|
+
|
251
251
|
def export_service(service)
|
252
252
|
json_get(path(VMC::SERVICE_EXPORT_PATH, service))
|
253
253
|
end
|
254
|
-
|
254
|
+
|
255
255
|
def import_service(service,uri)
|
256
256
|
json_post(path(VMC::SERVICE_IMPORT_PATH, service),{:uri => uri})
|
257
257
|
end
|
@@ -390,16 +390,16 @@ class VMC::Client
|
|
390
390
|
"aws.af.cm"
|
391
391
|
end
|
392
392
|
end
|
393
|
-
|
394
|
-
def infra_valid?(name)
|
393
|
+
|
394
|
+
def infra_valid?(name)
|
395
395
|
infras.detect { |i| i[:infra] == name }
|
396
396
|
end
|
397
397
|
|
398
398
|
def infra_descriptions
|
399
|
-
infras.map { |i| i[:description] }
|
399
|
+
infras.select{|i| !i.has_key?(:available) || i[:available] == true}.map { |i| i[:description] }
|
400
400
|
end
|
401
|
-
|
402
|
-
def infra_name_for_description(desc)
|
401
|
+
|
402
|
+
def infra_name_for_description(desc)
|
403
403
|
info = infras.detect { |i| i[:description] == desc }
|
404
404
|
info ? info[:infra] : ""
|
405
405
|
end
|
@@ -559,5 +559,5 @@ class VMC::Client
|
|
559
559
|
def infras_match?(o1,o2)
|
560
560
|
o1 && o2 && ( o1[:infra] == o2[:infra])
|
561
561
|
end
|
562
|
-
|
562
|
+
|
563
563
|
end
|
metadata
CHANGED
@@ -1,213 +1,225 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: af
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 62196233
|
5
|
+
prerelease: 7
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 19
|
10
|
+
- beta
|
11
|
+
- 1
|
12
|
+
version: 0.3.19.beta.1
|
6
13
|
platform: ruby
|
7
|
-
authors:
|
14
|
+
authors:
|
8
15
|
- AppFog
|
9
16
|
autorequire:
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
|
20
|
+
date: 2013-09-18 00:00:00 -07:00
|
21
|
+
default_executable:
|
22
|
+
dependencies:
|
23
|
+
- !ruby/object:Gem::Dependency
|
15
24
|
name: json_pure
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 1.5.1
|
22
|
-
- - <
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 1.7.0
|
25
|
-
type: :runtime
|
26
25
|
prerelease: false
|
27
|
-
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
28
27
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 1
|
32
|
+
segments:
|
33
|
+
- 1
|
34
|
+
- 5
|
35
|
+
- 1
|
32
36
|
version: 1.5.1
|
33
37
|
- - <
|
34
|
-
- !ruby/object:Gem::Version
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
hash: 11
|
40
|
+
segments:
|
41
|
+
- 1
|
42
|
+
- 7
|
43
|
+
- 0
|
35
44
|
version: 1.7.0
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rubyzip
|
38
|
-
requirement: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 0.9.4
|
44
45
|
type: :runtime
|
46
|
+
version_requirements: *id001
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rubyzip
|
45
49
|
prerelease: false
|
46
|
-
|
50
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
47
51
|
none: false
|
48
|
-
requirements:
|
52
|
+
requirements:
|
49
53
|
- - ~>
|
50
|
-
- !ruby/object:Gem::Version
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 51
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
- 9
|
59
|
+
- 4
|
51
60
|
version: 0.9.4
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: rest-client
|
54
|
-
requirement: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - ! '>='
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 1.6.1
|
60
|
-
- - <
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 1.7.0
|
63
61
|
type: :runtime
|
62
|
+
version_requirements: *id002
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rest-client
|
64
65
|
prerelease: false
|
65
|
-
|
66
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
66
67
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 13
|
72
|
+
segments:
|
73
|
+
- 1
|
74
|
+
- 6
|
75
|
+
- 1
|
70
76
|
version: 1.6.1
|
71
77
|
- - <
|
72
|
-
- !ruby/object:Gem::Version
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 11
|
80
|
+
segments:
|
81
|
+
- 1
|
82
|
+
- 7
|
83
|
+
- 0
|
73
84
|
version: 1.7.0
|
74
|
-
- !ruby/object:Gem::Dependency
|
75
|
-
name: terminal-table
|
76
|
-
requirement: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
|
-
requirements:
|
79
|
-
- - ~>
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: 1.4.2
|
82
85
|
type: :runtime
|
86
|
+
version_requirements: *id003
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: terminal-table
|
83
89
|
prerelease: false
|
84
|
-
|
90
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
85
91
|
none: false
|
86
|
-
requirements:
|
92
|
+
requirements:
|
87
93
|
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 1
|
98
|
+
- 4
|
99
|
+
- 2
|
89
100
|
version: 1.4.2
|
90
|
-
- !ruby/object:Gem::Dependency
|
91
|
-
name: interact
|
92
|
-
requirement: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
|
-
requirements:
|
95
|
-
- - ~>
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.4.0
|
98
101
|
type: :runtime
|
102
|
+
version_requirements: *id004
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: interact
|
99
105
|
prerelease: false
|
100
|
-
|
106
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
101
107
|
none: false
|
102
|
-
requirements:
|
108
|
+
requirements:
|
103
109
|
- - ~>
|
104
|
-
- !ruby/object:Gem::Version
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 15
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
- 4
|
115
|
+
- 0
|
105
116
|
version: 0.4.0
|
106
|
-
- !ruby/object:Gem::Dependency
|
107
|
-
name: addressable
|
108
|
-
requirement: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
|
-
requirements:
|
111
|
-
- - ~>
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: 2.2.6
|
114
117
|
type: :runtime
|
118
|
+
version_requirements: *id005
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: addressable
|
115
121
|
prerelease: false
|
116
|
-
|
122
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
117
123
|
none: false
|
118
|
-
requirements:
|
124
|
+
requirements:
|
119
125
|
- - ~>
|
120
|
-
- !ruby/object:Gem::Version
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
hash: 11
|
128
|
+
segments:
|
129
|
+
- 2
|
130
|
+
- 2
|
131
|
+
- 6
|
121
132
|
version: 2.2.6
|
122
|
-
- !ruby/object:Gem::Dependency
|
123
|
-
name: uuidtools
|
124
|
-
requirement: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
|
-
requirements:
|
127
|
-
- - ~>
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: 2.1.0
|
130
133
|
type: :runtime
|
134
|
+
version_requirements: *id006
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: uuidtools
|
131
137
|
prerelease: false
|
132
|
-
|
138
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
133
139
|
none: false
|
134
|
-
requirements:
|
140
|
+
requirements:
|
135
141
|
- - ~>
|
136
|
-
- !ruby/object:Gem::Version
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 11
|
144
|
+
segments:
|
145
|
+
- 2
|
146
|
+
- 1
|
147
|
+
- 0
|
137
148
|
version: 2.1.0
|
138
|
-
- !ruby/object:Gem::Dependency
|
139
|
-
name: rb-readline
|
140
|
-
requirement: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
|
-
requirements:
|
143
|
-
- - ~>
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 0.4.2
|
146
149
|
type: :runtime
|
150
|
+
version_requirements: *id007
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
name: rb-readline
|
147
153
|
prerelease: false
|
148
|
-
|
154
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
149
155
|
none: false
|
150
|
-
requirements:
|
156
|
+
requirements:
|
151
157
|
- - ~>
|
152
|
-
- !ruby/object:Gem::Version
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
hash: 11
|
160
|
+
segments:
|
161
|
+
- 0
|
162
|
+
- 4
|
163
|
+
- 2
|
153
164
|
version: 0.4.2
|
154
|
-
|
165
|
+
type: :runtime
|
166
|
+
version_requirements: *id008
|
167
|
+
- !ruby/object:Gem::Dependency
|
155
168
|
name: rake
|
156
|
-
requirement: !ruby/object:Gem::Requirement
|
157
|
-
none: false
|
158
|
-
requirements:
|
159
|
-
- - ! '>='
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
version: '0'
|
162
|
-
type: :development
|
163
169
|
prerelease: false
|
164
|
-
|
165
|
-
none: false
|
166
|
-
requirements:
|
167
|
-
- - ! '>='
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: '0'
|
170
|
-
- !ruby/object:Gem::Dependency
|
171
|
-
name: rspec
|
172
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
173
171
|
none: false
|
174
|
-
requirements:
|
175
|
-
- -
|
176
|
-
- !ruby/object:Gem::Version
|
177
|
-
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
178
179
|
type: :development
|
180
|
+
version_requirements: *id009
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rspec
|
179
183
|
prerelease: false
|
180
|
-
|
184
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
181
185
|
none: false
|
182
|
-
requirements:
|
186
|
+
requirements:
|
183
187
|
- - ~>
|
184
|
-
- !ruby/object:Gem::Version
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
hash: 27
|
190
|
+
segments:
|
191
|
+
- 1
|
192
|
+
- 3
|
193
|
+
- 0
|
185
194
|
version: 1.3.0
|
186
|
-
- !ruby/object:Gem::Dependency
|
187
|
-
name: webmock
|
188
|
-
requirement: !ruby/object:Gem::Requirement
|
189
|
-
none: false
|
190
|
-
requirements:
|
191
|
-
- - ~>
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: 1.5.0
|
194
195
|
type: :development
|
196
|
+
version_requirements: *id010
|
197
|
+
- !ruby/object:Gem::Dependency
|
198
|
+
name: webmock
|
195
199
|
prerelease: false
|
196
|
-
|
200
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
197
201
|
none: false
|
198
|
-
requirements:
|
202
|
+
requirements:
|
199
203
|
- - ~>
|
200
|
-
- !ruby/object:Gem::Version
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
206
|
+
segments:
|
207
|
+
- 1
|
208
|
+
- 5
|
209
|
+
- 0
|
201
210
|
version: 1.5.0
|
211
|
+
type: :development
|
212
|
+
version_requirements: *id011
|
202
213
|
description: AppFog.com CLI
|
203
214
|
email: support@appfog.com
|
204
|
-
executables:
|
215
|
+
executables:
|
205
216
|
- af
|
206
217
|
extensions: []
|
207
|
-
|
218
|
+
|
219
|
+
extra_rdoc_files:
|
208
220
|
- README.md
|
209
221
|
- LICENSE
|
210
|
-
files:
|
222
|
+
files:
|
211
223
|
- LICENSE
|
212
224
|
- README.md
|
213
225
|
- Rakefile
|
@@ -251,28 +263,41 @@ files:
|
|
251
263
|
- caldecott_helper/Gemfile.lock
|
252
264
|
- caldecott_helper/server.rb
|
253
265
|
- bin/af
|
266
|
+
has_rdoc: true
|
254
267
|
homepage: http://appfog.com
|
255
268
|
licenses: []
|
269
|
+
|
256
270
|
post_install_message:
|
257
271
|
rdoc_options: []
|
258
|
-
|
272
|
+
|
273
|
+
require_paths:
|
259
274
|
- lib
|
260
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
275
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
261
276
|
none: false
|
262
|
-
requirements:
|
263
|
-
- -
|
264
|
-
- !ruby/object:Gem::Version
|
265
|
-
|
266
|
-
|
277
|
+
requirements:
|
278
|
+
- - ">="
|
279
|
+
- !ruby/object:Gem::Version
|
280
|
+
hash: 3
|
281
|
+
segments:
|
282
|
+
- 0
|
283
|
+
version: "0"
|
284
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
285
|
none: false
|
268
|
-
requirements:
|
269
|
-
- -
|
270
|
-
- !ruby/object:Gem::Version
|
271
|
-
|
286
|
+
requirements:
|
287
|
+
- - ">"
|
288
|
+
- !ruby/object:Gem::Version
|
289
|
+
hash: 25
|
290
|
+
segments:
|
291
|
+
- 1
|
292
|
+
- 3
|
293
|
+
- 1
|
294
|
+
version: 1.3.1
|
272
295
|
requirements: []
|
296
|
+
|
273
297
|
rubyforge_project:
|
274
|
-
rubygems_version: 1.
|
298
|
+
rubygems_version: 1.6.2
|
275
299
|
signing_key:
|
276
300
|
specification_version: 3
|
277
301
|
summary: AppFog.com CLI
|
278
302
|
test_files: []
|
303
|
+
|