From b4157e32aecb7a0ea5930ea1efc4586431c0ffbf Mon Sep 17 00:00:00 2001 From: Suraj Sanjay Kadam <87651328+SurajKadam7@users.noreply.github.com> Date: Fri, 7 Apr 2023 03:35:36 +0530 Subject: [PATCH] Update api.md (#13436) * Update api.md I have created changes in api call of python according to latest version of requests 2.28.1 library. Along with this there are some irregularities between use of and so I have tried to fix that also. * Update api.md made some changes in declaring USER and PASSWORD --- docs/multi-stage-query/api.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/multi-stage-query/api.md b/docs/multi-stage-query/api.md index db788c92154..19e1e11c4cc 100644 --- a/docs/multi-stage-query/api.md +++ b/docs/multi-stage-query/api.md @@ -89,8 +89,8 @@ curl --location --request POST 'https://:@:

/status ```bash # Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment. -curl --location --request GET 'https://:@:/druid/indexer/v1/task//status' +curl --location --request GET 'https://:@:/druid/indexer/v1/task//status' ``` @@ -152,13 +152,13 @@ curl --location --request GET 'https://:@:/d ```python import requests -# Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment. -url = "https://:@:/druid/indexer/v1/task//status" +# Make sure you replace `your-instance`, `port`, and `taskId` with the values for your deployment. +url = "https://:/druid/indexer/v1/task//status" payload={} headers = {} -response = requests.request("GET", url, headers=headers, data=payload) +response = requests.get(url, headers=headers, data=payload, auth=('USER', 'PASSWORD')) print(response.text) ``` @@ -220,7 +220,7 @@ GET /druid/indexer/v1/task//reports ```bash # Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment. -curl --location --request GET 'https://:@:/druid/indexer/v1/task//reports' +curl --location --request GET 'https://:@:/druid/indexer/v1/task//reports' ``` @@ -228,11 +228,11 @@ curl --location --request GET 'https://:@:/d ```python import requests -# Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment. -url = "https://:@:/druid/indexer/v1/task//reports" +# Make sure you replace `your-instance`, `port`, and `taskId` with the values for your deployment. +url = "https://:/druid/indexer/v1/task//reports" headers = {} -response = requests.request("GET", url, headers=headers) +response = requests.get(url, headers=headers, auth=('USER', 'PASSWORD')) print(response.text) ``` @@ -604,16 +604,16 @@ curl --location --request POST 'https://:@:

-``` +```python import requests -# Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment. -url = "https://:@:/druid/indexer/v1/task//shutdown" +# Make sure you replace `your-instance`, `port`, and `taskId` with the values for your deployment. +url = "https://:/druid/indexer/v1/task//shutdown" payload={} headers = {} -response = requests.request("POST", url, headers=headers, data=payload) +response = requests.post(url, headers=headers, data=payload, auth=('USER', 'PASSWORD')) print(response.text) ```