The Integration Challenge
Once you have an SDN controller with a RESTCONF northbound interface, the next step is integrating it with overlaying management tools and systems. Clients need to understand the semantics of XML or JSON data within RESTCONF messages — and doing this by hand is tedious and error-prone.
lighty.io provides client libraries in three languages, each at a different abstraction level:
Java Client Libraries
There are three tiers of Java client, from lowest to highest abstraction:
1. Raw Data Client
Provides convenient APIs for GET, POST, PUT, DELETE, RPC invocation, and notification subscription using raw strings. No type system — full flexibility.
// Raw client interface
CompletableFuture<Response<String, Exception>> get(
String path,
QueryParameters parameters,
MediaType acceptType,
MediaType contentType);
CompletableFuture<Response<Void, Exception>> post(
String path,
String data,
QueryParameters parameters,
MediaType acceptType,
MediaType contentType);
// Subscribe to YANG notifications
RawListenerRegistration registerNotificationListener(
RawNotificationListener notificationListener,
RawEstablishSubscriptionInput establishBuilder);
2. Binding Independent Client
Based on the Raw client but works with NormalizedNode and YangInstanceIdentifier — the OpenDaylight DOM layer. Provides structured, schema-aware access without requiring generated Java bindings.
// Read data using DOM path
CompletableFuture<Response<NormalizedNode, Exception>> get(
YangInstanceIdentifier path,
MountPoint mountPoint,
QueryParameters parameters);
// Invoke RPC using SchemaPath
CompletableFuture<Response<NormalizedNode, Exception>> invokeRpc(
SchemaPath path,
NormalizedNode input,
Class<NormalizedNode> outputType,
MountPoint mountPoint);
Well-known ODL services are also available directly on the client:
DOMDataBrokerDOMRpcServiceDOMNotificationServiceDOMMountPoint
3. Binding Aware Client
The highest-level Java client. Uses YANG-generated Java bindings for full compile-time type safety. This is the recommended client for Java applications with known YANG models.
// Fully typed GET using InstanceIdentifier
<D extends DataObject> CompletableFuture<Response<D, Exception>> get(
InstanceIdentifier<D> path,
MountPoint mountPoint,
QueryParameters parameters);
// Typed RPC invocation
<D extends DataObject, O extends DataObject>
CompletableFuture<Response<O, Exception>> invokeRpc(
SchemaPath path,
D input,
Class<O> outputType,
MountPoint mountPoint);
// Typed notification subscription
<N extends NotificationListener>
BindingAwareListenerRegistrationImpl<N> registerNotificationListener(
N notificationListener,
MountPoint mountPoint,
List<BindingSubscriptionEstablish> establishInputs);
Python Client
For scripting and automation environments. Provides a clean, idiomatic Python API for all RESTCONF operations including YANG notification subscriptions.
from ltrestconf.client import Restconf
from ltrestconf.exceptions import RestconfServerError, RestconfRequestError
client = Restconf(
scheme='https',
host='localhost',
port=8181,
insecure=True
)
try:
# Write configuration
client.put('data/toaster/darknessFactor', {'darknessFactor': 1000})
# Read operational data
resp = client.get('data/toaster/darknessFactor')
print(resp.dict()['darknessFactor'])
except RestconfRequestError as exc:
print(exc) # Failed to send request
except RestconfServerError as exc:
print(exc) # Server returned an error
Available methods: options(), head(), get(), post(), put(), delete(), patch(), subscribe()
All methods accept: path, keys (list key values), mount (device mount point), query parameters, and custom headers.
Go Client
For high-performance microservice integrations. The Go client offers the same RESTCONF operation coverage as the Python library, optimised for concurrent workloads and low overhead deployments.
Summary
- Java Raw — maximum flexibility, string-based, good for dynamic/unknown schemas
- Java Binding Independent — DOM-level, schema-aware, no code generation needed
- Java Binding Aware — fully typed, compile-time safe, recommended for known YANG models
- Python — scripting, automation, CI tooling
- Go — microservices, high-throughput integrations