-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show and modify routing rules from the UI
Remove console logs and renamed api Add api documentation and changes related to PR comments
- Loading branch information
Showing
9 changed files
with
356 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
gateway-ha/src/main/java/io/trino/gateway/ha/domain/RoutingRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.trino.gateway.ha.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* RoutingRules | ||
* | ||
* @param name name of the routing rule | ||
* @param description description of the routing rule | ||
* @param priority priority of the routing rule | ||
* @param actions actions of the routing rule | ||
* @param condition condition of the routing rule | ||
*/ | ||
public record RoutingRules( | ||
@JsonProperty("name") String name, | ||
@JsonProperty("description") String description, | ||
@JsonProperty("priority") Integer priority, | ||
@JsonProperty("actions") List<String> actions, | ||
@JsonProperty("condition") String condition) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {api} from "../base"; | ||
import {RoutingRulesData} from "../../types/routing-rules"; | ||
|
||
export async function routingRulesApi(): Promise<any> { | ||
const response = await api.get('/webapp/getRoutingRules'); | ||
return response; | ||
} | ||
|
||
export async function updateRoutingRulesApi(body: Record<string, any>): Promise<RoutingRulesData> { | ||
return api.post('/webapp/updateRoutingRules', body) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.