AnyEvent-Porttracker

 view release on metacpan or  search on metacpan

Porttracker/protocol.pod  view on Meta::CPAN

=item "set_license" - configure a new licence

   > [<id>, "set_license", <license-string>]
   < [<id>, <status>]

Configures the given licence string as new licence for the box. Returns
successful if the licence is valid, fails otherwise.

Setting the license requires admin privileges.

=item "realm_info" - information about realms

   > [<id>, "realm_info", [<fields...>], [<realms...>]]
   < [<id>, 1, [ [<fields...>]... ]]

Example:

   > [1,"realm_info",["gid","description","polling","name","seeds"]]
   < [1,1,["5000015442","","0","Realm Name","192.168.33.19"]]

   > [1, "realm_info", ["gid", "discovery_result", "poll_result", "sync_result"]]
   < [1,1,["64424509927",{"infrastructure":13},{"poll":{"infrastructure":13,
        "ports":"339","end":"79"}},{"sync":{"qsync":null,"bsync":"Success"}}]]

Requests information about the given realms (or all realms if specified as
C<null>). The following fields can be requested, and their contents will be
returned in the order specified in the C<fields> array:

=over 4

=item gid - the gid (id value) identifying the realm

=item name - the user-specified name of the realm

=item description - the user-specified description for this realm

=item last_discover - timestamp of last discover run

=item last_poll - timestamp of last poll run

=item last_sync - timestamp of last sync run

=item polling - 0 (not polling) or 1 (currently polling)

=item syncing - 0 (not syncing) or 1 (currently syncing)

=item seeds - the seed list (whitespace-separated list of seed devices)

=item pollers - a list of poller-gids of pollers attached to the realm

=item discovery_result - a hash with key as infrastructure and value as number of devices discovered 

=item poll_result - a hash with keys infrastructure, ports and end and values as their counts

=item sync_result - a hash with keys qsync and bsync and values as their results

=item ageing_interval - ping sweep interval for this realm.

=back

=item "realm_info_modify" - edits the given realm

   > [<id>, "realm_info_modify", <realm-gid>, {<prop>:<value>,...}]
   < [<id>, 1]

A property hash followed by a realm gid. Keys of the hash are name,
description, discovery_poller and ageing_interval.

Example:

   > [1, "realm_info_modify", "38952865423", {"name":"default-1"}]
   < [1, 1]

=item "realm_modify" - adds and/or deletes realms

   > [<id>, "realm_modify", [delete-ids...], [[add-realm],...]]
   < [<id>, 1]

Two arrays expected as input. First array is a list of realm gids needs to be deleted.
Second array is a list of realm needs to be added. An array per realm can contain
realm name and description.

Example:

   > [1, "realm_modify", ["38456782341"], [["Test Realm", "for test"]]]
   < [1, 1]

=item "realm_discover" - run discovery on a given realm

   > [<id>, "realm_discover", <realm-gid>]
   < [<id>, 1]

=item "realm_poll" - run a poll on a given realm

   > [<id>, "realm_poll", <realm-gid>]
   < [<id>, 1, { <statistical data> } ]

=item "switch_poll" - run a poll on a given realm and switch ip

   > [<id>, "switch_poll", <realm-gid>, <switch ip>]
   < [<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>]... ]]

Porttracker/protocol.pod  view on Meta::CPAN

When no array given for block_port_macs property all the macs from port exclusion list
will get deleted.

Example:

   > [1, "realm_advanced_settings_modify", "64424509927", [["cdp_enabled", "0"]]]
   < [1, 1]

   > [1, "realm_advanced_settings_modify", "64424509927", [["block_port_macs", 
        ["11:00:0a:0b:11:22"], ["0a:11:22:44:0e:0b"]]]]
   < [1, 1]

=item "poller_info" - - information about pollers

   > [<id>, "poller_info", [<fields...>], [<pollers...>]]
   < [<id>, 1, [ [<fields...>]... ]]

Example:

   > [1, "poller_info", ["gid", "name", "description", "hostname"]]
   < [1,1,[["64424509930","localhost","localhost","127.0.0.1"]]]


Requests information about the given pollers (or all pollers if specified as
C<null>). The following fields can be requested, and their contents will be
returned in the order specified in the C<fields> array:

=over 4

=item gid - the gid (id value) identifying the poller

=item name - the user-specified name of the poller

=item description - the user-specified description for this poller

=item hostname - hostname/ip of this poller

=item dns_max_outstanding - maximum number of dns queries for this poller

=back

=item "poller_modify" - adds and/or deletes pollers

This request adds and/or deletes given pollers.

   > [<id>, "poller_modify", <realm-gid>, [<delete-gid>, ...], 
        [[<name>, <description>, <hostname>, <secret>], ...]]
   < [<id>, 1]

Two arrays followed by a realm gid. First array is a list of poller gids 
needs to be deleted. Second array is a list of pollers needs to be added. 
An array per poller should contain poller name, description, hostname and
secret password.

