Skip to content

netascode/go-meraki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tests

go-meraki

go-meraki is a Go client library for Cisco Meraki. It is based on Nathan's excellent goaci module and features a simple, extensible API and advanced JSON manipulation.

Getting Started

Installing

To start using go-meraki, install Go and go get:

$ go get -u github.com/netascode/go-meraki

Basic Usage

package main

import "github.com/netascode/go-meraki"

func main() {
    client, _ := meraki.NewClient("abc123")

    res, _ := client.Get("/organizations")
    println(res.Get("0.name").String())
}

This will print something like:

My First Organization

Result manipulation

meraki.Result uses GJSON to simplify handling JSON results. See the GJSON documentation for more detail.

res, _ := client.Get("/organizations")

for _, obj := range res.Array() {
    println(obj.Get("@pretty").String()) // pretty print network objects
}

POST data creation

meraki.Body is a wrapper for SJSON. SJSON supports a path syntax simplifying JSON creation.

body := meraki.Body{}.
    Set("name", "NewNetwork1").
    Set("productTypes", []string{"switch"})
client.Post("/organizations/123456/networks", body.Str)

Documentation

See the documentation for more details.

About

A Go client library for Cisco Meraki.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages