(teamID, ctrlIP, ctrlMAC string, cmd *cobra.Command)
| 241 | } |
| 242 | |
| 243 | func agentCache(teamID, ctrlIP, ctrlMAC string, cmd *cobra.Command) { |
| 244 | conn := agentGetConn(cmd) |
| 245 | if conn == nil { |
| 246 | return |
| 247 | } |
| 248 | defer conn.Close() |
| 249 | fmt.Printf("request trisolaris(%s) ,team(%s) ctrl ip(%s) mac(%s)\n", conn.Target(), teamID, ctrlIP, ctrlMAC) |
| 250 | c := agent.NewDebugClient(conn) |
| 251 | reqData := &agent.AgentCacheRequest{ |
| 252 | TeamId: &teamID, |
| 253 | CtrlIp: &ctrlIP, |
| 254 | CtrlMac: &ctrlMAC, |
| 255 | } |
| 256 | response, err := c.DebugAgentCache(context.Background(), reqData) |
| 257 | if err != nil { |
| 258 | fmt.Println(err) |
| 259 | return |
| 260 | } |
| 261 | var str bytes.Buffer |
| 262 | err = json.Indent(&str, response.GetContent(), "", " ") |
| 263 | if err != nil { |
| 264 | fmt.Println(err) |
| 265 | return |
| 266 | } |
| 267 | fmt.Println(str.String()) |
| 268 | } |
| 269 | |
| 270 | func agentInitCmd(cmd *cobra.Command, cmds []AgentCmdExecute) { |
| 271 | conn := agentGetConn(cmd) |
no test coverage detected