Skip to content

Commit

Permalink
update code tab syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
317brian committed Jun 12, 2023
1 parent af51fe1 commit 37b725b
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 75 deletions.
80 changes: 59 additions & 21 deletions docs/api-reference/sql-ingestion-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: sql-ingestion-api
title: SQL-based ingestion API
sidebar_label: SQL-based ingestion
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<!--
~ Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -52,9 +54,10 @@ As an experimental feature, this endpoint also accepts SELECT queries. SELECT qu
by the controller, and written into the [task report](#get-the-report-for-a-query-task) as an array of arrays. The
behavior and result format of plain SELECT queries (without INSERT or REPLACE) is subject to change.

<!--DOCUSAURUS_CODE_TABS-->
<Tabs>

<TabItem value="1" label="HTTP">

<!--HTTP-->

```
POST /druid/v2/sql/task
Expand All @@ -69,7 +72,10 @@ POST /druid/v2/sql/task
}
```

<!--curl-->
</TabItem>

<TabItem value="2" label="curl">


```bash
# Make sure you replace `username`, `password`, `your-instance`, and `port` with the values for your deployment.
Expand All @@ -83,7 +89,10 @@ curl --location --request POST 'https://<username>:<password>@<your-instance>:<p
}'
```

<!--Python-->
</TabItem>

<TabItem value="3" label="Python">


```python
import json
Expand All @@ -108,7 +117,9 @@ print(response.text)

```

<!--END_DOCUSAURUS_CODE_TABS-->
</TabItem>

</Tabs>

#### Response

Expand All @@ -132,22 +143,29 @@ You can retrieve status of a query to see if it is still running, completed succ

#### Request

<!--DOCUSAURUS_CODE_TABS-->
<Tabs>

<TabItem value="4" label="HTTP">

<!--HTTP-->

```
GET /druid/indexer/v1/task/<taskId>/status
```

<!--curl-->
</TabItem>

<TabItem value="5" label="curl">


```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>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/status'
```

<!--Python-->
</TabItem>

<TabItem value="6" label="Python">


```python
import requests
Expand All @@ -163,7 +181,9 @@ response = requests.get(url, headers=headers, data=payload, auth=('USER', 'PASSW
print(response.text)
```

<!--END_DOCUSAURUS_CODE_TABS-->
</TabItem>

</Tabs>

#### Response

Expand Down Expand Up @@ -208,22 +228,29 @@ For an explanation of the fields in a report, see [Report response fields](#repo

#### Request

<!--DOCUSAURUS_CODE_TABS-->
<Tabs>

<TabItem value="7" label="HTTP">

<!--HTTP-->

```
GET /druid/indexer/v1/task/<taskId>/reports
```

<!--curl-->
</TabItem>

<TabItem value="8" label="curl">


```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>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/reports'
```

<!--Python-->
</TabItem>

<TabItem value="9" label="Python">


```python
import requests
Expand All @@ -236,7 +263,9 @@ response = requests.get(url, headers=headers, auth=('USER', 'PASSWORD'))
print(response.text)
```

<!--END_DOCUSAURUS_CODE_TABS-->
</TabItem>

</Tabs>

#### Response

Expand Down Expand Up @@ -511,7 +540,7 @@ The response shows an example report for a query.
"0": 1,
"1": 1,
"2": 1
},
},
"totalMergersForUltimateLevel": 1,
"progressDigest": 1
}
Expand Down Expand Up @@ -587,22 +616,29 @@ The following table describes the response fields when you retrieve a report for

#### Request

<!--DOCUSAURUS_CODE_TABS-->
<Tabs>

<TabItem value="10" label="HTTP">

<!--HTTP-->

```
POST /druid/indexer/v1/task/<taskId>/shutdown
```

<!--curl-->
</TabItem>

<TabItem value="11" label="curl">


```bash
# Make sure you replace `username`, `password`, `your-instance`, `port`, and `taskId` with the values for your deployment.
curl --location --request POST 'https://<username>:<password>@<your-instance>:<port>/druid/indexer/v1/task/<taskId>/shutdown'
```

<!--Python-->
</TabItem>

<TabItem value="12" label="Python">


```python
import requests
Expand All @@ -618,7 +654,9 @@ response = requests.post(url, headers=headers, data=payload, auth=('USER', 'PASS
print(response.text)
```

<!--END_DOCUSAURUS_CODE_TABS-->
</TabItem>

</Tabs>

#### Response

Expand Down
Loading

0 comments on commit 37b725b

Please sign in to comment.