Example:

   > [1, "poller_modify", "385611201213", ["98456723211"], [["test1", 
                  "Test poller", "127.0.0.1", "test"]]]
   < [1, 1]

=item "poller_info_modify - edits the given poller

This request edits the given poller with new values.

   > [<id>, "poller_info_modify", <poller-gid>, {<prop>:<value>,...}]
   < [<id>, 1]

A property hash followed by a poller gid. Keys expected in the hash
are name, description, hostname, secret and dns_max_outstanding.

Example:
  
   > [1, "poller_info_modify", "6789345621", {"name":"test1",
         "secret":"test123", "hostname":"localhost",
         "dns_max_outstanding":"65"}]
   < [1, 1]

=item "poller_subnet_list" - list subnets attached to a given poller

This request returns all subnets attached to a given poller.

   > [<id>, "poller_subnet_list", <poller-gid>]
   < [<id>, 1, [ [<subnet>, <bits>, <ping-limit>, <flags>]... ]]

The reply contains an array with all configured subnets. Each subnet
will contain the subnet address in textual form, the leading number of
significant bits in the subnet (0..32 for IPv4, 0..128 for IPv6), a ping
limit (in kbit/s) and a flags value (bit value C<1> indicates whether the
subnet is exclided (C<0>) or included (C<1>), bit value C<2> indicates
whether pings are enabled (C<2>) or not).

Example: 

   > [1, "poller_subnet_list", "64424509930"]
   < [1,1,[["1.1.1.1",32,1000,1,2],["10.1.1.1",32,1000,0,0]]]

=item "poller_subnet_list_modify" - modify subnets of a poller 

Removes and/or adds subnet entries.

   > [<id>, "poller_subnet_list_modify", <poller-gid>, [<remove-subnet>], [<add-subnet>...]]
   < [<id>, 1]

The two arrays after the poller-gid specify a list of subnet addresses to
remove (only exact matches wil be removed) and a list of subnet-entries to
be added afterwards. Each entry in the <add-subnet> list follows the same
format as returned by C<poller_subnet_list>.

Example: 

   > [ 1, "poller_subnet_list_modify", "64424509930",[["1.1.1.1",32,1000,1,2],
         ["10.1.1.1",32,1000,0,0]], [["192.168.0.0", 16, 1200, 1,2]] ]
   < [1, 1]

=item "global_settings" - list global settings

This request returns all global settings or specific settings.

   > [<id>, "global_settings"]
   < [<id>, 1, [ [<property>, <value>]... ]]

The reply contains an array with all configured properties and values. Each property
and value will be in textual form.

Porttracker/protocol.pod  view on Meta::CPAN

This request deletes and adds given certificates.

   > [<id>, "security_certificate_list_modify", [<delete-list>], [[<name>, <certificate>], ...]]
   < [<id>, 1]

delete-list contains list of certificate names.
add-list should have a name and certificate one array per certificate. 

Example:

   > [1, "security_certificate_list_modify", ["old_custom"], [["new_custom", "-----BEGIN RSA PRIVATE KEY..."]
                                             ]]
   < [1, 1]

=item "security_certificate_assignment_list" - lists all assignable certificates

This request returns all certificate name and their current status.
one array per certicate will be used. current status shows whether it is assigned
to C<apache> or C<api> or C<null> for not in use.

   > [<id>, "security_certificate_assignment_list"]
   < [<id>, 1, [ [<name>, <status>], ... ]]

Example:

   > [1, "security_certificate_assignment_list"]
   > [1,1,[["System Default","apache"],["System Default","api"],["custome",null]]]

=item "security_certificate_assign" - assigns given certificate to api or apache

This request assigns given certificate to apache or api.

   > [<id>, "security_certificate_assign", [ [<name>, <assign>], ...] ]
   < [<id>, 1]

Example:

   > [1, "security_certificate_assign", [["custom", "apache"], ["custom", "api"]]]
   < [1, 1]

=item "security_authentication_method_list" - lists authentication methods and settings

This request returns all or specified properties of all or specified authentication method.
First array contains the list of properties and the second array contains the list of gids
of methods. Result array will have one array per authentication method.

Valid properties are

name gid inuse settings

   > [<id>, "security_authentication_method_list", [<properties>, ...], [<method-gid>, ...]]
   < [<id>, 1, [ [<value>, ...], ...]]

Example:

   > [1, "security_authentication_method_list", ["name"], ["90194313753", "90194313603"]]
   < [1,1,[["RADIUS"],["Active Directory (LDAPS)"]]]

=item "security_authentication_modify" - modifies given authentication methods

This request edits given authentication method.
First argument is the authentication method gid.
All new values should be mentioned in a hash. 

Valid properties are

inuse server secret csecret domain ctrls certificate

bit value C<inuse> will activate/inactivate the given authentication method.
C<server> is the RADIUS server for RADIUS authentication method.
C<secret> and C<csecret> are secret password and confirm secret password for RADIUS server.
C<domain> is the domain name for LDAP and LDAPS authentication methods.
C<ctrls> is the array of delete and add lists of domain controls.
C<certificate> is the valid certificate name for LDAPS authentication method.
C<timeout> is the value in seconds to be used when communicating with Active Directory servers.

   > [<id>, "security_authentication_modify", <method-gid>, {<property> : <value>,... }]
   < [<id>, 1]

