()
| 88 | } |
| 89 | |
| 90 | func (t *cmdDashboard) newTopomClient() *topom.ApiClient { |
| 91 | c := topom.NewApiClient(t.addr) |
| 92 | |
| 93 | log.Debugf("call rpc model to dashboard %s", t.addr) |
| 94 | p, err := c.Model() |
| 95 | if err != nil { |
| 96 | log.PanicErrorf(err, "call rpc model to dashboard %s failed", t.addr) |
| 97 | } |
| 98 | log.Debugf("call rpc model OK") |
| 99 | |
| 100 | c.SetXAuth(p.ProductName) |
| 101 | |
| 102 | log.Debugf("call rpc xping to dashboard %s", t.addr) |
| 103 | if err := c.XPing(); err != nil { |
| 104 | log.PanicErrorf(err, "call rpc xping to dashboard %s failed", t.addr) |
| 105 | } |
| 106 | log.Debugf("call rpc xping OK") |
| 107 | |
| 108 | return c |
| 109 | } |
| 110 | |
| 111 | func (t *cmdDashboard) handleOverview(d map[string]interface{}) { |
| 112 | c := t.newTopomClient() |
no test coverage detected