Class: VMCAppfog::Infras

Inherits:
VMC::CLI
  • Object
show all
Defined in:
lib/appfog-vmc-plugin/commands/infra.rb

Instance Method Summary collapse

Instance Method Details

#infrasObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/appfog-vmc-plugin/commands/infra.rb', line 8

def infras
  if space = input[:space]
    begin
      space.summarize!
    rescue CFoundry::APIError
    end

    infras =
      with_progress("Getting infras in #{c(space.name, :name)}") do
        space.infras
      end
  else
    infras =
      with_progress("Getting infras") do
        client.infras
      end
  end

  line unless quiet?

  table(
    %w{infra description},
    infras.collect { |r|
      [c(r.name, :infra),c(r.description, :description),
      ]
    })
end