You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gateway-api.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,3 +91,37 @@ Will return a JSON array of active Trino cluster backends:
91
91
curl -X POST http://localhost:8080/gateway/backend/activate/trino-2
92
92
```
93
93
94
+
## Update Routing Rules
95
+
96
+
This API can be used to programmatically update the Routing Rules.
97
+
Rule will be updated based on the rule name.
98
+
99
+
For this feature to work with multiple replicas of the Trino Gateway, you will need to provide a shared storage that supports file locking for the routing rules file. If multiple replicas are used with local storage, then rules will get out of sync when updated.
100
+
101
+
```shell
102
+
curl -X POST http://localhost:8080/webapp/updateRoutingRules \
103
+
-H 'Content-Type: application/json' \
104
+
-d '{ "name": "trino-rule",
105
+
"description": "updated rule description",
106
+
"priority": 0,
107
+
"actions": ["updated action"],
108
+
"condition": "updated condition"
109
+
}'
110
+
```
111
+
### Disable Routing Rules UI
112
+
113
+
You can set the `disablePages` config to disable pages on the UI.
* Licensed under the Apache License, Version 2.0 (the "License");
3
+
* you may not use this file except in compliance with the License.
4
+
* You may obtain a copy of the License at
5
+
*
6
+
* http://www.apache.org/licenses/LICENSE-2.0
7
+
*
8
+
* Unless required by applicable law or agreed to in writing, software
9
+
* distributed under the License is distributed on an "AS IS" BASIS,
10
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+
* See the License for the specific language governing permissions and
12
+
* limitations under the License.
13
+
*/
14
+
packageio.trino.gateway.ha.domain;
15
+
16
+
importcom.google.common.collect.ImmutableList;
17
+
18
+
importjava.util.List;
19
+
20
+
importstaticjava.util.Objects.requireNonNull;
21
+
importstaticjava.util.Objects.requireNonNullElse;
22
+
23
+
/**
24
+
* RoutingRules
25
+
*
26
+
* @param name name of the routing rule
27
+
* @param description description of the routing rule
28
+
* @param priority priority of the routing rule. Higher number represents higher priority. If two rules have same priority then order of execution is not guaranteed.
0 commit comments