{"id":20324558,"url":"https://github.com/netascode/go-aci","last_synced_at":"2025-06-20T13:36:21.998Z","repository":{"id":189979844,"uuid":"681665716","full_name":"netascode/go-aci","owner":"netascode","description":"A Go client library for Cisco ACI.","archived":false,"fork":false,"pushed_at":"2025-01-14T10:25:21.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T22:41:24.320Z","etag":null,"topics":["aci","cisco","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netascode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-22T13:49:49.000Z","updated_at":"2025-01-13T19:28:25.000Z","dependencies_parsed_at":"2025-06-07T22:32:19.893Z","dependency_job_id":"d206bf99-0489-42da-9273-1614d9cba0cd","html_url":"https://github.com/netascode/go-aci","commit_stats":null,"previous_names":["netascode/go-aci"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/netascode/go-aci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netascode%2Fgo-aci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netascode%2Fgo-aci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netascode%2Fgo-aci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netascode%2Fgo-aci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netascode","download_url":"https://codeload.github.com/netascode/go-aci/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netascode%2Fgo-aci/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260953925,"owners_count":23088127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aci","cisco","go","golang"],"created_at":"2024-11-14T19:34:30.321Z","updated_at":"2025-06-20T13:36:16.988Z","avatar_url":"https://github.com/netascode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://github.com/netascode/go-aci/actions/workflows/test.yml/badge.svg)](https://github.com/netascode/go-aci/actions/workflows/test.yml)\n\n# go-aci\n\n`go-aci` is a Go client library for Cisco ACI. 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).\n\n## Getting Started\n\n### Installing\n\nTo start using `go-aci`, install Go and `go get`:\n\n`$ go get -u github.com/netascode/go-aci`\n\n### Basic Usage\n\n```go\npackage main\n\nimport \"github.com/netascode/go-aci\"\n\nfunc main() {\n    client, _ := aci.NewClient(\"https://1.1.1.1\", \"user\", \"pwd\")\n\n    res, _ = client.Get(\"/api/mo/uni/tn-infra\")\n    println(res.Get(\"imdata.0.*.attributes.name\"))\n}\n```\n\nThis will print:\n\n```\ninfra\n```\n\n#### Result manipulation\n\n`aci.Result` uses GJSON to simplify handling JSON results. See the [GJSON](https://github.com/tidwall/gjson) documentation for more detail.\n\n```go\nres, _ := client.GetClass(\"fvBD\")\nres.Get(\"0.fvBD.attributes.name\").Str // name of first BD\nres.Get(\"0.*.attributes.name\").Str // name of first BD (if you don't know the class)\n\nfor _, bd := range res.Array() {\n    println(res.Get(\"*.attributes|@pretty\")) // pretty print BD attributes\n}\n\nfor _, bd := range res.Get(\"#.fvBD.attributes\").Array() {\n    println(res.Get(\"@pretty\")) // pretty print BD attributes\n}\n```\n\n#### Helpers for common patterns\n\n```go\nres, _ := client.GetDn(\"uni/tn-infra\")\nres, _ := client.GetClass(\"fvTenant\")\n```\n\n#### Query parameters\n\nPass the `aci.Query` object to the `Get` request to add query paramters:\n\n```go\nqueryInfra := aci.Query(\"query-target-filter\", `eq(fvTenant.name,\"infra\")`)\nres, _ := client.GetClass(\"fvTenant\", queryInfra)\n```\n\nPass as many paramters as needed:\n\n```go\nres, _ := client.GetClass(\"isisRoute\",\n    aci.Query(\"rsp-subtree-include\", \"relations\"),\n    aci.Query(\"query-target-filter\", `eq(isisRoute.pfx,\"10.66.0.1/32\")`),\n)\n```\n\n#### POST data creation\n\n`aci.Body` is a wrapper for [SJSON](https://github.com/tidwall/sjson). SJSON supports a path syntax simplifying JSON creation.\n\n```go\nexampleTenant := aci.Body{}.Set(\"fvTenant.attributes.name\", \"aci-example\").Str\nclient.Post(\"/api/mo/uni/tn-aci-example\", exampleTenant)\n```\n\nThese can be chained:\n\n```go\ntenantA := aci.Body{}.\n    Set(\"fvTenant.attributes.name\", \"aci-example-a\").\n    Set(\"fvTenant.attributes.descr\", \"Example tenant A\")\n```\n\n...or nested:\n\n```go\nattrs := aci.Body{}.\n    Set(\"name\", \"aci-example-b\").\n    Set(\"descr\", \"Example tenant B\").\n    Str\ntenantB := aci.Body{}.SetRaw(\"fvTenant.attributes\", attrs).Str\n```\n\n#### Token refresh\n\nToken refresh is handled automatically. The client keeps a timer and checks elapsed time on each request, refreshing the token every 8 minutes. This can be handled manually if desired:\n\n```go\nres, _ := client.Get(\"/api/...\", aci.NoRefresh)\nclient.Refresh()\n```\n\n## Documentation\n\nSee the [documentation](https://godoc.org/github.com/netascode/go-aci) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetascode%2Fgo-aci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetascode%2Fgo-aci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetascode%2Fgo-aci/lists"}