def show
domains = rest_client.domains
paragraph do
say "User Info"
say "========="
if domains.length == 0
say "Namespace: No namespaces found. You can use 'rhc domain create <namespace>' to create a namespace for your applications."
elsif domains.length == 1
say "Namespace: #{domains[0].id}"
else
domains.each_with_index { |d, i| say "Namespace(#{i}): #{d.id}" }
end
end
paragraph { say "Login: #{config.username}" }
domains.each do |d|
paragraph do
header = "Namespace #{d.id}'s Applications"
say header
say "=" * header.length
apps = d.applications
if apps.length == 0
say "No applications found. You can use 'rhc app create' to create new applications."
else
apps.each do |a|
carts = a.cartridges
paragraph do
say a.name
say " Framework: #{carts[0].name}"
say " Creation: #{a.creation_time}"
say " UUID: #{a.uuid}"
say " Git URL: #{a.git_url}" if a.git_url
say " Public URL: #{a.app_url}" if a.app_url
say " Aliases: #{a.aliases.join(', ')}" if a.aliases and not a.aliases.empty?
say " Cartridges:"
if carts.length > 1
carts.each do |c|
if c.type == 'embedded'
connection_url = c.property(:cart_data, :connection_url) || c.property(:cart_data, :job_url) || c.property(:cart_data, :monitoring_url)
value = connection_url ? " - #{connection_url['value']}" : ""
say " #{c.name}#{value}"
end
end
else
say " None"
end
end
end
end
end
end
0
end