(xauth bool)
| 42 | } |
| 43 | |
| 44 | func (t *cmdProxy) newProxyClient(xauth bool) *proxy.ApiClient { |
| 45 | c := proxy.NewApiClient(t.addr) |
| 46 | |
| 47 | if !xauth { |
| 48 | return c |
| 49 | } |
| 50 | |
| 51 | log.Debugf("call rpc model to proxy %s", t.addr) |
| 52 | p, err := c.Model() |
| 53 | if err != nil { |
| 54 | log.PanicErrorf(err, "call rpc model to proxy %s failed", t.addr) |
| 55 | } |
| 56 | log.Debugf("call rpc model OK") |
| 57 | |
| 58 | c.SetXAuth(p.ProductName, t.auth, p.Token) |
| 59 | |
| 60 | log.Debugf("call rpc xping to proxy %s", t.addr) |
| 61 | if err := c.XPing(); err != nil { |
| 62 | log.PanicErrorf(err, "call rpc xping failed") |
| 63 | } |
| 64 | log.Debugf("call rpc xping OK") |
| 65 | |
| 66 | return c |
| 67 | } |
| 68 | |
| 69 | func (t *cmdProxy) handleOverview(d map[string]interface{}) { |
| 70 | c := t.newProxyClient(false) |
no test coverage detected