Skip to content

The Go SDK for building applications and automation tools for Cisco Catalyst 9800 Wireless Controllers

License

Notifications You must be signed in to change notification settings

umatare5/cisco-ios-xe-wireless-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“— cisco-ios-xe-wireless-go - Go Library for C9800

GitHub Tag Test and Build Test Coverage Go Report Card OpenSSF Best Practices Go Reference License: MIT Published

A Go library for interacting with Cisco Catalyst 9800 Wireless Network Controller.

✨️ Key Features

  • πŸ”§ 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

πŸ“‘ Supported Environment

Cisco Catalyst 9800 Wireless Network Controller running Cisco IOS-XE 17.12.x.

πŸ“¦ Installation

go get github.com/umatare5/cisco-ios-xe-wireless-go

πŸš€ Quick Start

Note

You have to enable RESTCONF and HTTPS on the C9800 before using this library. Please see:

1. Generate a Basic Auth token

Encode your controller credentials as Base64.

# username:password β†’ Base64
echo -n "admin:your-password" | base64
# Output: YWRtaW46eW91ci1wYXNzd29yZA==

2. Run the sample application

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"

🌐 API Reference

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.

🀝 Contributing

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:

Warning

This library is under active development; I'll make the breaking changes until v1.0.0.

πŸ™ Acknowledgments

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.

πŸ“„ License

MIT

About

The Go SDK for building applications and automation tools for Cisco Catalyst 9800 Wireless Controllers

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •