Revision ebc810f4 src/cli/one_helper/onezone_helper.rb

View differences:

src/cli/one_helper/onezone_helper.rb
18 18

  
19 19
class OneZoneHelper < OpenNebulaHelper::OneHelper
20 20

  
21
    SERVER_NAME={
22
        :name => "server_name",
23
        :short => "-n server_name",
24
        :large => "--name",
25
        :format => String,
26
        :description => "Zone server name"
27
    }
28

  
29
    SERVER_ENDPOINT={
30
        :name => "server_rpc",
31
        :short => "-r rpc endpoint",
32
        :large => "--rpc",
33
        :format => String,
34
        :description => "Zone server RPC endpoint"
35
    }
36

  
21 37
    def self.rname
22 38
        "ZONE"
23 39
    end
......
98 114
        puts str % ["NAME", zone.name]
99 115
        puts
100 116

  
117
        zone_hash=zone.to_hash
118

  
119
        if zone.has_elements?("/ZONE/SERVER_POOL/SERVER")
120
            puts
121
            CLIHelper.print_header(str_h1 % "SERVERS",false)
122

  
123
            CLIHelper::ShowTable.new(nil, self) do
124

  
125
                column :"ID", "", :size=>2 do |d|
126
                    d["ID"] if !d.nil?
127
                end
128

  
129
                column :"NAME", "", :left, :size=>15 do |d|
130
                    d["NAME"] if !d.nil?
131
                end
132

  
133
                column :"ENDPOINT", "", :left, :size=>30 do |d|
134
                    d["ENDPOINT"] if !d.nil?
135
                end
136

  
137
            end.show([zone_hash['ZONE']['SERVER_POOL']['SERVER']].flatten, {})
138
        end
139

  
140
        puts
141

  
101 142
        CLIHelper.print_header(str_h1 % "ZONE TEMPLATE", false)
102 143
        puts zone.template_str
103 144
    end

Also available in: Unified diff