Method: App42::Command::Service#service_bindInfo

Defined in:
lib/app42/command/service.rb

#service_bindInfoObject

list details of specific service



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/app42/command/service.rb', line 186

def service_bindInfo
  @options[:service] = ask_user_service_name if @options[:service].nil?
  query_params = params 
  query_params.store('serviceName', @options[:service])
  service_info = build_get_request query_params, 'service', "tunnel/#{@options[:service]}"
  
  rows, rows_header_final, rows_header = [], [], nil
  if service_info && service_info['service']
    rows_header = service_info['service'].keys 
    rows << service_info['service'].values

    rows_header.map { |e| rows_header_final << camel_case_to_whitespace(e) }
    
    table = Terminal::Table.new  :title => Paint["=== #{@options[:service]} Details ===", :green], :headings => rows_header_final, :rows => rows
    puts table
  end
end