-
Notifications
You must be signed in to change notification settings - Fork 479
Update critical nodes endpoint curl examples #23368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,25 @@ If the cluster is unavailable, a database's `crdb_internal` system catalog canno | |
|
|
||
| For details, see [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %}). | ||
|
|
||
| ### Authenticate to API endpoints | ||
|
|
||
| To call the HTTP API endpoints on this page using `curl`: | ||
|
|
||
| For an insecure or local testing cluster, use HTTP: | ||
|
|
||
| {% include_cached copy-clipboard.html %} | ||
| ~~~ shell | ||
| curl http://<host>:<http-port>/<endpoint> | ||
| ~~~ | ||
|
|
||
| For a secure cluster, authenticate to the HTTPS endpoint with [`cockroach auth-session login`]({% link {{ page.version.version }}/cockroach-auth-session.md %}#log-in-to-the-http-interface), then pass the authentication cookie to `curl`. | ||
|
|
||
| {% include_cached copy-clipboard.html %} | ||
| ~~~ shell | ||
| cockroach auth-session login <user> --certs-dir=certs --only-cookie > $HOME/.cockroachdb_api_key | ||
| curl --cookie $HOME/.cockroachdb_api_key --cacert certs/ca.crt https://<host>:<http-port>/<endpoint> | ||
| ~~~ | ||
|
|
||
| ### Health endpoints | ||
|
|
||
| CockroachDB provides two HTTP endpoints for checking the health of individual nodes. | ||
|
|
@@ -207,6 +226,10 @@ The critical nodes status endpoint is used to: | |
|
|
||
| If you find under-replicated ranges or constraint violations, you will need to [Troubleshoot your replication zones]({% link {{ page.version.version }}/troubleshoot-replication-zones.md %}). | ||
|
|
||
| #### Request the endpoint | ||
|
|
||
| To return the JSON response, send a `POST` request to `/_status/critical_nodes`. For authentication details, refer to [Authenticate to API endpoints](#authenticate-to-api-endpoints). | ||
|
|
||
|
Comment on lines
+229
to
+232
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding this! I wonder if this might be better more centralized somewhere since presumably these instructions work for all of the HTTP/HTTPS endpoints on this page?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the review! ya that's a good point, i think i will move it to a new section called "authenticate to API endpoints" or something similar |
||
| #### Fields | ||
|
|
||
| The JSON object returned by the critical nodes status endpoint contains the following top-level fields. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style note: We're using
{ }rater than< >unless this explicitly confuses the syntax.