Raritan EMX JSON-RPC API
|
Welcome to the Raritan JSON-RPC Software Development Kit! This archive contains libraries and documentation for developing programs using the JSON-RPC interface of Raritan product series PX2, PX3, BCM and EMX.
Raritan devices expose their full functionality via a JSON-RPC API. This API can be used for remote control, mass configuration or integration with other systems. All interfaces are formally defined in IDL (interface definition language) files.
JSON-RPC is a HTTP-based remote prodecure call (RPC) protocol. Client programs send JSON-encoded requests to a URL on the server. The server performs the requested operation and responds with either a response object or an error object, also encoded in JSON.
For example, a client might send the following request object to the /snmp
URL to invoke the getConfiguration
method:
The server will respond with the following object containing the active configuration of the SNMP agent:
The following pages introduce the interfaces required for some typical use cases:
This SDK includes client libraries for using the Raritan JSON-RPC API in programs written in the Perl, Python and Java programming languages. Those libraries are described on the following pages. Additionally, examples are given for sending raw JSON-RPC requests using the cURL command-line HTTP client.
Please note that some examples given may not be applicable to the product this API documentation was released for. Examples use APIs of PX2 or EMX. Nevertheless the principles of the API usage is identical for either product.
The following special features are supported by the provided language bindings:
Language | Basic Auth | Session Auth | Synchronous API | Asynchronous API | Multi-Version | Bulk RPC |
---|---|---|---|---|---|---|
Perl | yes | yes | yes | no | yes | no |
Python | yes | yes | yes | no | no | yes |
Java | yes | yes | yes | yes | yes | yes |
All interfaces, methods and data structures are formally defined in IDL files. These definitions are the source for the provided client libraries.
See Rules and Mechanism for Mapping PX2/EMX-IDL to JSON-RPC for more details about IDL and its mapping to JSON-RPC.
Recent versions of the Raritan firmware include an interpreter for the Lua programming language. This interpreter can be used to execute user-provided scripts directly on the device without need for a client PC. Lua scripts can access the IDL API, both on the unit they're running on and on remote units. Please see the file LuaPLC_Introduction.pdf in the SDK top directors for more details.