A Go library for interacting with Cisco Catalyst 9800 Wireless Network Controller.
- π§ Developer Friendly: Transparent YANG model handling with all responses in JSON format
- π Comprehensive Coverage: Access most status information and metrics available from the WNC
- π Quick Integration: Get started in minutes with simple configuration and clear examples
- π― Type-Safe Operations: Strongly-typed Go structs for all API interactions and responses
- π Comprehensive Documentation: Detailed API reference, testing guides, and best practices
Cisco Catalyst 9800 Wireless Network Controller running Cisco IOS-XE 17.12.x
.
go get github.com/umatare5/cisco-ios-xe-wireless-go
Note
You have to enable RESTCONF and HTTPS on the C9800 before using this library. Please see:
Encode your controller credentials as Base64.
# username:password β Base64
echo -n "admin:your-password" | base64
# Output: YWRtaW46eW91ci1wYXNzd29yZA==
Use your controller host and token to fetch AP operational data.
package main
import wnc "github.com/umatare5/cisco-ios-xe-wireless-go"
func main() {
// Load environment variables
controller := os.Getenv("WNC_CONTROLLER")
token := os.Getenv("WNC_ACCESS_TOKEN")
// Create client
client, err := wnc.NewClient(controller, token,
wnc.WithTimeout(30*time.Second),
wnc.WithInsecureSkipVerify(true), // remove for production
)
// Create simple context with timeout
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
// Request AP operational data
apData, err := client.AP().GetOper(ctx)
if err != nil {
fmt.Fprintln(os.Stderr, "AP oper request:", err)
os.Exit(1)
}
// Print AP operational data
fmt.Printf("Successfully connected! Found %d APs\n",
len(apData.CiscoIOSXEWirelessAccessPointOperAccessPointOperData.OperData)
)
}
Caution
The wnc.WithInsecureSkipVerify(true)
option disables TLS certificate verification. This should only be used in development environments or when connecting to controllers with self-signed certificates. Never use this option in production environments as it compromises security.
Note
Runnable examples are available:
-
Minimal:
examples/minimal
β create a client and call a single endpointβ― go run examples/minimal/main.go Successfully connected! Found 2 APs
-
Advanced:
examples/advanced
β multi-service workflow with logging and contextβ― go run examples/advanced/main.go time=2025-08-09T12:47:34.089+09:00 level=INFO msg="starting advanced WNC example" controller=wnc1.example.internal time=2025-08-09T12:47:34.666+09:00 level=INFO msg="retrieved AP operational data" ptr=true time=2025-08-09T12:47:35.175+09:00 level=INFO msg="retrieved Client operational data" ptr=true time=2025-08-09T12:47:35.399+09:00 level=INFO msg="retrieved Rogue operational data" ptr=true time=2025-08-09T12:47:35.399+09:00 level=INFO msg="workflow completed successfully"
The library provides a set of functions for interacting with all major Cisco Catalyst 9800 WNC subsystems. For detailed API documentation, please see API Reference.
I welcome all kinds of contributions from the community! Please read the Contribution Guide before submitting PRs or issues. For additional guidance, please also see the following documents:
- π Make Command Reference β Make targets and the usage
- π Scripts Reference β Per-script usage and sample outputs
- π§ͺ Testing Guide β How to run unit and integration tests
Warning
This library is under active development; I'll make the breaking changes until v1.0.0
.
- The remaining tasks to reach
v1.0.0
are tracked in Milestone: 1.0.0.
This project was developed with the assistance of GitHub Copilot Agent Mode. Thanks to the global developer community who have contributed their knowledge and code to open source projects and public repositories.