Module: Nis::Endpoint::Debug::Connections

Included in:
Nis
Defined in:
lib/nis/endpoint/debug/connections.rb

Instance Method Summary collapse

Instance Method Details

#debug_connections(dir) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/nis/endpoint/debug/connections.rb', line 33

def debug_connections(dir)
  request!(:get, "/debug/connections/#{debug_connections_direction(dir)}") do |res|
    Nis::Struct::AuditCollection.build(
      outstanding: res[:outstanding],
      most_recent: res[:'most-recent']
    )
  end
end

#debug_connections_direction(dir) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/nis/endpoint/debug/connections.rb', line 42

def debug_connections_direction(dir)
  case dir.to_s
  when /\Ai/ then :incoming
  when /\Ao/ then :outgoing
    else raise "Undefined direction: #{dir}"
  end
end

#debug_connections_incomingNis::Struct::AuditCollection



5
6
7
8
9
10
11
12
# File 'lib/nis/endpoint/debug/connections.rb', line 5

def debug_connections_incoming
  request!(:get, '/debug/connections/incoming') do |res|
    Nis::Struct::AuditCollection.build(
      outstanding: res[:outstanding],
      most_recent: res[:'most-recent']
    )
  end
end

#debug_connections_outgoingNis::Struct::AuditCollection



16
17
18
19
20
21
22
23
# File 'lib/nis/endpoint/debug/connections.rb', line 16

def debug_connections_outgoing
  request!(:get, '/debug/connections/outgoing') do |res|
    Nis::Struct::AuditCollection.build(
      outstanding: res[:outstanding],
      most_recent: res[:'most-recent']
    )
  end
end

#debug_connections_timersArray <Nis::Struct::NemAsyncTimerVisitor>



27
28
29
30
31
# File 'lib/nis/endpoint/debug/connections.rb', line 27

def debug_connections_timers
  request!(:get, '/debug/timers') do |res|
    res[:data].map { |natv| Nis::Struct::NemAsyncTimerVisitor.build(natv) }
  end
end