Difference between revisions of "Gateways"
Jump to navigation
Jump to search
Infrastation (talk | contribs) (added section on breeds) |
Infrastation (talk | contribs) (new section on key files) |
||
Line 14: | Line 14: | ||
* <tt>vrp53</tt> (Huawei VRP release 5.3) | * <tt>vrp53</tt> (Huawei VRP release 5.3) | ||
* <tt>vrp55</tt> (Huawei VRP releases 5.5 and 5.7) | * <tt>vrp55</tt> (Huawei VRP releases 5.5 and 5.7) | ||
− | == | + | ==Key source code files== |
+ | There are three main files involved in operation of RackTables gateways infrastructure: | ||
+ | ; <tt>gateways.php</tt> | ||
+ | : Formerly the main source code of the old API of RackTables 0.16.x to 0.19.x, now contains mostly legacy functions and will be dismissed in future releases. New functions should not be added to this file. Its purpose is mostly containing <tt>$breedfunc</tt> and <tt>detectDeviceBreed()</tt>. | ||
+ | ; <tt>deviceconfig.php</tt> | ||
+ | : Contains most vendor-specific functions translating from plain text to RackTables PHP arrays/strings and back. Support for new breeds typically requires adding functions to this file. | ||
+ | ; <tt>remote.php</tt> | ||
+ | : The current 0.20.x gateways API. This file normally requires no changes. | ||
+ | |||
+ | ==Key API funcrions== | ||
There are two core functions: | There are two core functions: | ||
<pre> | <pre> |
Revision as of 12:36, 10 September 2012
Contents
What are RackTables gateways
RackTables is a PHP web application. Gateways are special executables residing on the same web-server, but not belonging to RackTables. The executables may be command-line scripts written in PHP, Perl, Python or any other language, or even binary files. Although PHP itself allows execution of arbitrary external commands, RackTables API provides helper functions to make such interaction ordered and convenient.
What is device "breed"
In RackTables source code a breed stands for a distinguished type of a managed device. There are currently the following breeds implemented:
- air12 (Cisco Aironet IOS release 12.x)
- eos4 (Arista EOS release 4.x)
- fdry5 (Foundry Networks IronWare release 5.x)
- ftos8 (Force10 FTOS release 8.x)
- ios12 (Cisco Catalyst IOS release 12.x)
- iosxr4 (Cisco XR IOS release 4.2)
- jun10 (Juniper JunOS releases 10, 11 and 12)
- nxos4 (Cisco Nexus NX-OS releases 4.x, 5.x and 6.x)
- ros11 (Marvell ROS release 1.1)
- vrp53 (Huawei VRP release 5.3)
- vrp55 (Huawei VRP releases 5.5 and 5.7)
Key source code files
There are three main files involved in operation of RackTables gateways infrastructure:
- gateways.php
- Formerly the main source code of the old API of RackTables 0.16.x to 0.19.x, now contains mostly legacy functions and will be dismissed in future releases. New functions should not be added to this file. Its purpose is mostly containing $breedfunc and detectDeviceBreed().
- deviceconfig.php
- Contains most vendor-specific functions translating from plain text to RackTables PHP arrays/strings and back. Support for new breeds typically requires adding functions to this file.
- remote.php
- The current 0.20.x gateways API. This file normally requires no changes.
Key API funcrions
There are two core functions:
function queryTerminal ($object_id, $commands, $tolerate_remote_errors = TRUE) function callScript ($gwname, $params, $in, &$out, &$errors)