Skip to content

Commit c95c309

Browse files
SongZhen0704askyrie
authored andcommitted
fix: agent_group_config list command error
1 parent 1c966b7 commit c95c309

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cli/ctl/agent_group_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ func listAgentGroupConfig(cmd *cobra.Command, args []string, output string) {
137137
}
138138

139139
server := common.GetServerInfo(cmd)
140-
url := fmt.Sprintf("http://%s:%d/v1/agent-group-configuration/", server.IP, server.Port)
141140
if output == "yaml" {
141+
url := fmt.Sprintf("http://%s:%d/v1/agent-group-configuration/", server.IP, server.Port)
142142
if agentGroupShortUUID != "" {
143143
agentLcuuid, err := getAgentGroupLcuuid(cmd, server, agentGroupShortUUID)
144144
if err != nil {
@@ -147,7 +147,8 @@ func listAgentGroupConfig(cmd *cobra.Command, args []string, output string) {
147147
}
148148
url += fmt.Sprintf("%s/yaml", agentLcuuid)
149149
} else {
150-
url += "yaml"
150+
fmt.Fprintln(os.Stderr, "Must specify agent group ID")
151+
return
151152
}
152153

153154
response, err := common.CURLPerform("GET", url, nil, "",
@@ -174,7 +175,7 @@ func listAgentGroupConfig(cmd *cobra.Command, args []string, output string) {
174175
return
175176
}
176177

177-
url += "yaml"
178+
url := fmt.Sprintf("http://%s:%d/v1/agent-group-configurations", server.IP, server.Port)
178179
response, err := common.CURLPerform("GET", url, nil, "",
179180
[]common.HTTPOption{common.WithTimeout(common.GetTimeout(cmd)), common.WithORGID(common.GetORGID(cmd))}...)
180181
if err != nil {

0 commit comments

Comments
 (0)