{"id":26899796,"url":"https://github.com/ctjnkns/onos-client-go","last_synced_at":"2026-05-03T04:32:10.267Z","repository":{"id":212363778,"uuid":"731323740","full_name":"ctjnkns/onos-client-go","owner":"ctjnkns","description":"This is a Go client for interacting with the ONOS API. It was developed alongside the ONOS Terraform Provider.","archived":false,"fork":false,"pushed_at":"2024-01-03T20:39:56.000Z","size":90,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T13:35:33.305Z","etag":null,"topics":["api","api-client","api-client-go","golang","onos","sdn","terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctjnkns.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-12-13T20:32:46.000Z","updated_at":"2024-01-03T17:31:28.000Z","dependencies_parsed_at":"2023-12-17T00:24:55.703Z","dependency_job_id":"beb695fe-95c2-4481-a4fd-40d20e5c0ff9","html_url":"https://github.com/ctjnkns/onos-client-go","commit_stats":null,"previous_names":["ctjnkns/onos-client","ctjnkns/onos-client-go"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjnkns%2Fonos-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjnkns%2Fonos-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjnkns%2Fonos-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjnkns%2Fonos-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctjnkns","download_url":"https://codeload.github.com/ctjnkns/onos-client-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246598198,"owners_count":20802975,"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":["api","api-client","api-client-go","golang","onos","sdn","terraform","terraform-provider"],"created_at":"2025-04-01T06:53:33.748Z","updated_at":"2026-05-03T04:32:05.223Z","avatar_url":"https://github.com/ctjnkns.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONOS Client\nThis is a Go client for interacting with the [ONOS](https://opennetworking.org/onos/) API. It was developed alongside the [ONOS Terraform Provider](https://github.com/ctjnkns/terraform-provider-onos).\n\n## Basic Usage\nWorking examples are located in the examples direcotry. The folloiwng are snippets to demonstrate basic usage.\n\n#### Creating a client\n```go\nconst HostURL string = \"http://localhost:8181/onos/v1\"\nusername := \"onos\"\npassword := \"rocks\"\n\nclient, err := onosclient.NewClient(HostURL, username, password)\nif err != nil {\n    fmt.Println(err)\n}\n```\n\n#### Creating a client using Environment Variables\n```shell\n#bash\nexport ONOS_HOST=http://localhost:8181/onos/\nexport ONOS_USERNAME=onos\nexport ONOS_PASSWORD=rocks\n```\n\n```go\nhost := os.Getenv(\"ONOS_HOST\")\nusername := os.Getenv(\"ONOS_USERNAME\")\npassword := os.Getenv(\"ONOS_PASSWORD\")\n\nclient, err := onosclient.NewClient(host, username, password)\nif err != nil {\n    fmt.Println(err)\n}\n```\n\n#### Get Hosts\n```go\nhosts, err := client.GetHosts()\nif err != nil {\n    fmt.Println(err)\n}\n\nfmt.Println(hosts)\n```\n\n#### Get Flows\n```go\nflows, err := client.GetFlows()\nif err != nil {\n    fmt.Println(err)\n}\n\nfmt.Println(flows)\n```\n\n#### Get Intents\n```go\nintents, err := client.GetIntents()\nif err != nil {\n    fmt.Println(err)\n}\n\nfmt.Println(intents)\n```\n\n#### Get a single Intent\nThe AppID and Key are required to lookup the intent in ONOS.\n\n```go\nintent := onosclient.Intent{\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n}\n\nintent, err = client.GetIntent(intent)\nif err != nil {\n    fmt.Println(err)\n}\nfmt.Println(intent)\n```\n\n#### Create an Intent\n\n```go\nintent := onosclient.Intent{\n    Type:  \"HostToHostIntent\",\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n    One:   \"00:00:00:00:00:01/None\",\n    Two:   \"00:00:00:00:00:02/None\",\n}\n\nintent, err = client.CreateIntent(intent)\nif err != nil {\n    fmt.Println(err)\n}\nfmt.Println(intent)\n```\n\n#### Update an Intent\nThe AppID and Key must match an exisitng intent in ONOS.\n\n```go\nintent := onosclient.Intent{\n    Type:  \"HostToHostIntent\",\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n    One:   \"00:00:00:00:00:01/None\",\n    Two:   \"00:00:00:00:00:03/None\",\n}\n\nintent, err = client.UpdateIntent(intent)\nif err != nil {\n    fmt.Println(err)\n}\nfmt.Println(intent)\n```\n\n#### Delete an Intent\nThe AppID and Key are required to lookup the intent in ONOS.\n\n```go\nintent := onosclient.Intent{\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n}\n\nerr = client.DeleteIntent(intent)\nif err != nil {\n    fmt.Println(err)\n}\n```\n\n## Example Using Docker Containers running on Linux (Ubuntu 22.04.3 LTS)\nThese examples require a current version of [go](https://go.dev/doc/install) and [docker](https://docs.docker.com/engine/install/ubuntu/).\n\n### Docker Environment Setup\nNavigate to the examples directory and run:\n\n```shell\nsudo docker compose up\n```\n\nThis runs onos and mininet in docker containers and links them.  \n\nFrom a new terminal, paste in the following curl commands to activate openflow and fwd in ONOS:\n\n```shell\ncurl --request POST \\\n--url http://localhost:8181/onos/v1/applications/org.onosproject.fwd/active \\\n--header 'Accept: application/json' \\\n--header 'Authorization: Basic b25vczpyb2Nrcw=='\n\ncurl --request POST \\\n--url http://localhost:8181/onos/v1/applications/org.onosproject.openflow/active \\\n--header 'Accept: application/json' \\\n--header 'Authorization: Basic b25vczpyb2Nrcw=='\n```\n\nThe calls should return output similar to this, indicating the activation was successful:\n\n```\n{\"name\":\"org.onosproject.fwd\",\"id\":78,\"version\":\"2.7.1.SNAPSHOT\",\"category\":\"Traffic Engineering\",\"description\":\"Provisions traffic between end-stations using hop-by-hop flow programming by intercepting packets for which there are currently no matching flow objectives on the data plane.\",\"readme\":\"Provisions traffic between end-stations using hop-by-hop flow programming by intercepting packets for which there are currently no matching flow objectives on the data plane. The paths paved in this manner are short-lived, i.e. they expire a few seconds after the flow on whose behalf they were programmed stops.\\\\n\\\\nThe application relies on the ONOS path service to compute the shortest paths. In the event of negative topology events (link loss, device disconnect, etc.), the application will proactively invalidate any paths that it had programmed to lead through the resources that are no longer available.\",\"origin\":\"ONOS Community\",\"url\":\"http://onosproject.org\",\"featuresRepo\":\"mvn:org.onosproject/onos-apps-fwd/2.7.1-SNAPSHOT/xml/features\",\"state\":\"ACTIVE\",\"features\":[\"onos-apps-fwd\"],\"permissions\":[],\"requiredApps\":[]}\n\n{\"name\":\"org.onosproject.openflow\",\"id\":46,\"version\":\"2.7.1.SNAPSHOT\",\"category\":\"Provider\",\"description\":\"Suite of the OpenFlow base providers bundled together with ARP\\\\/NDP host location provider and LLDP link provider.\",\"readme\":\"Suite of the OpenFlow base providers bundled together with ARP\\\\/NDP host location provider and LLDP link provider.\",\"origin\":\"ONOS Community\",\"url\":\"http://onosproject.org\",\"featuresRepo\":\"mvn:org.onosproject/onos-providers-openflow-app/2.7.1-SNAPSHOT/xml/features\",\"state\":\"ACTIVE\",\"features\":[\"onos-providers-openflow-app\"],\"permissions\":[],\"requiredApps\":[\"org.onosproject.hostprovider\",\"org.onosproject.lldpprovider\",\"org.onosproject.openflow-base\"]}\n```\n\nLaunch a terminal in the Mininet container:\n\n```shell\nsudo docker exec -it mininet-compose /bin/bash\n```\n\nStart a basic mininet topology with onos as the SDN controller:\n\n```shell\nmn --topo tree,2,2 --mac --switch ovs,protocols=OpenFlow14 --controller remote,ip=onos-compose\n```\n\nMininet should successfully connect to the ONOS controller, start the switches and hosts, and display the mininet CLI prompt:\n\n```shell\nroot@c0b74ca1c8a7:~# mn --topo tree,2,2 --mac --switch ovs,protocols=OpenFlow14   --controller remote,ip=onos-compose\n*** Error setting resource limits. Mininet's performance may be affected.\n*** Creating network\n*** Adding controller\nConnecting to remote controller at onos-compose:6653\n*** Adding hosts:\nh1 h2 h3 h4 \n*** Adding switches:\ns1 s2 s3 \n*** Adding links:\n(s1, s2) (s1, s3) (s2, h1) (s2, h2) (s3, h3) (s3, h4) \n*** Configuring hosts\nh1 h2 h3 h4 \n*** Starting controller\nc0 \n*** Starting 3 switches\ns1 s2 s3 ...\n*** Starting CLI:\nmininet\u003e \n```\n\nFrom the mininet CLI, run pingall and confirm that all hosts can communicate:\n```shell\nmininet\u003e pingall\n*** Ping: testing ping reachability\nh1 -\u003e h2 h3 h4 \nh2 -\u003e h1 h3 h4 \nh3 -\u003e h1 h2 h4 \nh4 -\u003e h1 h2 h3 \n*** Results: 0% dropped (12/12 received)\n```\n\nSwitch to an ubuntu terminal (not the mininet container) and paste in the following curl command to deactivate onos fwd:\n```shell\ncurl -X DELETE --header 'Accept: application/json' 'http://localhost:8181/onos/v1/applications/org.onosproject.fwd/active'\n```\n\nThis disables reactive forwarding in the onos controller, causing to to behave more like a firewall than a router.\n\nFrom the mininet CLI, run pingall again and confirm that the traffic is now being blocked:\n```shell\nmininet\u003e pingall\n*** Ping: testing ping reachability\nh1 -\u003e X X X \nh2 -\u003e X X X \nh3 -\u003e X X X \nh4 -\u003e X X X \n*** Results: 100% dropped (0/12 received)\n```\n\n### API Client Demonstration \n\n#### Hosts\n```shell\ngo run hosts-get-example.go\n```\n\nThere should be several hosts listed:\n```\n{[{00:00:00:00:00:03/None 00:00:00:00:00:03 None None 0x0000 false false [10.0.0.3] [{of:0000000000000003 1}]} {00:00:00:00:00:04/None 00:00:00:00:00:04 None None 0x0000 false false [10.0.0.4] [{of:0000000000000003 2}]} {00:00:00:00:00:01/None 00:00:00:00:00:01 None None 0x0000 false false [10.0.0.1] [{of:0000000000000002 1}]} {00:00:00:00:00:02/None 00:00:00:00:00:02 None None 0x0000 false false [10.0.0.2] [{of:0000000000000002 2}]}]}\n```\n\n#### Flows\n```shell\ngo run flows-get-example.go\n```\n\nThere should be flows representing connections between the hosts and switches:\n```\n{[{org.onosproject.core 1078 of:0000000000000003 0 281478170942982 true 1704298704107 3100 UNKNOWN 11 5 ADDED 0 0 0 {[{0x800  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 139000 of:0000000000000003 0 281476661728682 true 1704298704107 3100 UNKNOWN 1000 40000 ADDED 0 0 0 {[{0x88cc  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 924 of:0000000000000003 0 281477764386537 true 1704298704107 3100 UNKNOWN 22 40000 ADDED 0 0 0 {[{0x806  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 139000 of:0000000000000003 0 281476156249461 true 1704298704107 3100 UNKNOWN 1000 40000 ADDED 0 0 0 {[{0x8942  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 798 of:0000000000000001 0 281478909873038 true 1704298704186 3100 UNKNOWN 19 40000 ADDED 0 0 0 {[{0x806  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 278000 of:0000000000000001 0 281477466379610 true 1704298704186 3100 UNKNOWN 2000 40000 ADDED 0 0 0 {[{0x88cc  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 980 of:0000000000000001 0 281475012051420 true 1704298704186 3100 UNKNOWN 10 5 ADDED 0 0 0 {[{0x800  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 278000 of:0000000000000001 0 281477029321583 true 1704298704186 3100 UNKNOWN 2000 40000 ADDED 0 0 0 {[{0x8942  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 882 of:0000000000000002 0 281478316350853 true 1704298704106 3100 UNKNOWN 21 40000 ADDED 0 0 0 {[{0x806  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 139000 of:0000000000000002 0 281478673389323 true 1704298704107 3100 UNKNOWN 1000 40000 ADDED 0 0 0 {[{0x8942  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 139000 of:0000000000000002 0 281475022575828 true 1704298704107 3100 UNKNOWN 1000 40000 ADDED 0 0 0 {[{0x88cc  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}} {org.onosproject.core 1078 of:0000000000000002 0 281475568191580 true 1704298704107 3100 UNKNOWN 11 5 ADDED 0 0 0 {[{0x800  0 ETH_TYPE}]} {true [] [{CONTROLLER OUTPUT}]}}]}\n```\n\nIf you do not see any flows, run pingall from the mininet terminal to refresh the flows table and try again.\n\n#### Intents\n```shell\ngo run intents-get-example.go\n```\n\nThere should not be any intents listed since none have been created:\n```\n{[]}\n```\n\n##### Create an Intent\n```shell\ngo run intent-create-example.go\n```\n\nThis creates an intent that allows h1 and h2 to communicate.\n```\n{\n    Type:  \"HostToHostIntent\",\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n    One:   \"00:00:00:00:00:01/None\",\n    Two:   \"00:00:00:00:00:02/None\",\n}\n```\n\nThe new intent should be returned from ONOS:\n```\n{org.onosproject.cli 0xa 0x300009 INSTALLED HostToHostIntent [00:00:00:00:00:01/None 00:00:00:00:00:02/None] 0xc0000124b0 0xc000068580 100 [{false [OPTICAL] LinkTypeConstraint}] 00:00:00:00:00:01/None 00:00:00:00:00:02/None}\n```\n\n**Note: if the \"One\" and \"Two\" strings do not match any hosts from your hosts output above, the intent may fail to install. Edit the struct in intent-create-example.go to match two of the hosts in your environment.**\n\nFrom the mininet CLI, test connectivity again and confirm that the traffic between h1 and h2 is now allowed:\n```shell\nmininet\u003e h1 ping -c 4 h2\nPING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.\n64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.147 ms\n64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.038 ms\n64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.039 ms\n64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=0.038 ms\n\n--- 10.0.0.2 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3058ms\nrtt min/avg/max/mdev = 0.038/0.065/0.147/0.047 ms\n```\n\nConfirm that traffic not allowed by the intent is still blocked:\n```shell\nmininet\u003e h1 ping -c 4 h3\nPING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.\n\n--- 10.0.0.3 ping statistics ---\n4 packets transmitted, 0 received, 100% packet loss, time 3079ms\n```\n\n#### Get a specific Inent\n```shell\ngo run intent-get-example.go\n```\n\nThis looks up an intent with the following AppID and Key, and returns the details:\n```\n{\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n}\n```\n\nThe intent details should be returned from ONOS:\n```\n{org.onosproject.cli 0xa 0x300009 INSTALLED HostToHostIntent [00:00:00:00:00:01/None 00:00:00:00:00:02/None] 0xc0000124b0 0xc000068580 100 [{false [OPTICAL] LinkTypeConstraint}] 00:00:00:00:00:01/None 00:00:00:00:00:02/None}\n```\n\n#### Update the intent\n```shell\ngo run intent-update-example.go\n```\n\nThis updates the intent to allow h1 and h3 to communicate.\n```\n{\n    Type:  \"HostToHostIntent\",\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n    One:   \"00:00:00:00:00:01/None\",\n    Two:   \"00:00:00:00:00:03/None\",\n}\n```\n**Note: if the \"One\" and \"Two\" strings do not match any hosts from your hosts output above, edit the struct in intent-create-example.go.**\n\nFrom the mininet CLI, test connectivity again and confirm that the traffic between h1 and h2 is now blocked:\n```shell\nmininet\u003e h1 ping -c 4 h2\nPING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.\nFrom 10.0.0.1 icmp_seq=1 Destination Host Unreachable\nFrom 10.0.0.1 icmp_seq=2 Destination Host Unreachable\nFrom 10.0.0.1 icmp_seq=3 Destination Host Unreachable\nFrom 10.0.0.1 icmp_seq=4 Destination Host Unreachable\n\n--- 10.0.0.2 ping statistics ---\n4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3069ms\npipe 4\n```\n\nConfirm that traffic from h1 to h3 is now allowed:\n```shell\nmininet\u003e h1 ping -c 4 h3\nPING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.\n64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=0.512 ms\n64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.075 ms\n64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.042 ms\n64 bytes from 10.0.0.3: icmp_seq=4 ttl=64 time=0.044 ms\n\n--- 10.0.0.3 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3059ms\nrtt min/avg/max/mdev = 0.042/0.168/0.512/0.198 ms\n```\n\n#### Delete the intent\n```shell\ngo run intent-delete-example.go\n```\n\nThis looks up an intent with the following AppID and Key, and removes it:\n```\n{\n    AppID: \"org.onosproject.cli\",\n    Key:   \"0x300009\",\n}\n```\nRe-run intents-get-example.go or intent-get-example and confirm that the intent is no longer there.\n\n## Testing \u0026 CI/CD\n\n### Lint Tests\nLinting is performed using golangci-lint with a variety of best-practive linters configured in .golangci.toml. Lint tests are run automatically as part of the CI/CD pipeline in GitHub Actions and GitLab CI. \n\n### Unit Tests \nUnit tests have been created for each function using sample json output saved in the testdata directory. The test data can also be useful as an example of expected output from each API call.\n\nThe Unit Test are run automatically using GitHub Actions and Gitlab CI.\n\n```shell\nonos-client-go$ go test -v ./...\n=== RUN   TestParseHosts_CorrectJSON\n=== RUN   TestParseHosts_CorrectJSON/00:00:00:00:00:03/None\n    hosts_test.go:102: ID Passed with Value: 00:00:00:00:00:03/None\n    hosts_test.go:107: Mac Passed with Value: 00:00:00:00:00:03\n    hosts_test.go:112: Vlan Passed with Value: None\n    hosts_test.go:117: InnerVlan Passed with Value: None\n    hosts_test.go:122: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:127: Configured Passed with Value: false\n    hosts_test.go:132: Suspended Passed with Value: false\n    hosts_test.go:137: IPAddresses Passed with Value: [\"10.0.0.3\"]\n    hosts_test.go:142: Locations Passed with Value: [{\"of:0000000000000003\" \"1\"}]\n=== RUN   TestParseHosts_CorrectJSON/00:00:00:00:00:04/None\n    hosts_test.go:102: ID Passed with Value: 00:00:00:00:00:04/None\n    hosts_test.go:107: Mac Passed with Value: 00:00:00:00:00:04\n    hosts_test.go:112: Vlan Passed with Value: None\n    hosts_test.go:117: InnerVlan Passed with Value: None\n    hosts_test.go:122: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:127: Configured Passed with Value: false\n    hosts_test.go:132: Suspended Passed with Value: false\n    hosts_test.go:137: IPAddresses Passed with Value: [\"10.0.0.4\"]\n    hosts_test.go:142: Locations Passed with Value: [{\"of:0000000000000003\" \"2\"}]\n=== RUN   TestParseHosts_CorrectJSON/00:00:00:00:00:01/None\n    hosts_test.go:102: ID Passed with Value: 00:00:00:00:00:01/None\n    hosts_test.go:107: Mac Passed with Value: 00:00:00:00:00:01\n    hosts_test.go:112: Vlan Passed with Value: None\n    hosts_test.go:117: InnerVlan Passed with Value: None\n    hosts_test.go:122: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:127: Configured Passed with Value: false\n    hosts_test.go:132: Suspended Passed with Value: false\n    hosts_test.go:137: IPAddresses Passed with Value: [\"10.0.0.1\"]\n    hosts_test.go:142: Locations Passed with Value: [{\"of:0000000000000002\" \"1\"}]\n=== RUN   TestParseHosts_CorrectJSON/00:00:00:00:00:02/None\n    hosts_test.go:102: ID Passed with Value: 00:00:00:00:00:02/None\n    hosts_test.go:107: Mac Passed with Value: 00:00:00:00:00:02\n    hosts_test.go:112: Vlan Passed with Value: None\n    hosts_test.go:117: InnerVlan Passed with Value: None\n    hosts_test.go:122: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:127: Configured Passed with Value: false\n    hosts_test.go:132: Suspended Passed with Value: false\n    hosts_test.go:137: IPAddresses Passed with Value: [\"10.0.0.2\"]\n    hosts_test.go:142: Locations Passed with Value: [{\"of:0000000000000002\" \"2\"}]\n--- PASS: TestParseHosts_CorrectJSON (0.00s)\n    --- PASS: TestParseHosts_CorrectJSON/00:00:00:00:00:03/None (0.00s)\n    --- PASS: TestParseHosts_CorrectJSON/00:00:00:00:00:04/None (0.00s)\n    --- PASS: TestParseHosts_CorrectJSON/00:00:00:00:00:01/None (0.00s)\n    --- PASS: TestParseHosts_CorrectJSON/00:00:00:00:00:02/None (0.00s)\n=== RUN   TestParseHosts_ErrOnEmpty\n--- PASS: TestParseHosts_ErrOnEmpty (0.00s)\n=== RUN   TestGetHosts_ReturnExpectedJSON\n=== RUN   TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:03/None\n    hosts_test.go:249: ID Passed with Value: 00:00:00:00:00:03/None\n    hosts_test.go:254: Mac Passed with Value: 00:00:00:00:00:03\n    hosts_test.go:259: Vlan Passed with Value: None\n    hosts_test.go:264: InnerVlan Passed with Value: None\n    hosts_test.go:269: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:274: Configured Passed with Value: false\n    hosts_test.go:279: Suspended Passed with Value: false\n    hosts_test.go:284: IPAddresses Passed with Value: [\"10.0.0.3\"]\n    hosts_test.go:289: Locations Passed with Value: [{\"of:0000000000000003\" \"1\"}]\n=== RUN   TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:04/None\n    hosts_test.go:249: ID Passed with Value: 00:00:00:00:00:04/None\n    hosts_test.go:254: Mac Passed with Value: 00:00:00:00:00:04\n    hosts_test.go:259: Vlan Passed with Value: None\n    hosts_test.go:264: InnerVlan Passed with Value: None\n    hosts_test.go:269: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:274: Configured Passed with Value: false\n    hosts_test.go:279: Suspended Passed with Value: false\n    hosts_test.go:284: IPAddresses Passed with Value: [\"10.0.0.4\"]\n    hosts_test.go:289: Locations Passed with Value: [{\"of:0000000000000003\" \"2\"}]\n=== RUN   TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:01/None\n    hosts_test.go:249: ID Passed with Value: 00:00:00:00:00:01/None\n    hosts_test.go:254: Mac Passed with Value: 00:00:00:00:00:01\n    hosts_test.go:259: Vlan Passed with Value: None\n    hosts_test.go:264: InnerVlan Passed with Value: None\n    hosts_test.go:269: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:274: Configured Passed with Value: false\n    hosts_test.go:279: Suspended Passed with Value: false\n    hosts_test.go:284: IPAddresses Passed with Value: [\"10.0.0.1\"]\n    hosts_test.go:289: Locations Passed with Value: [{\"of:0000000000000002\" \"1\"}]\n=== RUN   TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:02/None\n    hosts_test.go:249: ID Passed with Value: 00:00:00:00:00:02/None\n    hosts_test.go:254: Mac Passed with Value: 00:00:00:00:00:02\n    hosts_test.go:259: Vlan Passed with Value: None\n    hosts_test.go:264: InnerVlan Passed with Value: None\n    hosts_test.go:269: OuterTpid Passed with Value: 0x0000\n    hosts_test.go:274: Configured Passed with Value: false\n    hosts_test.go:279: Suspended Passed with Value: false\n    hosts_test.go:284: IPAddresses Passed with Value: [\"10.0.0.2\"]\n    hosts_test.go:289: Locations Passed with Value: [{\"of:0000000000000002\" \"2\"}]\n--- PASS: TestGetHosts_ReturnExpectedJSON (0.01s)\n    --- PASS: TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:03/None (0.00s)\n    --- PASS: TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:04/None (0.00s)\n    --- PASS: TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:01/None (0.00s)\n    --- PASS: TestGetHosts_ReturnExpectedJSON/00:00:00:00:00:02/None (0.00s)\n=== RUN   TestParseIntent_CorrectJSON\n=== RUN   TestParseIntent_CorrectJSON/0x100005\n    intents_test.go:75: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:80: ID Passed with Value: 0x300154\n    intents_test.go:85: Key Passed with Value: 0x100005\n    intents_test.go:90: State Passed with Value: FAILED\n    intents_test.go:95: Type Passed with Value: HostToHostIntent\n    intents_test.go:100: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n    intents_test.go:105: AppID Passed with Value: 100\n    intents_test.go:110: One Passed with Value: 00:00:00:00:00:01/None\n    intents_test.go:115: Two Passed with Value: 00:00:00:00:00:99/None\n--- PASS: TestParseIntent_CorrectJSON (0.00s)\n    --- PASS: TestParseIntent_CorrectJSON/0x100005 (0.00s)\n=== RUN   TestParseIntent_ErrOnEmpty\n--- PASS: TestParseIntent_ErrOnEmpty (0.00s)\n=== RUN   TestParseIntents_CorrectJSON\n=== RUN   TestParseIntents_CorrectJSON/0x100005\n    intents_test.go:181: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:186: ID Passed with Value: 0x40004f\n    intents_test.go:191: Key Passed with Value: 0x100005\n    intents_test.go:196: State Passed with Value: INSTALLED\n    intents_test.go:201: Type Passed with Value: HostToHostIntent\n    intents_test.go:206: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:02/None\"]\n=== RUN   TestParseIntents_CorrectJSON/0x300009\n    intents_test.go:181: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:186: ID Passed with Value: 0x40004d\n    intents_test.go:191: Key Passed with Value: 0x300009\n    intents_test.go:196: State Passed with Value: FAILED\n    intents_test.go:201: Type Passed with Value: HostToHostIntent\n    intents_test.go:206: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n=== RUN   TestParseIntents_CorrectJSON/0x100006\n    intents_test.go:181: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:186: ID Passed with Value: 0x40004e\n    intents_test.go:191: Key Passed with Value: 0x100006\n    intents_test.go:196: State Passed with Value: FAILED\n    intents_test.go:201: Type Passed with Value: HostToHostIntent\n    intents_test.go:206: Resources Passed with Value: [\"00:00:00:00:00:02/None\" \"00:00:00:00:00:88/None\"]\n--- PASS: TestParseIntents_CorrectJSON (0.00s)\n    --- PASS: TestParseIntents_CorrectJSON/0x100005 (0.00s)\n    --- PASS: TestParseIntents_CorrectJSON/0x300009 (0.00s)\n    --- PASS: TestParseIntents_CorrectJSON/0x100006 (0.00s)\n=== RUN   TestParseIntents_ErrOnEmpty\n--- PASS: TestParseIntents_ErrOnEmpty (0.00s)\n=== RUN   TestGetIntent_InvalidIntent\n--- PASS: TestGetIntent_InvalidIntent (0.00s)\n=== RUN   TestCreateIntent_InvalidIntent\n--- PASS: TestCreateIntent_InvalidIntent (0.00s)\n=== RUN   TestUpdateIntent_InvalidIntent\n--- PASS: TestUpdateIntent_InvalidIntent (0.00s)\n=== RUN   TestDeleteIntent_InvalidIntent\n--- PASS: TestDeleteIntent_InvalidIntent (0.00s)\n=== RUN   TestGetIntent_ReturnExpectedJSON\n    intents_test.go:431: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:436: ID Passed with Value: 0x300154\n    intents_test.go:441: Key Passed with Value: 0x100005\n    intents_test.go:446: State Passed with Value: FAILED\n    intents_test.go:451: Type Passed with Value: HostToHostIntent\n    intents_test.go:456: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n    intents_test.go:461: AppID Passed with Value: 100\n    intents_test.go:466: One Passed with Value: 00:00:00:00:00:01/None\n    intents_test.go:471: Two Passed with Value: 00:00:00:00:00:99/None\n--- PASS: TestGetIntent_ReturnExpectedJSON (0.00s)\n=== RUN   TestGetIntents_ReturnExpectedJSON\n=== RUN   TestGetIntents_ReturnExpectedJSON/0x100005\n    intents_test.go:531: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:536: ID Passed with Value: 0x40004f\n    intents_test.go:541: Key Passed with Value: 0x100005\n    intents_test.go:546: State Passed with Value: INSTALLED\n    intents_test.go:551: Type Passed with Value: HostToHostIntent\n    intents_test.go:556: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:02/None\"]\n=== RUN   TestGetIntents_ReturnExpectedJSON/0x300009\n    intents_test.go:531: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:536: ID Passed with Value: 0x40004d\n    intents_test.go:541: Key Passed with Value: 0x300009\n    intents_test.go:546: State Passed with Value: FAILED\n    intents_test.go:551: Type Passed with Value: HostToHostIntent\n    intents_test.go:556: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n=== RUN   TestGetIntents_ReturnExpectedJSON/0x100006\n    intents_test.go:531: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:536: ID Passed with Value: 0x40004e\n    intents_test.go:541: Key Passed with Value: 0x100006\n    intents_test.go:546: State Passed with Value: FAILED\n    intents_test.go:551: Type Passed with Value: HostToHostIntent\n    intents_test.go:556: Resources Passed with Value: [\"00:00:00:00:00:02/None\" \"00:00:00:00:00:88/None\"]\n--- PASS: TestGetIntents_ReturnExpectedJSON (0.00s)\n    --- PASS: TestGetIntents_ReturnExpectedJSON/0x100005 (0.00s)\n    --- PASS: TestGetIntents_ReturnExpectedJSON/0x300009 (0.00s)\n    --- PASS: TestGetIntents_ReturnExpectedJSON/0x100006 (0.00s)\n=== RUN   TestCreateIntent_ReturnExpectedJSON\n    intents_test.go:611: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:616: ID Passed with Value: 0x300154\n    intents_test.go:621: Key Passed with Value: 0x100005\n    intents_test.go:626: State Passed with Value: FAILED\n    intents_test.go:631: Type Passed with Value: HostToHostIntent\n    intents_test.go:636: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n    intents_test.go:641: AppID Passed with Value: 100\n    intents_test.go:646: One Passed with Value: 00:00:00:00:00:01/None\n    intents_test.go:651: Two Passed with Value: 00:00:00:00:00:99/None\n--- PASS: TestCreateIntent_ReturnExpectedJSON (0.00s)\n=== RUN   TestUpdateIntent_ReturnExpectedJSON\n    intents_test.go:698: AppID Passed with Value: org.onosproject.cli\n    intents_test.go:703: ID Passed with Value: 0x300154\n    intents_test.go:708: Key Passed with Value: 0x100005\n    intents_test.go:713: State Passed with Value: FAILED\n    intents_test.go:718: Type Passed with Value: HostToHostIntent\n    intents_test.go:723: Resources Passed with Value: [\"00:00:00:00:00:01/None\" \"00:00:00:00:00:99/None\"]\n    intents_test.go:728: AppID Passed with Value: 100\n    intents_test.go:733: One Passed with Value: 00:00:00:00:00:01/None\n    intents_test.go:738: Two Passed with Value: 00:00:00:00:00:99/None\n--- PASS: TestUpdateIntent_ReturnExpectedJSON (0.00s)\nPASS\nok      github.com/ctjnkns/onos-client-go       0.030s\n```\n\n\n### Integration Tests\nIntegration tests can be ran manually using docker containers as described in this readme. Adding integration tests to the CI/CD pipelines is in progress but presents some unique challenges due to the need to run the mininet containr in privileged mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctjnkns%2Fonos-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctjnkns%2Fonos-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctjnkns%2Fonos-client-go/lists"}