api-call.asciidoc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // tag::cloud[]
  2. **Use {kib}**
  3. //tag::kibana-api-ex[]
  4. . Open {kib}'s main menu and go to **Dev Tools > Console**.
  5. +
  6. [role="screenshot"]
  7. image::images/kibana-console.png[{kib} Console,align="center"]
  8. . Run the following example API request in the console:
  9. +
  10. [source,console]
  11. ----
  12. GET /
  13. ----
  14. //end::kibana-api-ex[]
  15. **Use curl**
  16. To communicate with {es} using curl or another client, you need your cluster's
  17. endpoint.
  18. . Open {kib}'s main menu and click **Manage this deployment**.
  19. . From your deployment menu, go to the **Elasticsearch** page. Click **Copy
  20. endpoint**.
  21. . To submit an example API request, run the following curl command in a new
  22. terminal session. Replace `<password>` with the password for the `elastic` user.
  23. Replace `<elasticsearch_endpoint>` with your endpoint.
  24. +
  25. [source,sh]
  26. ----
  27. curl -u elastic:<password> <elasticsearch_endpoint>/
  28. ----
  29. // NOTCONSOLE
  30. // end::cloud[]
  31. // tag::self-managed[]
  32. **Use {kib}**
  33. include::api-call.asciidoc[tag=kibana-api-ex]
  34. **Use curl**
  35. To submit an example API request, run the following curl command in a new
  36. terminal session.
  37. . Copy the `http_ca.crt` security certificate from your Docker container to
  38. your local machine.
  39. +
  40. [source,sh]
  41. ----
  42. docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
  43. ----
  44. . Open a new terminal and verify that you can connect to your {es} cluster by
  45. making an authenticated call, using the `http_ca.crt` file that you copied from
  46. your Docker container. Enter the password for the `elastic` user when prompted.
  47. +
  48. [source,sh]
  49. ----
  50. curl --cacert http_ca.crt -u elastic https://localhost:9200
  51. ----
  52. // NOTCONSOLE
  53. // end::self-managed[]