This is an automated email from the ASF dual-hosted git repository.
techdocsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new b4157e32ae Update api.md (#13436)
b4157e32ae is described below
commit b4157e32aecb7a0ea5930ea1efc4586431c0ffbf
Author: Suraj Sanjay Kadam <[email protected]>
AuthorDate: Fri Apr 7 03:35:36 2023 +0530
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 <your-instance> and <hostname> 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 db788c9215..19e1e11c4c 100644
--- a/docs/multi-stage-query/api.md
+++ b/docs/multi-stage-query/api.md
@@ -89,8 +89,8 @@ curl --location --request POST
'https://<username>:<password>@<your-instance>:<p
import json
import requests
-# Make sure you replace `username`, `password`, `your-instance`, and `port`
with the values for your deployment.
-url = "https://<username>:<password>@<your-instance>:<port>/druid/v2/sql/task/"
+# Make sure you replace `your-instance`, and `port` with the values for your
deployment.
+url = "https://<your-instance>:<port>/druid/v2/sql/task/"
payload = json.dumps({
"query": "INSERT INTO wikipedia\nSELECT\n TIME_PARSE(\"timestamp\") AS
__time,\n *\nFROM TABLE(\n EXTERN(\n '{\"type\": \"http\", \"uris\":
[\"https://druid.apache.org/data/wikipedia.json.gz\"]}',\n '{\"type\":
\"json\"}',\n '[{\"name\": \"added\", \"type\": \"long\"}, {\"name\":
\"channel\", \"type\": \"string\"}, {\"name\": \"cityName\", \"type\":
\"string\"}, {\"name\": \"comment\", \"type\": \"string\"}, {\"name\":
\"commentLength\", \"type\": \"long\"}, {\"name\": \"co [...]
@@ -102,7 +102,7 @@ headers = {
'Content-Type': 'application/json'
}
-response = requests.request("POST", url, headers=headers, data=payload)
+response = requests.post(url, headers=headers, data=payload, auth=('USER',
'PASSWORD'))
print(response.text)
@@ -144,7 +144,7 @@ GET /druid/indexer/v1/task/<taskId>/status
```bash
# Make sure you replace `username`, `password`, `your-instance`, `port`, and
`taskId` with the values for your deployment.
-curl --location --request GET
'https://<username>:<password>@<hostname>:<port>/druid/indexer/v1/task/<taskId>/status'
+curl --location --request GET
'https://<username>:<password>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/status'
```
<!--Python-->
@@ -152,13 +152,13 @@ curl --location --request GET
'https://<username>:<password>@<hostname>:<port>/d
```python
import requests
-# Make sure you replace `username`, `password`, `your-instance`, `port`, and
`taskId` with the values for your deployment.
-url =
"https://<username>:<password>@<hostname>:<port>/druid/indexer/v1/task/<taskId>/status"
+# Make sure you replace `your-instance`, `port`, and `taskId` with the values
for your deployment.
+url = "https://<your-instance>:<port>/druid/indexer/v1/task/<taskId>/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/<taskId>/reports
```bash
# Make sure you replace `username`, `password`, `your-instance`, `port`, and
`taskId` with the values for your deployment.
-curl --location --request GET
'https://<username>:<password>@<hostname>:<port>/druid/indexer/v1/task/<taskId>/reports'
+curl --location --request GET
'https://<username>:<password>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/reports'
```
<!--Python-->
@@ -228,11 +228,11 @@ curl --location --request GET
'https://<username>:<password>@<hostname>:<port>/d
```python
import requests
-# Make sure you replace `username`, `password`, `your-instance`, `port`, and
`taskId` with the values for your deployment.
-url =
"https://<username>:<password>@<hostname>:<port>/druid/indexer/v1/task/<taskId>/reports"
+# Make sure you replace `your-instance`, `port`, and `taskId` with the values
for your deployment.
+url = "https://<your-instance>:<port>/druid/indexer/v1/task/<taskId>/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://<username>:<password>@<your-instance>:<p
<!--Python-->
-```
+```python
import requests
-# Make sure you replace `username`, `password`, `your-instance`, `port`, and
`taskId` with the values for your deployment.
-url =
"https://<username>:<password>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/shutdown"
+# Make sure you replace `your-instance`, `port`, and `taskId` with the values
for your deployment.
+url = "https://<your-instance>:<port>/druid/indexer/v1/task/<taskId>/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)
```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]