From 72134ef5a750085652d894b36b918c9dead2f4e7 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 1 Mar 2022 17:12:58 -0800 Subject: [PATCH] docs: add op api examples --- .../content/docs/commands/operator/api.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/website/content/docs/commands/operator/api.mdx b/website/content/docs/commands/operator/api.mdx index 0449894b1..b05c6dc54 100644 --- a/website/content/docs/commands/operator/api.mdx +++ b/website/content/docs/commands/operator/api.mdx @@ -66,6 +66,29 @@ curl \ - `-X`: HTTP method of request. If there is data piped to stdin, then the method defaults to POST. Otherwise the method defaults to GET. +## Examples + +```shell-session +$ nomad operator api -verbose /v1/agent/members?pretty +> GET http://127.0.0.1:4646/v1/agent/members?pretty= +* Sending request and receiving response... +< HTTP/1.1 200 OK +< Date: Wed, 02 Mar 2022 01:10:59 GMT +< Content-Type: application/json +< Vary: Accept-Encoding +{ + "Members": [ +... + + +$ nomad operator api -region eu-west -filter '.Status == "completed"' -dryrun /v1/evaluations +curl \ + -X GET \ + http://127.0.0.1:4646/v1/evaluations?filter=.Status+%3D%3D+%22completed%22®ion=eu-west +``` + + + [curl]: https://curl.se/ [envvars]: /docs/commands#environment-variables