Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
|
Welcome to the Xerus™ JSON-RPC Software Development Kit! This archive contains libraries and documentation for developing programs using the JSON-RPC interface of Legrand, Raritan and Server Technology Xerus™ products.
Xerus 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:
All JSON-RPC requests must be directed to a URL on the device's HTTPS service. The path component of this URL is called resource ID (RID). See Well-Known Resource IDs for a list of resource IDs that serve as entry points into the API.
The following pages introduce the interfaces required for some typical use cases:
This SDK includes client libraries for using the Xerus™ 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 the API of PDU. 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 |
C# / .NET | 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 Xerus™-IDL to JSON-RPC for more details about IDL and its mapping to JSON-RPC.
See IDL Interface Versioning for details about interface version numbers.
Recent versions of the Xerus 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 LuaPLC for more details.