Example:

   > [1, "security_authentication_modify", "90194313753", {"inuse" : 1, "server" : "4test"}]
   < [1, 1]

   > [1, "security_authentication_modify", "90194313603", {"certificate" : "custom", "domain" : "new"
                                                   "ctrls" : [ ["10.1.50.1"], ["10.1.50.2"] ]}]
   < [1, 1]

=item "group_info" - lists group information

This request returns all groups or specific groups. The request returns all
fields or specific fields.

   > [<id>, "group_info", [<field1>, <field2>, ...], [<group-gid>, ...]]
   < [<id>, 1, [ [<value>, <value>, ...] , ...]

The reply contains an array for each group with specified field values or all.

Example:

   > [1, "group_info", ["name"]]
   < [1,1,[["helpme"],["Network Administrator"],["Network Operator"],["Super Admin"]]]
   
=item "group_modify" - adds and/or deletes groups

This request adds and/or deletes given groups.

   > [<id>, "group_modify", [<delete-gid>, ...], [[<name>, <description>], ...]]
   < [<id>, 1]

Two arrays expected as input. First array is a list of group gids needs to be deleted.
Second array is a list of groups needs to be added. An array per group should contain 
group name and description.

Example:

   > [1, "group_modify", ["9845672231"], [["test1", "Test group"]]]
   < [1, 1]

=item "group_settings" - lists permissions for a given group

   > [<id>, "group_settings", <group-gid>, [<role>, <role>, ...], [<realm-gid>, ...]]
   < [<id>, 1, [[[<system-role>, <permission>], ...], 
                 [[<realm-gid>, [[<realm-role>, <permission>], ...]], ...]]]

The input should have a valid group gid in textual format. Two arrays followed by group gid
are list of roles and list of realm gids. These two arrays are optional.
The result contains two arrays. First array is for system specific roles. One array per role.
Second array is for realm specific roles. One array per realm. First element of the array is
realm-gid in textual format followed by an array of realm specific roles and their permission.
Permission will be referred in bit value. bit value C<0> means NO Access, C<1> means
Read Access and C<2> means Read/Write Access.

Example:

   > [1, "group_settings", "98784248728"]
   < [1,1,[[["API",2],["Add Realms",2],["Advanced Settings",1],["Global Settings",2]]
           ,[["3865500631171652",[["Advanced Realm Settings",0],["Assign Devices",0]]]]]]

   > [1, "group_settings", "98784248728", ["Add Realms", "Assign Devices"]]
   < [1,1,[[["Add Realms",2]],[["3865500631171652",[["Assign Devices",0]]],
           ["3865500631171517",[["Assign Devices",0]]]]]]


=item "group_settings_modify" - edits group properties and permissions

   > [<id>, "group_settings_modify", <group-gid>
             , {"name":<group-name>, "description":<group description>}
             , [[<system-role>, <permission>], ...], [[<realm-gid>, 
                                         [[<realm-role>, <permission>], ...]], ...] ]
   < [<id>, 1]

The input should have a valid group gid. A property hash followed by the group gid.
The values of keys C<name> and C<description> are new group name and description.
Two arrays followed by hash. First array is for system specific roles. Format of the
array is same as output of C<group_settings> query. Second array is for realm specific roles.
One array per realm. Format of this array is same as output of C<group_settings> query.

valid system specific roles are

"API", "Add Realms", "Advanced Settings", "Global Settings", "Group Management", "License", 
"Schedule Backup", "Security Settings", "System Utilities", "User Management", "View Log"

valid realm specific roles are

"Advanced Realm Settings", "Assign Devices", "Discovery Realm Settings", "Views",
"Plugins", "Poller Settings", "Schedule Discovery","Schedule Poll","Schedule Report" 
,"Schedule Sync"

Example:

   > [1, "group_settings_modify", "98784248723", {"name":"TEST"},
                            [["Add Realms",0]]], [["386550063117151",[["Poller Setting",1]]]]]
   < [1, 1]


   > [1, "group_settings_modify", "98784248723", {},
                            [["Add Realms",0],["Global Settings",1]]]
   < [1, 1]

=item "remote_backup" - runs the remote backup immediately

   > [<id>, "remote_backup", <protocol>, <host>, <user>, <password>,
                             <directory>, <email-recipient>]
   < [<id>, 1]

This request can be made without any arguments. When its requested without 
arguments make sure backup settings configured in GUI. The valid values for 
C<protocol> are C<SCP> and C<FTP>. The C<email-recipient> and C<directory> 
arguments are optional.

Example:

   > [1, "remote_backup"]
   < [1, 1]

   > [1, "remote_backup", "SCP", "10.5.1.1", "admin", "admin", "/tmp"]
   < [1, 1]

=back

=head1 AUTHOR

Marc Lehmann <marc@nethype.de>.



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