(cmd *cobra.Command, resType string)
| 88 | } |
| 89 | |
| 90 | func 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 | |
| 137 | func k8sInfo(cmd *cobra.Command, args []string, resType string) { |
| 138 | if len(args) == 0 { |
no test coverage detected