From d0e15561c7c54178f0efaf05e5af02c20eefabbd Mon Sep 17 00:00:00 2001 From: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Date: Wed, 22 Jul 2020 09:48:10 -0700 Subject: [PATCH] Docs: Put curl examples into separate topic (#26530) --- docs/sources/http_api/curl-examples.md | 23 +++++++++++++++++++ .../http_api/folder_dashboard_search.md | 13 ----------- docs/sources/menu.yaml | 2 ++ 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 docs/sources/http_api/curl-examples.md diff --git a/docs/sources/http_api/curl-examples.md b/docs/sources/http_api/curl-examples.md new file mode 100644 index 00000000000..cb1399c3d77 --- /dev/null +++ b/docs/sources/http_api/curl-examples.md @@ -0,0 +1,23 @@ ++++ +title = "cURL examples" +description = "cURL examples" +keywords = ["grafana", "http", "documentation", "api", "curl"] +type = "docs" +[menu.docs] ++++ + +# cURL examples + +This page provides examples of calls to the Grafana API using cURL. + +The most basic example for a dashboard for which there is no authentication. You can test the following on your local machine, assuming a default installation and anonymous access enabled, required: + +``` +curl http://localhost:3000/api/search +``` + +Here’s a cURL command that works for getting the home dashboard when you are running Grafana locally with [basic authentication]({{< relref "../auth/#basic-auth" >}}) enabled using the default admin credentials: + +``` +curl http://admin:admin@localhost:3000/api/search +``` \ No newline at end of file diff --git a/docs/sources/http_api/folder_dashboard_search.md b/docs/sources/http_api/folder_dashboard_search.md index 733909f0cf3..a5c37acdc86 100644 --- a/docs/sources/http_api/folder_dashboard_search.md +++ b/docs/sources/http_api/folder_dashboard_search.md @@ -97,16 +97,3 @@ Content-Type: application/json } ] ``` -## cURL examples - -The most basic example for a dashboard for which there is no authentication. You can test the following on your local machine, assuming a default installation and anonymous access enabled, required: - -``` -curl http://localhost:3000/api/search -``` - -Here’s a cURL command that works for getting the home dashboard when you are running Grafana locally with [basic authentication]({{< relref "../auth/#basic-auth" >}}) enabled using the default admin credentials: - -``` -curl http://admin:admin@localhost:3000/api/dashboards/home -``` diff --git a/docs/sources/menu.yaml b/docs/sources/menu.yaml index 1604b1eb4c0..2b2494c5197 100644 --- a/docs/sources/menu.yaml +++ b/docs/sources/menu.yaml @@ -382,6 +382,8 @@ link: /http_api/auth/ - name: Create API Tokens and Dashboards for a Specific Organization link: /tutorials/api_org_token_howto/ + - name: cURL examples + link: /http_api/curl-examples/ - name: Admin API link: /http_api/admin/ - name: Alerting API