AnyEvent-Porttracker

 view release on metacpan or  search on metacpan

Porttracker/protocol.pod  view on Meta::CPAN

   < [<id>, 1, { <statistical data> } ]

=item "realm_sync" - run a sync on a given realm and plugin

   > [<id>, "realm_sync", <realm-gid>, <sync module>]
   < [<id>, 1]

The C<sync module> can be either bsync or qsync.

=item "realm_query" - query the database

This request executes a database query with filtering, much like the
device and switch views work in the user interface.

   > [<id>, "realm_query", <realm-gid>, <type>
      [<column-name>...], [<raw-column-name]>...],
      {<column-name> : <filter-expression>...},
      <history mask>, 
      {<port unused period> : <unused value>}
     ]
   < [<id>, 1, [ [<result-data>]... ]]

The C<realm-gid> is the GID of the realm to query, as returned by
C<real_info>. The C<type> is the string C<device>, C<switch> or
C<switch_detail>, which corresponds to the device view, switch view or
switch detail view.

The first array of C<column-name>s specifies which columns should be
returned. The second array of C<raw-column-name>s works likewise, but
the values returned will be the "raw" (possibly octet-encoded) database
contents. Specifying the same column name in both array causes undefined
behaviour.

The hash of C<column-name> => C<filter-expression> pairs specifies
additional filters. The syntax for the C<filter-expression> is the same as
the ones used by the GUI.

The C<history mask> is the history selection option.
Value 0 means C<current>, value 1 means C<All> and value 2 means 
C<All+Changes>. Default value is 0.

The hash of C<port unused period> => C<unused> pairs specifies
port unused time. The C<port unused period> can be days, months or years.

The reply contains an array of result rows. Each row consists of data
values using the same ordering as in the requested column-name arrays, raw
columns last.

The (JSON) type of each column depends on the column itself, and can vary
between rows.

=over 4

=item valid columns for "device" query

vlanname, port_pktcount, linkduplex, port_mac, device_log_end, 
port_errorcount, vtpdomain, switch_ip, device_log_start, 
linkstatus, linkspeed, device_mac, history_device, linkadminduplex, 
ifname, device_comment, device_notes, vlan, device_dnsname, 
ifalias, switch_uid, ifdescr, linkadminstatus, 
port_error_percentage, device_ip

=item valid columns for "switch" query

number_ports, switch_action, switch_syslocation, 
free_ports_percentage, switch_sysservices, switch_dnsname, 
history_switch, switch_log_end, switch_pollduration, switch_model, 
available_ports_percentage, switch_comment, ports_lastchange, 
switch_ip, switch_sysdescr, switch_notes, available_ports, 
poe_ports, switch_log_start, switch_uid, switch, free_ports

=back

Example:

   > [1, "realm_query", "5100005442", "device",
     ["switch_uid", "device_ip"],
     ["device_mac"],
     { "switch_uid" : "switch03%" }]
   < [1,1,[["switch03.ibm.de","192.168.40.11","\u00000B\u0006D^"],...

=item valid columns for "switch_detail" view

port_pktcount, history_port, linkduplex, port_mac, port_comment, 
port_log_start, port_errorcount, port_log_end, 
detected_devices_current, linkstatus, linkspeed, linkadminduplex, 
ifname, port_action, poe_power, ifalias, switch_uid, poe_status, switch, 
ifdescr, linkadminstatus, port_error_percentage

Example:

   > [5, "realm_query", "5100005442", "switch_detail",
     ["ifname"], [],
     { "switch" : 27 }]
   < [5,1,[["Fa0/11"],["Fa0/21"], ... ,["Fa0/5"]]]

=item "report_info" - returns the available report list

This request returns the report list for the logged-in user.

   > [<id>, "report_info"]
   < [<id>, 1, [ [<gid>, <name>], ...]]

The reply will contains an array for each report. Each array will have gid 
and name of the report.

Example:

   > [1, "report_info"]
   < [1,1,[["3865500631171148","New Report 1"]]]

=item "user_view_info" - return the available views list

This request returns the report views list for the logged-in user.

   > [<id>, "user_view_info", [<field-list>], [<type-list>]]
   < [<id>, 1, [ [<fields>, ...], ...]]

Valid fields are C<name> and C<gid> and valid types are C<switch>,
C<port> and C<device>. The reply will contains an array for each view.

Example:

   > [1, "user_view_info", ["gid", "name"]]
   < [1,1,[["107374182462","Ports:Default"],
           ["94489280669","Ports:Multiple Devices on Port"],
           ["107374182460","End Devices:Default"],
           ["3865500631171226","End Devices:test"],
           ["3865500631171236","End Devices:tns04"]]]

=item "realm_view" - query database with given view in a given realm

This request returns the database entries for the given view and the realm.

   > [<id>, "realm_view", <realm-gid>, <view-gid>]
   < [<id>, 1,[ [<result-data>]]]

Valid view gid should be given followed by a valid realm gid.
The reply will contain the results from database query and one array per 
database row.

Example:

   > [1, "realm_view", "64424509927", "107374182461"]
   < [1,1,[["tnsw04.uk.internal","S","26","15","15","58","0","2009-12-08 12:17:00",
            "2009-12-08 12:17:00",null],["tnsw05.uk.internal","S","26","20","20"
            ,"77","0","2009-12-08 12:17:00","2009-12-08 12:17:00",null]]]



( run in 0.785 second using v1.01-cache-2.11-cpan-39bf76dae61 )