api-call.asciidoc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // tag::cloud[]
  2. **Use curl**
  3. . To communicate with {es} using curl or another client, you need your
  4. cluster's endpoint. Go to the **Elasticsearch** page and click **Copy
  5. endpoint**.
  6. . To submit an example API request, run the following curl command in a new
  7. terminal session. Replace `<password>` with the password for the `elastic` user.
  8. Replace `<elasticsearch_endpoint>` with your endpoint.
  9. +
  10. [source,sh]
  11. ----
  12. curl -u elastic:<password> <elasticsearch_endpoint>/
  13. ----
  14. // NOTCONSOLE
  15. **Use {kib}**
  16. . Go to the *{kib}* page and click **Launch**.
  17. //tag::kibana-api-ex[]
  18. . Open {kib}'s main menu and go to **Dev Tools > Console**.
  19. +
  20. [role="screenshot"]
  21. image::images/kibana-console.png[{kib} Console,align="center"]
  22. . Run the following example API request in the console:
  23. +
  24. [source,console]
  25. ----
  26. GET /
  27. ----
  28. //end::kibana-api-ex[]
  29. // end::cloud[]
  30. // tag::self-managed[]
  31. **Use curl**
  32. To submit an example API request, run the following curl command in a new
  33. terminal session.
  34. [source,sh]
  35. ----
  36. curl -X GET http://localhost:9200/
  37. ----
  38. // NOTCONSOLE
  39. **Use {kib}**
  40. include::api-call.asciidoc[tag=kibana-api-ex]
  41. // end::self-managed[]