vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.91 vs vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.92
- old
+ new
@@ -25,11 +25,11 @@
space.apps
end
else
apps =
with_progress("Getting applications") do
- client.apps(2)
+ client.apps(:depth => 2)
end
end
line unless quiet?
@@ -573,12 +573,19 @@
:from_given => by_name("app")
def stats
app = input[:app]
stats =
- with_progress("Getting stats for #{c(app.name, :name)}") do
- app.stats
+ with_progress("Getting stats for #{c(app.name, :name)}") do |s|
+ begin
+ app.stats
+ rescue CFoundry::StatsError
+ s.fail do
+ err "Application #{b(app.name)} is not running."
+ return
+ end
+ end
end
line unless quiet?
table(
@@ -620,15 +627,15 @@
if v2?
host, domain_name = simple.split(".", 2)
domain =
- client.current_space.domains(0, :name => domain_name).first
+ client.current_space.domain_by_name(domain_name, :depth => 0)
fail "Invalid domain '#{domain_name}'" unless domain
- route = client.routes(0, :host => host).find do |r|
+ route = client.routes_by_host(host, :depth => 0).find do |r|
r.domain == domain
end
unless route
route = client.route
@@ -669,14 +676,14 @@
if v2?
host, domain_name = simple.split(".", 2)
domain =
- client.current_space.domains(0, :name => domain_name).first
+ client.current_space.domain_by_name(domain_name, :depth => 0)
fail "Invalid domain '#{domain_name}'" unless domain
- route = app.routes(0, :host => host).find do |r|
+ route = app.routes_by_host(host, :depth => 0).find do |r|
r.domain == domain
end
fail "Invalid route '#{simple}'" unless route