MCPcopy Create free account
hub / github.com/deepflowio/deepflow / syncInfo

Function syncInfo

cli/ctl/genesis.go:90–135  ·  view source on GitHub ↗
(cmd *cobra.Command, resType string)

Source from the content-addressed store, hash-verified

88}
89
90func syncInfo(cmd *cobra.Command, resType string) {
91 server := common.GetServerInfo(cmd)
92 url := fmt.Sprintf("http://%s:%d/v1/sync/%s/", server.IP, server.Port, resType)
93
94 response, err := common.CURLPerform("GET", url, nil, "", []common.HTTPOption{common.WithTimeout(common.GetTimeout(cmd)), common.WithORGID(common.GetORGID(cmd))}...)
95 if err != nil {
96 fmt.Fprintln(os.Stderr, err)
97 return
98 }
99
100 table := tablewriter.NewWriter(os.Stdout)
101 table.SetAutoWrapText(false)
102 table.SetAutoFormatHeaders(false)
103 table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
104 table.SetAlignment(tablewriter.ALIGN_LEFT)
105 table.SetCenterSeparator("")
106 table.SetColumnSeparator("")
107 table.SetRowSeparator("")
108 table.SetHeaderLine(false)
109 table.SetBorder(false)
110 table.SetTablePadding(" ")
111 table.SetNoWhiteSpace(true)
112
113 switch resType {
114 case "vm":
115 tableVm(response, table)
116 case "vpc":
117 tableVpc(response, table)
118 case "host":
119 tableHost(response, table)
120 case "lldp":
121 tableLldp(response, table)
122 case "port":
123 tablePort(response, table)
124 case "network":
125 tableNetwork(response, table)
126 case "ip":
127 tableIp(response, table)
128 case "vip":
129 tableVip(response, table)
130 case "vinterface":
131 tableVinterface(response, table)
132 case "process":
133 tableProcess(response, table)
134 }
135}
136
137func k8sInfo(cmd *cobra.Command, args []string, resType string) {
138 if len(args) == 0 {

Callers 1

RegisterGenesisCommandFunction · 0.85

Calls 11

tableVmFunction · 0.85
tableVpcFunction · 0.85
tableHostFunction · 0.85
tableLldpFunction · 0.85
tablePortFunction · 0.85
tableNetworkFunction · 0.85
tableIpFunction · 0.85
tableVipFunction · 0.85
tableVinterfaceFunction · 0.85
tableProcessFunction · 0.85
GetORGIDMethod · 0.45

Tested by

no test coverage detected