diff options
author | Martin Polden <mpolden@mpolden.no> | 2022-02-02 16:27:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 16:27:50 +0100 |
commit | 0ce79110b6a38f5656d3f4f188e8e31ac5703299 (patch) | |
tree | 6a2f7f5c78f1b256262baac8dce5edebb33a2d11 /client | |
parent | 81ad990ebeac8ee501dc933ccb4ebdb95b8e8b7c (diff) | |
parent | 7e4776db1331a52eeeba73b2646974e338e0edaa (diff) |
Merge pull request #21035 from vespa-engine/mpolden/improve-doc
Improve vespa curl documentation
Diffstat (limited to 'client')
-rw-r--r-- | client/go/cmd/curl.go | 14 | ||||
-rw-r--r-- | client/go/cmd/query.go | 2 |
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 |