Skip to content

Commit

Permalink
Remove Alerting's notification subproject (opensearch-project#413)
Browse files Browse the repository at this point in the history
* Remove notification subproject

Signed-off-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com>

* Remove publishing to maven in build script

Signed-off-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
  • Loading branch information
qreshi authored and AWSHurneyt committed Apr 21, 2022
1 parent ab22c3c commit 4405723
Show file tree
Hide file tree
Showing 30 changed files with 6 additions and 2,253 deletions.
1 change: 0 additions & 1 deletion alerting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ dependencies {
implementation "org.jetbrains:annotations:13.0"

api project(":alerting-core")
api project(":alerting-notification")
implementation "com.github.seancfoley:ipaddress:5.3.3"

testImplementation "org.jetbrains.kotlin:kotlin-test:${kotlin_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

package org.opensearch.alerting.util

import inet.ipaddr.IPAddressString
import org.opensearch.action.index.IndexRequest
import org.opensearch.action.index.IndexResponse
import org.opensearch.action.support.WriteRequest
import org.opensearch.alerting.core.model.ScheduledJob
import org.opensearch.alerting.destination.message.BaseMessage
import org.opensearch.alerting.model.AggregationResultBucket
import org.opensearch.alerting.model.BucketLevelTriggerRunResult
import org.opensearch.alerting.model.Monitor
Expand Down Expand Up @@ -49,20 +47,6 @@ fun Destination.isAllowed(allowList: List<String>): Boolean = allowList.contains

fun Destination.isTestAction(): Boolean = this.type == DestinationType.TEST_ACTION

fun BaseMessage.isHostInDenylist(networks: List<String>): Boolean {
if (this.url != null || this.uri.host != null) {
val ipStr = IPAddressString(this.uri.host)
for (network in networks) {
val netStr = IPAddressString(network)
if (netStr.contains(ipStr)) {
return true
}
}
}

return false
}

fun Monitor.isBucketLevelMonitor(): Boolean = this.monitorType == Monitor.MonitorType.BUCKET_LEVEL_MONITOR

fun Monitor.isDocLevelMonitor(): Boolean = this.monitorType == Monitor.MonitorType.DOC_LEVEL_MONITOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ abstract class AlertingRestTestCase : ODFERestTestCase() {
// Create Alerting config index if it doesn't exist to avoid mapping issues with legacy destination indexing
createAlertingConfigIndex()

val response = indexDocWithAdminClient(ScheduledJob.SCHEDULED_JOBS_INDEX, UUIDs.base64UUID(), destination.toJsonStringWithType(), refresh)
val response = indexDocWithAdminClient(
ScheduledJob.SCHEDULED_JOBS_INDEX,
UUIDs.base64UUID(),
destination.toJsonStringWithType(),
refresh
)
val destinationJson = jsonXContent.createParser(
NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE,
response.entity.content
Expand Down

This file was deleted.

85 changes: 0 additions & 85 deletions notification/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4405723

Please sign in to comment.