Skip to content

Commit

Permalink
Fix broken renderings of code blocks in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdsarvar authored May 29, 2024
1 parent 6dcd506 commit 5d7e30c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
21 changes: 13 additions & 8 deletions docs/gateway-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Add or update a backend

```$xslt
```shell
curl -X POST http://localhost:8080/entity?entityType=GATEWAY_BACKEND \
-d '{ "name": "trino-3",
"proxyTo": "http://localhost:8083",
Expand All @@ -15,7 +15,7 @@ If the backend URL is different from the `proxyTo` URL (for example if they are
internal vs. external hostnames). You can use the optional `externalUrl` field
to override the link in the Active Backends page.

```$xslt
```shell
curl -X POST http://localhost:8080/entity?entityType=GATEWAY_BACKEND \
-d '{ "name": "trino-3",
"proxyTo": "http://localhost:8083",
Expand All @@ -28,7 +28,7 @@ curl -X POST http://localhost:8080/entity?entityType=GATEWAY_BACKEND \
## Get all backends

`curl -X GET http://localhost:8080/entity/GATEWAY_BACKEND`
```$xslt
```json
[
{
"name": "trino-1",
Expand Down Expand Up @@ -56,21 +56,24 @@ curl -X POST http://localhost:8080/entity?entityType=GATEWAY_BACKEND \

## Delete a backend

```$xslt
```shell
curl -X POST -d "trino3" http://localhost:8080/gateway/backend/modify/delete
```

## Deactivate a backend

```$xslt
```shell
curl -X POST http://localhost:8080/gateway/backend/deactivate/trino-2
```

## Get all active backends

`curl -X GET http://localhost:8080/gateway/backend/active`

```shell
curl -X GET http://localhost:8080/gateway/backend/active
```

Will return a JSON array of active Trino cluster backends:
```json
[
{
"name": "trino-1",
Expand All @@ -84,5 +87,7 @@ curl -X POST http://localhost:8080/gateway/backend/deactivate/trino-2

## Activate a backend

`curl -X POST http://localhost:8080/gateway/backend/activate/trino-2`
```shell
curl -X POST http://localhost:8080/gateway/backend/activate/trino-2
```

26 changes: 13 additions & 13 deletions docs/resource-groups-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource groups and selector tables. To use this, just specify the query
parameter ?useSchema=<schemaname> to the request. Example, to list all resource
groups,

```$xslt
```shell
curl -X GET http://localhost:8080/trino/resourcegroup/read/{INSERT_ID_HERE}?useSchema=newdatabasename
```

Expand All @@ -17,7 +17,7 @@ To add a single resource group, specify all relevant fields in the body.
Resource group id should not be specified since the database should
autoincrement it.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/resourcegroup/create \
-d '{
"name": "resourcegroup1", \
Expand All @@ -40,7 +40,7 @@ curl -X POST http://localhost:8080/trino/resourcegroup/create \
If no resourceGroupId (type long) is specified, then all existing resource
groups are fetched.

```$xslt
```shell
curl -X GET http://localhost:8080/trino/resourcegroup/read/{INSERT_ID_HERE}
```

Expand All @@ -49,7 +49,7 @@ curl -X GET http://localhost:8080/trino/resourcegroup/read/{INSERT_ID_HERE}
Specify all columns in the body, which will overwrite properties for the
resource group with that specific resourceGroupId.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/resourcegroup/update \
-d '{ "resourceGroupId": 1, \
"name": "resourcegroup_updated", \
Expand All @@ -72,7 +72,7 @@ curl -X POST http://localhost:8080/trino/resourcegroup/update \
To delete a resource group, specify the corresponding resourceGroupId (type
long).

```$xslt
```shell
curl -X POST http://localhost:8080/trino/resourcegroup/delete/{INSERT_ID_HERE}
```

Expand All @@ -81,7 +81,7 @@ curl -X POST http://localhost:8080/trino/resourcegroup/delete/{INSERT_ID_HERE}
To add a single selector, specify all relevant fields in the body. Resource
group id should not be specified since the database should autoincrement it.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/selector/create \
-d '{
"priority": 1, \
Expand All @@ -96,7 +96,7 @@ curl -X POST http://localhost:8080/trino/selector/create \
If no resourceGroupId (type long) is specified, then all existing selectors are
fetched.

```$xslt
```shell
curl -X GET http://localhost:8080/trino/selector/read/{INSERT_ID_HERE}
```

Expand All @@ -108,7 +108,7 @@ fields under "current". The updated version of that selector is specified under
does not exist, a new selector will be created with the details under "update".
Both "current" and "update" must be included to update a selector.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/selector/update \
-d '{ "current": {
"resourceGroupId": 1, \
Expand All @@ -131,7 +131,7 @@ curl -X POST http://localhost:8080/trino/selector/update \

To delete a selector, specify all relevant fields in the body.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/selector/delete \
-d '{ "resourceGroupId": 1, \
"priority": 2, \
Expand All @@ -145,7 +145,7 @@ curl -X POST http://localhost:8080/trino/selector/delete \

To add a single global property, specify all relevant fields in the body.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/globalproperty/create \
-d '{
"name": "cpu_quota_period", \
Expand All @@ -158,7 +158,7 @@ curl -X POST http://localhost:8080/trino/globalproperty/create \
If no name (type String) is specified, then all existing global properties are
fetched.

```$xslt
```shell
curl -X GET http://localhost:8080/trino/globalproperty/read/{INSERT_NAME_HERE}
```

Expand All @@ -167,7 +167,7 @@ curl -X GET http://localhost:8080/trino/globalproperty/read/{INSERT_NAME_HERE}
Specify all columns in the body, which will overwrite properties for the global
property with that specific name.

```$xslt
```shell
curl -X POST http://localhost:8080/trino/globalproperty/update \
-d '{
"name": "cpu_quota_period", \
Expand All @@ -179,6 +179,6 @@ curl -X POST http://localhost:8080/trino/globalproperty/update \

To delete a global property, specify the corresponding name (type String).

```$xslt
```shell
curl -X POST http://localhost:8080/trino/globalproperty/delete/{INSERT_NAME_HERE}
```

0 comments on commit 5d7e30c

Please sign in to comment.