MCPcopy Index your code
hub / github.com/deepflowio/deepflow / agentCache

Function agentCache

cli/ctl/agent_check.go:243–268  ·  view source on GitHub ↗
(teamID, ctrlIP, ctrlMAC string, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

241}
242
243func 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
270func agentInitCmd(cmd *cobra.Command, cmds []AgentCmdExecute) {
271 conn := agentGetConn(cmd)

Callers 1

agentRegiterCommandFunction · 0.85

Calls 5

agentGetConnFunction · 0.85
DebugAgentCacheMethod · 0.80
GetContentMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected