{"id":17909007,"url":"https://github.com/jpbede/netpalmgo","last_synced_at":"2025-04-03T06:25:17.868Z","repository":{"id":56265667,"uuid":"311456590","full_name":"jpbede/netpalmgo","owner":"jpbede","description":"Go client package for the netpalm REST API","archived":false,"fork":false,"pushed_at":"2021-05-16T13:53:10.000Z","size":105,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-08T20:17:43.766Z","etag":null,"topics":["go","golang","netpalm","netpalm-api","network-automation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpbede.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["jpbede"]}},"created_at":"2020-11-09T20:26:47.000Z","updated_at":"2021-05-16T13:52:44.000Z","dependencies_parsed_at":"2022-08-15T15:40:41.949Z","dependency_job_id":null,"html_url":"https://github.com/jpbede/netpalmgo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbede%2Fnetpalmgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbede%2Fnetpalmgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbede%2Fnetpalmgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbede%2Fnetpalmgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpbede","download_url":"https://codeload.github.com/jpbede/netpalmgo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246945997,"owners_count":20859070,"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":["go","golang","netpalm","netpalm-api","network-automation"],"created_at":"2024-10-28T19:19:36.346Z","updated_at":"2025-04-03T06:25:17.843Z","avatar_url":"https://github.com/jpbede.png","language":"Go","funding_links":["https://github.com/sponsors/jpbede"],"categories":[],"sub_categories":[],"readme":"# netpalmgo\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0f2e53ed370844ff8696317a51be1e9e)](https://app.codacy.com/gh/jpbede/netpalmgo?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=jpbede/netpalmgo\u0026utm_campaign=Badge_Grade)\n[![PkgGoDev](https://pkg.go.dev/badge/go.bnck.me/netpalm)](https://pkg.go.dev/go.bnck.me/netpalm)\n![test](https://github.com/jpbede/netpalmgo/workflows/test/badge.svg)\n[![codecov](https://codecov.io/gh/jpbede/netpalmgo/branch/main/graph/badge.svg)](https://codecov.io/gh/jpbede/netpalmgo)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jpbede/netpalmgo)](https://goreportcard.com/report/github.com/jpbede/netpalmgo)\n\nGo package for [netpalm API](https://github.com/tbotnz/netpalm)\n\n## netpalmgo support\n\nI maintain a community on the networktocode slack channel\n\n#netpalmgo on networktocode.slack.com\n\n## Examples\n\n### Queueing a get task\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"go.bnck.me/netpalm\"\n  \"go.bnck.me/netpalm/models\"\n)\n\nfunc main() {\n  nc := netpalmgo.New(\"https://netapi.mynet.net\", \"\u003capikey\u003e\")\n\n  m := models.GetConfigRequest{\n    Library: models.LibraryNetmiko,\n    ConnectionArgs: models.ConnectionArgs{\n      DeviceType: \"cisco_ios\",\n      Host: \"10.10.10.1\",\n      Username: \"admin\",\n      Password: \"abc123\",\n    },\n    QueueStrategy: models.QueueStrategyFIFO,\n    Command: []string{\"show ip bgp sum\"},\n  }\n\n  // send task\n  d, err := nc.GetConfig().WithRequest(context.Background(), m)\n  if err != nil {\n    panic(err)\n  }\n\n  // wait blocking for task to finish\n  d, err = nc.WaitForResult(context.Background(), d)\n  if err != nil {\n    panic(err)\n  }\n}\n```\n\n### Queueing a set command\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"go.bnck.me/netpalm\"\n  \"go.bnck.me/netpalm/models\"\n)\n\nfunc main() {\n  nc := netpalmgo.New(\"https://netapi.mynet.net\", \"\u003capikey\u003e\")\n\n  m := models.SetConfigRequest{\n    Library: models.LibraryNetmiko,\n    ConnectionArgs: models.ConnectionArgs{\n      DeviceType: \"cisco_ios\",\n      Host: \"10.10.10.1\",\n      Username: \"admin\",\n      Password: \"abc123\",\n    },\n    QueueStrategy: models.QueueStrategyFIFO,\n    Config: []string{\n      \"set int tunnel tun0 remote-ip 192.168.2.1\",\n    },\n  }\n\n  // send set task\n  d, err := nc.SetConfig().Set(context.Background(), false, m)\n  if err != nil {\n    panic(err)\n  }\n\n  // wait blocking for task to finish\n  d, err = nc.WaitForResult(context.Background(), d)\n  if err != nil {\n    panic(err)\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpbede%2Fnetpalmgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpbede%2Fnetpalmgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpbede%2Fnetpalmgo/lists"}