Support query in cloud
@@ -35,7 +35,8 @@ can be set by the syntax [parameter-name]=[value].`,
}
func query(arguments []string) {
- url, _ := url.Parse(queryTarget() + "/search/")
+ service := getService("query")
+ url, _ := url.Parse(service.BaseURL + "/search/")
urlQuery := url.Query()
for i := 0; i < len(arguments); i++ {
key, value := splitArg(arguments[i])
@@ -43,8 +44,7 @@ func query(arguments []string) {
}
url.RawQuery = urlQuery.Encode()
- // TODO: Make this work for Vespa Cloud (pass certificate)
- response, err := util.HttpDo(&http.Request{URL: url}, time.Second*10, "Container")
+ response, err := service.Do(&http.Request{URL: url}, time.Second*10)
if err != nil {
log.Print(color.Red("Error: "), "Request failed: ", err)
return
@@ -70,7 +70,3 @@ func splitArg(argument string) (string, string) {
return argument[0:equalsIndex], argument[equalsIndex+1:]
}
}
-
-func queryTarget() string {
- return getService("query").BaseURL
-}
