ovsdb-client
A Rust implementation of the OVSDB protocol client based on RFC7047.
Overview
This crate provides a client implementation for the Open vSwitch Database Management Protocol (OVSDB), allowing Rust applications to:
- Connect to OVSDB servers over TCP or Unix sockets
- Query database schemas
- Monitor tables for changes in real-time
- Execute transactions against OVSDB databases
Features
- Multiple Transport Options: Connect via TCP or Unix socket
- Schema Handling: Retrieve and parse database schemas
- Monitoring: Subscribe to changes in database tables
- JSON-RPC: Built on top of
jsonrpseefor reliable RPC communication - Async API: Fully async API designed for use with Tokio
Quick Start
use ;
use HashMap;
async
API Overview
Connections
// Connect via TCP
let client = connect_tcp.await?;
// Connect via Unix socket
let client = connect_unix.await?;
Basic Operations
// List databases
let databases = client.list_databases.await?;
// Get schema
let schema = client.get_schema.await?;
Monitoring
// Create monitor request
let mut requests = new;
requests.insert;
// Start monitoring
let initial_state = client.monitor.await?;
// Subscribe to updates
let mut stream = client.subscribe_to_method.await?;
while let Some = stream.next.await
Development Setup
To develop or test with this crate, you'll need an OVSDB server. You can use Docker to run one:
This starts an OVN Northbound OVSDB server that listens on port 6641.
OVSDB Protocol Support
This implementation supports the following OVSDB operations as defined in RFC7047:
- List Databases (Section 4.1.1)
- Get Schema (Section 4.1.2)
- Monitor (Section 4.1.5)
- Update Notifications (Section 4.1.6)
Future versions will add support for additional operations such as Transact (Section 4.1.3) and Monitor Cancellation (Section 4.1.7).
Related Crates
- ovsdb-schema: Core OVSDB data types and serialization
- ovsdb-derive: Derive macros for OVSDB struct generation
License
This project is licensed under the Apache License, Version 2.0.