diff --git a/.gitignore b/.gitignore index 66fd13c..b71d102 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ # Dependency directories (remove the comment below to include it) # vendor/ + +.vscode/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3e7b99b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: go +go: +- "1.13" + +before_script: +- go get golang.org/x/tools/cmd/cover +- go get github.com/mattn/goveralls + +script: +- go test -covermode=count -coverprofile=profile.cov ./... +- go vet ./... +- go test ./... -race +- goveralls -coverprofile=profile.cov -service=travis-ci diff --git a/README.md b/README.md index 915c3b3..072fba3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # switch-monitoring Go service to monitor the M-Lab switches for changes from the expected configuration. + +| branch | travis-ci | coveralls | docs | report card | +|--------|-----------|-----------|------|-------------| +| master | [![Travis Build Status](https://travis-ci.org/m-lab/switch-monitoring.svg?branch=master)](https://travis-ci.org/m-lab/switch-monitoring) | [![Coverage Status](https://coveralls.io/repos/m-lab/switch-monitoring/badge.svg?branch=master)](https://coveralls.io/github/m-lab/switch-monitoring?branch=master) | [![GoDoc](https://godoc.org/github.com/m-lab/switch-monitoring?status.svg)](https://godoc.org/github.com/m-lab/switch-monitoring) | [![Go Report Card](https://goreportcard.com/badge/github.com/m-lab/switch-monitoring)](https://goreportcard.com/report/github.com/m-lab/switch-monitoring) diff --git a/cmd/switch-monitoring/main.go b/cmd/switch-monitoring/main.go new file mode 100644 index 0000000..9831a4e --- /dev/null +++ b/cmd/switch-monitoring/main.go @@ -0,0 +1,119 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "net/http" + "os" + "time" + + "github.com/apex/log" + "github.com/apex/log/handlers/text" + "github.com/scottdware/go-junos" + + "github.com/m-lab/go/flagx" + "github.com/m-lab/go/rtx" + "github.com/m-lab/switch-monitoring/internal" + "github.com/m-lab/switch-monitoring/internal/netconf" + "github.com/m-lab/switch-monitoring/internal/siteinfo" +) + +const ( + defaultProjectID = "mlab-oti" + switchHostFormat = "s1.%s.measurement-lab.org" + httpClientTimeout = time.Second * 15 +) + +var ( + flagProject = flag.String("project", defaultProjectID, + "Use a specific GCP Project ID.") + flagPrivateKey = flag.String("key", "", + "Path to the SSH private key to use.") + flagPassphrase = flag.String("pass", "", + "Passphrase to decrypt the private key. Can be omitted.") + flagDebug = flag.Bool("debug", true, "Show debug messages.") + + osExit = os.Exit + newNetconf = func(auth *junos.AuthMethod) internal.NetconfClient { + return netconf.New(auth) + } + + httpClient = func(timeout time.Duration) internal.HTTPProvider { + return &http.Client{ + Timeout: timeout, + } + } +) + +func main() { + flag.Parse() + + if *flagDebug { + log.SetLevel(log.DebugLevel) + } + log.SetHandler(text.New(os.Stdout)) + + rtx.Must(flagx.ArgsFromEnv(flag.CommandLine), "Cannot parse env args") + + // A private key must be provided. + if *flagPrivateKey == "" { + log.Error("The SSH private key must be provided.") + osExit(1) + } + + // Initialize Siteinfo provider and the NETCONF client. + auth := &junos.AuthMethod{ + Username: "root", + PrivateKey: *flagPrivateKey, + Passphrase: *flagPassphrase, + } + c := newNetconf(auth) + + // Get switches list. + log.Infof("Fetching switch list for project %s", *flagProject) + _, err := switches(*flagProject) + rtx.Must(err, "Cannot fetch the switch list") + + // TODO: loop over the switches list. + // This is just an example of the intended usage. + hash, err := c.GetConfig("s1.lga0t.measurement-lab.org") + if err != nil { + log.WithFields(log.Fields{ + "hostname": "s1.lga0t.measurement-lab.org", + }).WithError(err).Error("Connection failed") + } + + log.Info(hash) +} + +// switches downloads the switches.json file from siteinfo and generates a +// list of valid switch hostnames. +func switches(projectID string) ([]string, error) { + var switches map[string]interface{} + + client := siteinfo.New(projectID, httpClient(httpClientTimeout)) + switchesJSON, err := client.Switches() + if err != nil { + return nil, err + } + + err = json.Unmarshal(switchesJSON, &switches) + if err != nil { + return nil, err + } + + if len(switches) == 0 { + return nil, fmt.Errorf("the retrieved switches list is empty") + } + + hosts := make([]string, len(switches)) + + i := 0 + for k := range switches { + hosts[i] = fmt.Sprintf(switchHostFormat, k) + i++ + } + + return hosts, nil +} diff --git a/cmd/switch-monitoring/main_test.go b/cmd/switch-monitoring/main_test.go new file mode 100644 index 0000000..a11d485 --- /dev/null +++ b/cmd/switch-monitoring/main_test.go @@ -0,0 +1,168 @@ +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "net/http" + "os" + "testing" + "time" + + "github.com/m-lab/go/osx" + "github.com/m-lab/switch-monitoring/internal" + "github.com/scottdware/go-junos" + "github.com/stretchr/testify/assert" +) + +// +// Mocks used in the subsequent unit tests. +// + +type mockNetconf struct { + // How many times GetConfigHash has been called. + getConfigCalled int + mustFail bool +} + +func (n *mockNetconf) GetConfig(hostname string, section ...string) (string, error) { + n.getConfigCalled++ + if n.mustFail { + return "", fmt.Errorf("error") + } + return "not implemented", nil +} + +type mockHTTPProvider struct { + // How many times Get has been called. + getCalled int + mustFail bool + responseBody string +} + +func (prov *mockHTTPProvider) Get(string) (*http.Response, error) { + prov.getCalled++ + if prov.mustFail { + return nil, fmt.Errorf("error") + } + return &http.Response{ + Body: ioutil.NopCloser(bytes.NewBufferString(prov.responseBody)), + StatusCode: http.StatusOK, + }, nil +} + +// +// Tests. +// + +func Test_main(t *testing.T) { + assert := assert.New(t) + netconf := &mockNetconf{} + siteinfo := &mockHTTPProvider{ + responseBody: `{"abc01": {}}`, + } + + oldNewNetconf := newNetconf + newNetconf = func(auth *junos.AuthMethod) internal.NetconfClient { + return netconf + } + + oldHTTPClient := httpClient + httpClient = func(timeout time.Duration) internal.HTTPProvider { + return siteinfo + } + + // Replace osExit so that tests don't stop running. + osExit = func(code int) { + if code != 1 { + t.Fatalf("Expected a 1 exit code, got %d.", code) + } + + panic("os.Exit called") + } + + defer func() { + osExit = os.Exit + }() + + // If no SSH key is provided, main() shoud fail. + assert.PanicsWithValue("os.Exit called", main, + "os.Exit was not called") + + restore := osx.MustSetenv("KEY", "/path/to/key") + + main() + if netconf.getConfigCalled == 0 { + t.Errorf("GetConfig() has not been called.") + } + + if siteinfo.getCalled == 0 { + t.Errorf("Get() has not been called.") + } + + // Make GetConfig() fail. + netconf.mustFail = true + main() + netconf.mustFail = false + + restore() + newNetconf = oldNewNetconf + httpClient = oldHTTPClient + +} + +func Test_newNetconf(t *testing.T) { + netconf := newNetconf(&junos.AuthMethod{}) + if netconf == nil { + t.Errorf("newNetconf() returned nil.") + } +} + +func Test_httpClient(t *testing.T) { + client := httpClient(0) + if client == nil { + t.Errorf("httpClient() returned nil.") + } +} + +func Test_switches(t *testing.T) { + siteinfo := &mockHTTPProvider{} + + oldHTTPClient := httpClient + httpClient = func(timeout time.Duration) internal.HTTPProvider { + return siteinfo + } + + siteinfo.responseBody = `{"abc01": {}}` + res, err := switches("test") + if err != nil { + t.Errorf("switches() returned err: %v", err) + } + if len(res) != 1 { + t.Errorf("switches(): expected one string, found %v", len(res)) + } + + // Get() fails. + siteinfo.mustFail = true + res, err = switches("test") + if err == nil { + t.Errorf("switches(): expected err, got nil.") + } + siteinfo.mustFail = false + + // No content. + siteinfo.responseBody = `` + res, err = switches("test") + if err == nil { + t.Errorf("switches(): expected err, got nil.") + } + + // JSON is an empty object. + siteinfo.responseBody = `{}` + res, err = switches("test") + if err == nil { + t.Errorf("switches(): expected err, got nil.") + } + + httpClient = oldHTTPClient +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..20dd998 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/m-lab/switch-monitoring + +go 1.13 + +require ( + github.com/apex/log v1.1.2 + github.com/m-lab/go v1.2.2 + github.com/scottdware/go-junos v0.0.0-20191101184514-da1ec4631b03 + github.com/stretchr/testify v1.4.0 + google.golang.org/api v0.15.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..425a617 --- /dev/null +++ b/go.sum @@ -0,0 +1,312 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Juniper/go-netconf v0.1.1 h1:5fx/T7L2Fwq51UnESPOP1CXgGCs7IYxR/pnyC5quu/k= +github.com/Juniper/go-netconf v0.1.1/go.mod h1:2Fy6tQTWnL//D/Ll1hb0RYXN4jndcTyneRn6xj5E1VE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apex/log v1.1.2 h1:bnDuVoi+o98wOdVqfEzNDlY0tcmBia7r4YkjS9EqGYk= +github.com/apex/log v1.1.2/go.mod h1:SyfRweFO+TlkIJ3DVizTSeI1xk7jOIIqOnUPZQTTsww= +github.com/apex/logs v0.0.3/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= +github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= +github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= +github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195 h1:c4mLfegoDw6OhSJXTd2jUEQgZUQuJWtocudb97Qn9EM= +github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI= +github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= +github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20191008195207-8e1d251e947d/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3/go.mod h1:BYpt4ufZiIGv2nXn4gMxnfKV306n3mWXgNu/d2TqdTU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/m-lab/go v1.2.2 h1:x9e7P08ZpdcxVOpHbgw9NFjIds2pqYJtsaiDXYaN4fM= +github.com/m-lab/go v1.2.2/go.mod h1:f22d1CtoFIho8yt0wPNYo0Lx5h8YfgRW4+1pzQTeQRw= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/prometheus v2.5.0+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= +github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/scottdware/go-junos v0.0.0-20191101184514-da1ec4631b03 h1:/j89wNUnNLvazyjcEcP7FfSXHNRxt/7q1nrVhNHwUg8= +github.com/scottdware/go-junos v0.0.0-20191101184514-da1ec4631b03/go.mod h1:HyXZ8sqZbS3YOTwqstgK9EQ2OGkTcPOg84RZKVUGJhQ= +github.com/scottdware/go-rested v0.0.0-20160313143639-93e152ef32a6 h1:299Uob4OQNsj4PcX5Lz0zrEUA3QJQR7cUb0QGKOCCMA= +github.com/scottdware/go-rested v0.0.0-20160313143639-93e152ef32a6/go.mod h1:Pb2bmyrwODgla27iei9cFCcCyVCly15wW4rLEbd0RdM= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= +github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= +github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= +github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= +github.com/ziutek/telnet v0.0.0-20180329124119-c3b780dc415b h1:VfPXB/wCGGt590QhD1bOpv2J/AmC/RJNTg/Q59HKSB0= +github.com/ziutek/telnet v0.0.0-20180329124119-c3b780dc415b/go.mod h1:IZpXDfkJ6tWD3PhBK5YzgQT+xJWh7OsdwiG8hA2MkO4= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/internal/interfaces.go b/internal/interfaces.go new file mode 100644 index 0000000..b9d08f5 --- /dev/null +++ b/internal/interfaces.go @@ -0,0 +1,18 @@ +package internal + +import ( + "net/http" +) + +// This file defines interfaces to allow for object mocking in unit tests. + +// NetconfClient is a generic NETCONF client. +type NetconfClient interface { + GetConfig(hostname string, section ...string) (string, error) +} + +// HTTPProvider is a data provider returning HTTP responses. +// http.Client satisfies this interface. +type HTTPProvider interface { + Get(string) (*http.Response, error) +} diff --git a/internal/netconf/client.go b/internal/netconf/client.go new file mode 100644 index 0000000..a0fb292 --- /dev/null +++ b/internal/netconf/client.go @@ -0,0 +1,54 @@ +package netconf + +import ( + "regexp" + "strings" + + "github.com/scottdware/go-junos" +) + +// Client is a client to get the switch configuration using the +// NETCONF protocol. +type Client struct { + auth *junos.AuthMethod + connector connector +} + +// New returns a new NetconfClient. +func New(auth *junos.AuthMethod) Client { + return Client{ + auth: auth, + connector: junosConnector{}, + } +} + +// GetConfig connects to a switch, gets one or more sections via NETCONF, +// removes any comment lines at the beginning, trims whitespace and the +// beginning/end, replaces any encrypted password with "dummy" and returns +// what is left. +// +// The section can be an empty string. In that case, the whole configuration +// will be read. +func (c Client) GetConfig(hostname string, section ...string) (string, error) { + jnpr, err := c.connector.NewSession(hostname, c.auth) + if err != nil { + return "", err + } + + config, err := jnpr.GetConfig("text", section...) + if err != nil { + return "", err + } + + // Remove comments (lines starting with '#') and trim the result. + re := regexp.MustCompile("(?m)^#.*$") + config = strings.TrimSpace(re.ReplaceAllString(config, "")) + + // Replace all password fields with "dummy". + // TODO: once we start pre-configuring the switch with a random password, + // we can remove this step so that the actual passwords are compared. + re = regexp.MustCompile("encrypted-password.+") + config = re.ReplaceAllString(config, "encrypted-password \"dummy\";") + + return config, nil +} diff --git a/internal/netconf/client_test.go b/internal/netconf/client_test.go new file mode 100644 index 0000000..e2a6539 --- /dev/null +++ b/internal/netconf/client_test.go @@ -0,0 +1,87 @@ +package netconf + +import ( + "fmt" + "io/ioutil" + "strings" + "testing" + + "github.com/scottdware/go-junos" +) + +type mockConnector struct { + mustFail bool + mustFailConn bool +} + +func (c mockConnector) NewSession(string, *junos.AuthMethod) (connection, error) { + if c.mustFail { + return nil, fmt.Errorf("error") + } + return &mockConnection{ + mustFail: c.mustFailConn, + }, nil +} + +type mockConnection struct { + mustFail bool +} + +func (c mockConnection) GetConfig(string, ...string) (string, error) { + if c.mustFail { + return "", fmt.Errorf("error") + } + + // Read test file. + testfile, err := ioutil.ReadFile("testdata/abc01_qfx5100.conf") + if err != nil { + return "", err + } + return string(testfile), nil +} + +func TestNew(t *testing.T) { + auth := &junos.AuthMethod{} + netconf := New(auth) + if netconf.auth != auth { + t.Errorf("New() didn't return the expected struct.") + } +} + +func TestClient_GetConfigHash(t *testing.T) { + mockConnector := &mockConnector{} + netconf := &Client{ + auth: &junos.AuthMethod{}, + connector: mockConnector, + } + + res, err := netconf.GetConfig("test") + if err != nil { + t.Errorf("GetConfig(): expected nil, got %v", err) + } + + // Check the content has been cleaned as expected. + if strings.HasPrefix(res, "#") { + t.Errorf("GetConfig(): comments have not been removed.") + } + + if !strings.HasPrefix(res, "version") { + t.Errorf("GetConfig(): config does not begin with 'version'") + } + + // Let the connector fail. + mockConnector.mustFail = true + _, err = netconf.GetConfig("test") + if err == nil { + t.Errorf("GetConfig(): expected err, got nil.") + } + mockConnector.mustFail = false + + // Let connection.GetConfig() fail. + mockConnector.mustFailConn = true + _, err = netconf.GetConfig("test") + if err == nil { + t.Errorf("GetConfig(): expected err, got nil.") + } + +} diff --git a/internal/netconf/connector.go b/internal/netconf/connector.go new file mode 100644 index 0000000..62c79ed --- /dev/null +++ b/internal/netconf/connector.go @@ -0,0 +1,20 @@ +package netconf + +import "github.com/scottdware/go-junos" + +// These types provide an abstraction for the underlying connector and +// connection to a NETCONF-enabled device, so that they can be unit tested. + +type connection interface { + GetConfig(string, ...string) (string, error) +} + +type connector interface { + NewSession(string, *junos.AuthMethod) (connection, error) +} + +type junosConnector struct{} + +func (junosConnector) NewSession(host string, auth *junos.AuthMethod) (connection, error) { + return junos.NewSession(host, auth) +} diff --git a/internal/netconf/connector_test.go b/internal/netconf/connector_test.go new file mode 100644 index 0000000..e8c3ddb --- /dev/null +++ b/internal/netconf/connector_test.go @@ -0,0 +1,16 @@ +package netconf + +import ( + "testing" + + "github.com/scottdware/go-junos" +) + +func Test_junosConnector_NewSession(t *testing.T) { + // Let NewSession fail due to an empty AuthMethod. + j := &junosConnector{} + _, err := j.NewSession("", &junos.AuthMethod{}) + if err == nil { + t.Errorf("NewSession(): expected err, got nil.") + } +} diff --git a/internal/netconf/testdata/abc01_qfx5100.conf b/internal/netconf/testdata/abc01_qfx5100.conf new file mode 100644 index 0000000..6df0081 --- /dev/null +++ b/internal/netconf/testdata/abc01_qfx5100.conf @@ -0,0 +1,326 @@ +## Last changed: 2020-03-18 17:21:20 UTC +## Image name: qfx-18.1R3.3.tar.gz + +version 18.1R3.3; +system { + host-name s1.lga0t.measurement-lab.org; + root-authentication { + encrypted-password "foobar"; ## SECRET-DATA + } + name-server { + 8.8.8.8; + 8.8.4.4; + } + login { + class rancid { + permissions [ view view-configuration ]; + } + user rancid { + full-name rancid; + uid 2000; + class rancid; + authentication { + encrypted-password "foobar"; ## SECRET-DATA + } + } + } + services { + ssh { + root-login deny-password; + ciphers [ aes128-ctr "aes128-gcm@openssh.com" aes192-ctr aes256-ctr "aes256-gcm@openssh.com" "chacha20-poly1305@openssh.com" ]; + macs [ "hmac-sha2-256-etm@openssh.com" hmac-sha2-256 hmac-sha2-512 "hmac-sha2-512-etm@openssh.com" "umac-128@openssh.com" "umac-128-etm@openssh.com" ]; + key-exchange [ curve25519-sha256 group-exchange-sha2 ]; + hostkey-algorithm { + no-ssh-dss; + no-ssh-ecdsa; + } + } + netconf { + ssh; + } + } + syslog { + user * { + any emergency; + } + file messages { + any notice; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + file messages_firewall_any { + firewall any; + } + } + ntp { + /* + JunOS doesn't allow hostnames for servers, only IPs. + The following are time{1,2,3,4}.google.com, respectively. + */ + server 216.239.35.0; + server 216.239.35.4; + server 216.239.35.8; + server 216.239.35.12; + } +} +interfaces { + /* Ports that M-Lab uses and should be enabled. */ + interface-range mlab { + /* 1Gbps interfaces */ + member ge-0/0/1; + member ge-0/0/13; + member ge-0/0/25; + member ge-0/0/37; + member ge-0/0/47; + /* 10Gbps interfaces */ + member xe-0/0/0; + member xe-0/0/12; + member xe-0/0/24; + member xe-0/0/36; + member xe-0/0/45; + unit 0 { + family ethernet-switching { + vlan { + members mlab; + } + storm-control default; + } + } + } + /* Ports that M-Lab *does not* use and should be disabled. */ + interface-range disabled { + /* 1Gbps interfaces */ + member ge-0/0/0; + member ge-0/0/2; + member ge-0/0/14; + member-range ge-0/0/4 to ge-0/0/12; + member-range ge-0/0/16 to ge-0/0/24; + member-range ge-0/0/26 to ge-0/0/36; + member-range ge-0/0/38 to ge-0/0/46; + /* 10Gbps interfaces */ + member-range xe-0/0/1 to xe-0/0/11; + member-range xe-0/0/13 to xe-0/0/23; + member-range xe-0/0/25 to xe-0/0/35; + member-range xe-0/0/37 to xe-0/0/44; + member-range xe-0/0/46 to xe-0/0/47; + /* QSPF+ interfaces */ + member-range et-0/0/48 to et-0/0/53; + disable; + } + /* PDUs (Power Distribution Units) */ + interface-range pdus { + member ge-0/0/3; + member ge-0/0/15; + /* The PDUs only have 10/100 Ethernet interfaces */ + speed 100m; + unit 0 { + family ethernet-switching { + vlan { + members pdus; + } + storm-control default; + } + } + } + interface-range dracs { + member ge-0/0/1; + member ge-0/0/13; + member ge-0/0/25; + member ge-0/0/37; + unit 0 { + family ethernet-switching { + filter { + input mlab-dracs; + } + } + } + } + xe-0/0/0 { + description mlab1; + ether-options { + no-flow-control; + } + } + xe-0/0/12 { + description mlab2; + ether-options { + no-flow-control; + } + } + xe-0/0/24 { + description mlab3; + ether-options { + no-flow-control; + } + } + xe-0/0/36 { + description mlab4; + ether-options { + no-flow-control; + } + } + xe-0/0/45 { + /* + This description is used by our Grafana configs to identify the uplink + port of the switch. Do not change this without first making sure the + Grafana configs are also changed. + */ + description uplink-10g; + ether-options { + auto-negotiation; + } + } + irb { + unit 100 { + family inet { + filter { + input mlab; + } + /* The address should use CIDR notation */ + address 4.14.159.66/26; + } + } + unit 200 { + family inet { + address 192.168.1.100/24; + } + } + } +} +# Note: This configuration is to be merged by the snmp-whitelist.yaml Ansible +# playbook. Whenever a change in the whitelisted IPs is required, you can +# update this file and run snmp-whitelist.yml against the switches. +snmp { + client-list allowed-clients { + 4.14.159.64/26; + 45.56.98.222/32; + 35.224.169.63/32; + 35.226.122.118/32; + 35.188.150.110/32; + 35.202.153.90/32; + 35.185.54.7/32; + 35.243.193.167/32; + } + /* Disco community string */ + community foobar { + authorization read-only; + client-list-name allowed-clients; + } + community foobar { + authorization read-only; + client-list-name allowed-clients; + } +} +forwarding-options { + storm-control-profiles default { + all; + } +} +routing-options { + static { + route 0.0.0.0/0 { + next-hop 4.14.159.65; + retain; + no-readvertise; + } + } +} +protocols { + rstp { + interface mlab; + } +} +class-of-service { + shared-buffer { + ingress { + percent 100; + buffer-partition lossless { + percent 5; + } + buffer-partition lossless-headroom { + percent 0; + } + buffer-partition lossy { + percent 95; + } + } + egress { + percent 100; + buffer-partition lossless { + percent 5; + } + buffer-partition multicast { + percent 5; + } + buffer-partition lossy { + percent 90; + } + } + } +} +firewall { + family inet { + filter mlab { + term allow-google-ntp { + from { + source-address { + /* A loose approximation of Google's NTP servers */ + 216.239.35.0/28; + } + source-port ntp; + } + then accept; + } + term blocked-ports { + from { + /* 1127=?, 1128=netcored, 1129=loggerd */ + destination-port [ 1127-1129 ntp ]; + } + then { + discard; + } + } + term default { + then accept; + } + } + } + family ethernet-switching { + filter mlab-dracs { + term allow-arp { + from { + arp-type [ arp-request arp-reply ]; + } + } + term allow-drac-access { + from { + ip-destination-address { + 45.56.98.222/32; + 35.224.169.63/32; + 35.226.122.118/32; + 35.185.54.7/32; + 35.243.193.167/32; + 35.188.150.110/32; + 35.202.153.90/32; + } + } + then accept; + } + term default { + then discard; + } + } + } +} +vlans { + mlab { + vlan-id 100; + l3-interface irb.100; + } + pdus { + vlan-id 200; + l3-interface irb.200; + } +} diff --git a/internal/siteinfo/client.go b/internal/siteinfo/client.go new file mode 100644 index 0000000..c8ee7e0 --- /dev/null +++ b/internal/siteinfo/client.go @@ -0,0 +1,44 @@ +package siteinfo + +import ( + "fmt" + "io/ioutil" + + "github.com/m-lab/switch-monitoring/internal" +) + +const ( + baseURLFormat = "https://siteinfo.%s.measurementlab.net/v1/" +) + +// Client is a Siteinfo client. +type Client struct { + ProjectID string + httpClient internal.HTTPProvider +} + +// New returns a new Siteinfo client wrapping the provided *http.Client. +func New(projectID string, httpClient internal.HTTPProvider) *Client { + return &Client{ + ProjectID: projectID, + httpClient: httpClient, + } +} + +// Switches fetches the switches.json output format and returns its content. +func (s Client) Switches() ([]byte, error) { + url := fmt.Sprintf(baseURLFormat+"sites/switches.json", s.ProjectID) + + resp, err := s.httpClient.Get(url) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + return body, nil +} diff --git a/internal/siteinfo/client_test.go b/internal/siteinfo/client_test.go new file mode 100644 index 0000000..7921385 --- /dev/null +++ b/internal/siteinfo/client_test.go @@ -0,0 +1,105 @@ +package siteinfo + +import ( + "bufio" + "bytes" + "fmt" + "io/ioutil" + "net/http" + "os" + "testing" +) + +const switchesPath = "testdata/switches.json" + +// fileReaderProvider implements a HTTPProvider but the response's content +// comes from a configurable file. +type fileReaderProvider struct { + path string + mustFailToRead bool +} + +func (prov fileReaderProvider) Get(string) (*http.Response, error) { + // Note: it's the caller's responsibility to call Body.Close(). + f, _ := os.Open(prov.path) + return &http.Response{ + Body: ioutil.NopCloser(bufio.NewReader(f)), + StatusCode: http.StatusOK, + }, nil +} + +// failingProvider always fails. +type failingProvider struct{} + +func (prov failingProvider) Get(string) (*http.Response, error) { + return nil, fmt.Errorf("error") +} + +// failingReadProvider returns a Body whose Read() method always fails. +type failingReadProvider struct{} + +func (prov failingReadProvider) Get(string) (*http.Response, error) { + return &http.Response{ + Body: &mockReadCloser{}, + StatusCode: http.StatusOK, + }, nil +} + +// mockReadCloser is ReadCloser that fails. +type mockReadCloser struct{} + +func (mockReadCloser) Read(p []byte) (n int, err error) { + return 0, fmt.Errorf("error") +} + +func (mockReadCloser) Close() error { + return nil +} + +// +// Tests start here. +// + +func TestNew(t *testing.T) { + client := New("project", http.DefaultClient) + if client == nil { + t.Errorf("New() returned nil.") + } +} + +func TestClient_Switches(t *testing.T) { + prov := &fileReaderProvider{ + path: "testdata/switches.json", + } + client := New("test", prov) + + testData, err := ioutil.ReadFile(switchesPath) + if err != nil { + t.Errorf("Cannot read test data from %v", switchesPath) + } + + // This should return the content of the test file. + res, err := client.Switches() + if err != nil { + t.Errorf("Switches() returned err: %v", err) + } + + if bytes.Compare(res, testData) != 0 { + t.Errorf("Switches(): expected: %v, got %v", + testData, res) + } + + // Make the HTTP client fail. + client.httpClient = &failingProvider{} + res, err = client.Switches() + if err == nil { + t.Errorf("Switches(): expected err, got nil.") + } + + // Make reading the response body fail. + client.httpClient = &failingReadProvider{} + res, err = client.Switches() + if err == nil { + t.Errorf("Switches(): expected err, got nil.") + } +} diff --git a/internal/siteinfo/testdata/switches.json b/internal/siteinfo/testdata/switches.json new file mode 100644 index 0000000..7359895 --- /dev/null +++ b/internal/siteinfo/testdata/switches.json @@ -0,0 +1,1442 @@ +{ + "akl01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "163.7.129.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ams03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.169.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ams04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.114.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ams05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.145.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ams08": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.244.128.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "arn02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.146.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "arn03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.242.86.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "arn04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "62.115.225.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "arn05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.119.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "arn06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "193.142.125.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ath03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "193.201.166.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "atl02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.112.151.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "atl03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "64.86.200.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "atl04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.0.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "atl07": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.91.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "atl08": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.71.254.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bcn01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "91.213.30.192/26", + "rstp": "no", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "beg01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "188.120.127.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bog02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "190.98.179.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bom01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "125.18.112.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "bom02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "14.143.58.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bru01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.146.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bru02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "212.3.248.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bru03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "62.115.229.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "bru04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.119.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "cpt01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "154.114.19.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "del01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "115.113.240.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "del02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "61.246.223.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "den02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.34.58.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "den04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.109.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "den05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.120.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "den06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "208.116.164.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dfw02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "64.86.132.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dfw03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.15.35.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dfw05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.163.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dfw07": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.119.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dfw08": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.107.216.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "dub01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "193.1.12.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fln01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "200.237.203.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fra01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.199.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fra02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.114.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fra03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.146.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fra04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "62.67.198.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "fra05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "193.142.125.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "gig01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "190.98.179.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "gru01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "189.125.228.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "gru02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "177.136.80.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "gru03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "200.123.198.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "gru04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "190.98.158.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ham02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.142.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "hkg01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "183.178.65.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "hkg02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "64.235.254.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "hnd01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "203.178.130.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "ex4200", + "uplink_port": "ge-0/0/23", + "uplink_speed": "1g" + }, + "hnd02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "210.151.179.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "hnd03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "111.109.1.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "hnd04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "64.235.255.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "iad02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.90.140.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "iad03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "66.198.10.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "iad04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.4.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "iad05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.35.238.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "iad06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.119.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "jnb01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "196.24.45.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lax02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "63.243.240.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lax03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.3.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lax04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.15.166.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lax05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.109.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lax06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.98.51.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "64.86.148.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.4.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.35.94.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.119.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga08": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.106.70.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga0t": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.14.159.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lga1t": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "4.14.3.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "lhr02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.170.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lhr03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.114.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lhr04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.146.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lhr05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "212.113.31.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lhr06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "93.142.125.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lhr07": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "162.213.96.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lis01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "213.242.96.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "lis02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.147.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lis03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "162.213.98.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "lju01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "91.239.96.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "maa01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "121.242.229.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "maa02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "61.95.154.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mad02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.242.96.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mad03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.229.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mad04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.115.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mad05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "93.142.125.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mia02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.109.21.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mia03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "66.110.73.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mia04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.3.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mia05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.109.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mia06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.71.210.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mil02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.222.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mil03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.115.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mil04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.242.77.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mil05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.147.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mnl01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "202.90.156.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mrs01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "212.73.211.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mrs02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "154.14.11.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "mrs03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "212.73.211.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nbo01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "197.136.0.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nuq02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "149.20.5.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nuq03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.102.163.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nuq04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "66.110.32.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nuq06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.109.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "nuq07": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.110.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ord02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.65.210.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ord03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "66.198.24.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ord04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.3.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ord05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "128.177.163.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "ord06": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.71.251.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "par02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "212.73.231.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "par03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.222.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "par04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.119.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "par05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.147.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "prg02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.122.159.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "prg03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "80.239.156.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "prg04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "77.67.114.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "prg05": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "195.89.147.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sea02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "63.243.224.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sea03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "173.205.3.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sea04": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "4.71.157.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sea07": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "209.170.110.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sea08": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "38.102.0.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "sin01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "180.87.97.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "svg01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "81.167.39.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "syd02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "175.45.79.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "syd03": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "203.5.76.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "tgd01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.149.127.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "tnr01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "41.188.12.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "tpe01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "163.22.28.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "trn02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "194.116.85.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "tun01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "41.231.21.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "vie01": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "213.208.152.0/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "wlg02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "163.7.129.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "xe-0/0/45", + "uplink_speed": "10g" + }, + "yqm01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "209.51.169.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "yul02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "216.66.14.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "yvr01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "184.105.70.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "ywg01": { + "auto_negotiation": "no", + "flow_control": "no", + "ipv4_prefix": "184.105.55.64/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "yyc02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "65.49.72.192/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + }, + "yyz02": { + "auto_negotiation": "yes", + "flow_control": "no", + "ipv4_prefix": "216.66.68.128/26", + "rstp": "yes", + "switch_make": "juniper", + "switch_model": "qfx5100", + "uplink_port": "ge-0/0/47", + "uplink_speed": "1g" + } + }