summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-02-02 16:10:29 +0100
committerMartin Polden <mpolden@mpolden.no>2022-02-02 16:10:29 +0100
commit7e4776db1331a52eeeba73b2646974e338e0edaa (patch)
tree5c8c3a6b05753237e3174edec488dca071595e5f /client
parent6d30f6b83b9b9d877f93b9d382cc8533bacd320a (diff)
Improve vespa curl documentation
Diffstat (limited to 'client')
-rw-r--r--client/go/cmd/curl.go14
-rw-r--r--client/go/cmd/query.go2
2 files changed, 9 insertions, 7 deletions
diff --git a/client/go/cmd/curl.go b/client/go/cmd/curl.go
index 2496ddc3abc..41b1a7ccc58 100644
--- a/client/go/cmd/curl.go
+++ b/client/go/cmd/curl.go
@@ -19,14 +19,16 @@ func init() {
var curlCmd = &cobra.Command{
Use: "curl [curl-options] path",
- Short: "Query Vespa using curl",
- Long: `Query Vespa using curl.
+ Short: "Access Vespa directly using curl",
+ Long: `Access Vespa directly using curl.
-Execute curl with the appropriate URL, certificate and private key for your application.`,
- Example: `$ vespa curl /search/?yql=query
-$ vespa curl -- -v --data-urlencode "yql=select * from sources * where title contains 'foo';" /search/
-$ vespa curl -t local -- -v /search/?yql=query
+Execute curl with the appropriate URL, certificate and private key for your application.
+
+For a more high-level interface to query and feeding, see the 'query' and 'document' commands.
`,
+ Example: `$ vespa curl /ApplicationStatus
+$ vespa curl -- -X POST -H "Content-Type:application/json" --data-binary @src/test/resources/A-Head-Full-of-Dreams.json /document/v1/namespace/music/docid/1
+$ vespa curl -- -v --data-urlencode "yql=select * from music where album contains 'head';" /search/\?hits=5`,
DisableAutoGenTag: true,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
diff --git a/client/go/cmd/query.go b/client/go/cmd/query.go
index 7aa24cf4768..86e99e24052 100644
--- a/client/go/cmd/query.go
+++ b/client/go/cmd/query.go
@@ -26,7 +26,7 @@ func init() {
var queryCmd = &cobra.Command{
Use: "query query-parameters",
Short: "Issue a query to Vespa",
- Example: `$ vespa query "yql=select * from sources * where title contains 'foo';" hits=5`,
+ Example: `$ vespa query "yql=select * from music where album contains 'head';" hits=5`,
Long: `Issue a query to Vespa.
Any parameter from https://docs.vespa.ai/en/reference/query-api-reference.html