meraki-cli

command module
v0.0.0-...-b7c797c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

meraki-cli

Experimental CLI for Meraki API, using API client libraries code-generated by go-swagger

Summary

This golang project demonstrates the ability generate source files for a Meraki API client by running the go-swagger tool against the swagger file downloaded from Cisco Meraki. This project also demonstrates the creation of a CLI client using the Kingpin library by connecting CLI actions to Meraki API calls, using minimal code. Only a few CLI->API calls have been implemented, since this project is meant to serve as an example of a general pattern.

Usage

$ ./meraki-cli --help
usage: meraki [<flags>] <command> [<args> ...]

The Meraki CLI command.

Flags:
  --help              Show context-sensitive help (also try --help-long and --help-man).
  --auth-token=""     Auth token. Export env var MERAKI_AUTH_TOKEN as an alternative
  --log-level="info"  Set log-level (trace|debug|info|warn|error|fatal|panic).
  --server-host="api.meraki.com"
                      Server host.
  --server-port=443   Server port.

Commands:
  help [<command>...]
    Show help.

  devices list --organization-id=ORGANIZATION-ID
    List all devices.

  events list --network-id=NETWORK-ID --product-type=PRODUCT-TYPE
    List all events for a network.

  events types --network-id=NETWORK-ID
    List all events for a network.

  networks list --organization-id=ORGANIZATION-ID
    List all networks for an organization.

  networks get --network-id=NETWORK-ID
    Get a network.

  networks clients list --network-id=NETWORK-ID
    List all Clients for a network.

  networks ssids list --network-id=NETWORK-ID
    List all SSIDs for a network.

  organizations list
    List all organizations.

  organizations get --organization-id=ORGANIZATION-ID
    Get a organization.

  version
    Display version information.

Demo

Animated Image of Terminal

Installing

go get github.com/cisco-sso/meraki-cli

Building

make all

Running

# Set your authentication token
export MERAKI_AUTH_TOKEN=<secret_token>

# Execute a command
meraki-cli organizations list

Debugging

# Enable debugging via environment variable
export DEBUG=1

# Execute the command with a flag
meraki-cli --log-level=debug ...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL