https://github.com/netascode/go-meraki
A Go client library for Cisco Meraki.
https://github.com/netascode/go-meraki
cisco go golang meraki
Last synced: 3 months ago
JSON representation
A Go client library for Cisco Meraki.
- Host: GitHub
- URL: https://github.com/netascode/go-meraki
- Owner: netascode
- License: mpl-2.0
- Created: 2024-09-01T10:24:59.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T09:27:07.000Z (3 months ago)
- Last Synced: 2025-02-17T10:29:05.844Z (3 months ago)
- Topics: cisco, go, golang, meraki
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/netascode/go-meraki/actions/workflows/test.yml)
# go-meraki
`go-meraki` is a Go client library for Cisco Meraki. It is based on Nathan's excellent [goaci](https://github.com/brightpuddle/goaci) module and features a simple, extensible API and [advanced JSON manipulation](#result-manipulation).
## Getting Started
### Installing
To start using `go-meraki`, install Go and `go get`:
`$ go get -u github.com/netascode/go-meraki`
### Basic Usage
```go
package mainimport "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](https://github.com/tidwall/gjson) documentation for more detail.
```go
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](https://github.com/tidwall/sjson). SJSON supports a path syntax simplifying JSON creation.
```go
body := meraki.Body{}.
Set("name", "NewNetwork1").
Set("productTypes", []string{"switch"})
client.Post("/organizations/123456/networks", body.Str)
```## Documentation
See the [documentation](https://godoc.org/github.com/netascode/go-meraki) for more details.