Skip to content

Commit 52d25ba

Browse files
authored
update namespace for alerting plugin to avoid conflict with alerting plugin (#1003)
Signed-off-by: Hailong Cui <[email protected]>
1 parent 0c16406 commit 52d25ba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

server/cluster/ad/alertingPlugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ export default function alertingPlugin(
1818
) {
1919
const ca = components.clientAction.factory;
2020

21-
Client.prototype.alerting = components.clientAction.namespaceFactory();
22-
const alerting = Client.prototype.alerting.prototype;
21+
Client.prototype.adAlerting = components.clientAction.namespaceFactory();
22+
const adAlerting = Client.prototype.adAlerting.prototype;
2323

24-
alerting.searchMonitors = ca({
24+
adAlerting.searchMonitors = ca({
2525
url: {
2626
fmt: `${API.ALERTING_BASE}/_search`,
2727
},
2828
needBody: true,
2929
method: 'POST',
3030
});
3131

32-
alerting.searchAlerts = ca({
32+
adAlerting.searchAlerts = ca({
3333
url: {
3434
fmt: `${API.ALERTING_BASE}/alerts?size=${MAX_ALERTS}&monitorId=<%=monitorId%>&sortString=start_time&sortOrder=desc&searchString=start_time:[<%=startTime%>%20TO%20<%=endTime%>]`,
3535
req: {

server/routes/alerting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default class AlertingService {
9292
);
9393

9494
const response: SearchResponse<Monitor> = await callWithRequest(
95-
'alerting.searchMonitors',
95+
'adAlerting.searchMonitors',
9696
{ body: requestBody }
9797
);
9898
const totalMonitors = get(response, 'hits.total.value', 0);
@@ -155,7 +155,7 @@ export default class AlertingService {
155155
);
156156

157157
const response = callWithRequest(
158-
'alerting.searchAlerts', {
158+
'adAlerting.searchAlerts', {
159159
monitorId: monitorId,
160160
startTime: startTime,
161161
endTime: endTime,

0 commit comments

Comments
 (0)