14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/pvdgm-svc-client/resources/service_definition.rb', line 14
def list
tp_id = third_party_id
result = get("services/third_parties/#{tp_id}/service_definitions")
puts "\nService definitions for third party: #{tp_id}"
table = Terminal::Table.new headings: [ 'Third Party', 'Service', 'Hostname', 'Port', 'Base URI', 'User Name', 'Service Class', 'Password', 'Token' ] do |t|
result.each do | service_definition |
t << [ "#{service_definition['third_party_name']} (#{service_definition['third_party_id']})",
"#{service_definition['service_name']} (#{service_definition['service_id']})",
service_definition['hostname'],
service_definition['port'],
service_definition['base_uri'],
service_definition['username'],
service_definition['service_class'],
service_definition['password'],
service_definition['token'] ]
end
end
puts table
puts
end
|