Skip to content

Commit

Permalink
Rename namespaces from com.amazon.opendistroforelasticsearch to org.o…
Browse files Browse the repository at this point in the history
…pensearch (#15)

* Renaming Namespaces from ODFE to Opensearch

Signed-off-by: Aditya Jindal <[email protected]>
  • Loading branch information
adityaj1107 authored May 20, 2021
1 parent b19cb79 commit fbdddee
Show file tree
Hide file tree
Showing 241 changed files with 1,147 additions and 1,144 deletions.
1 change: 0 additions & 1 deletion .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
with:
repository: 'opensearch-project/common-utils'
path: common-utils
ref: '1.0.0-beta1'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
with:
repository: 'opensearch-project/common-utils'
path: common-utils
ref: '1.0.0-beta1'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1
Expand All @@ -71,4 +70,4 @@ jobs:
# path: alerting-artifacts
# Publish to local maven
- name: Publish to Maven Local
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ When launching a cluster using one of the above commands, logs are placed in `al

- `./gradlew :alerting:integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dhttps=true -Dsecurity=true -Duser=admin -Dpassword=admin`

- `./gradlew :alerting:integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dhttps=true -Dsecurity=true -Duser=admin -Dpassword=admin --tests "com.amazon.opendistroforelasticsearch.alerting.MonitorRunnerIT.test execute monitor returns search result"`
- `./gradlew :alerting:integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dhttps=true -Dsecurity=true -Duser=admin -Dpassword=admin --tests "org.opensearch.alerting.MonitorRunnerIT.test execute monitor returns search result"`

### Debugging

Expand Down
2 changes: 1 addition & 1 deletion alerting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (isSnapshot) {
opensearchplugin {
name 'opensearch-alerting'
description 'Amazon OpenSearch alerting plugin'
classname 'com.amazon.opendistroforelasticsearch.alerting.AlertingPlugin'
classname 'org.opensearch.alerting.AlertingPlugin'
extendedPlugins = ['lang-painless']
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,76 +23,76 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazon.opendistroforelasticsearch.alerting
package org.opensearch.alerting

import com.amazon.opendistroforelasticsearch.alerting.action.AcknowledgeAlertAction
import com.amazon.opendistroforelasticsearch.alerting.action.DeleteDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.action.DeleteEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.action.DeleteEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.action.DeleteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.action.ExecuteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.action.GetAlertsAction
import com.amazon.opendistroforelasticsearch.alerting.action.GetDestinationsAction
import com.amazon.opendistroforelasticsearch.alerting.action.GetEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.action.GetEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.action.GetMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.action.IndexDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.action.IndexEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.action.IndexEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.action.IndexMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.action.SearchEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.action.SearchEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.action.SearchMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.alerts.AlertIndices
import com.amazon.opendistroforelasticsearch.alerting.core.JobSweeper
import com.amazon.opendistroforelasticsearch.alerting.core.ScheduledJobIndices
import com.amazon.opendistroforelasticsearch.alerting.core.action.node.ScheduledJobsStatsAction
import com.amazon.opendistroforelasticsearch.alerting.core.action.node.ScheduledJobsStatsTransportAction
import com.amazon.opendistroforelasticsearch.alerting.core.model.ScheduledJob
import com.amazon.opendistroforelasticsearch.alerting.core.model.SearchInput
import com.amazon.opendistroforelasticsearch.alerting.core.resthandler.RestScheduledJobStatsHandler
import com.amazon.opendistroforelasticsearch.alerting.core.schedule.JobScheduler
import com.amazon.opendistroforelasticsearch.alerting.core.settings.ScheduledJobSettings
import com.amazon.opendistroforelasticsearch.alerting.model.Monitor
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestAcknowledgeAlertAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestDeleteDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestDeleteEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestDeleteEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestDeleteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestExecuteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestGetAlertsAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestGetDestinationsAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestGetEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestGetEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestGetMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestIndexMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestSearchEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestSearchEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.resthandler.RestSearchMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.script.TriggerScript
import com.amazon.opendistroforelasticsearch.alerting.settings.AlertingSettings
import com.amazon.opendistroforelasticsearch.alerting.settings.DestinationSettings
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportAcknowledgeAlertAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportDeleteDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportDeleteEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportDeleteEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportDeleteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportExecuteMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportGetAlertsAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportGetDestinationsAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportGetEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportGetEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportGetMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportIndexDestinationAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportIndexEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportIndexEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportIndexMonitorAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportSearchEmailAccountAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportSearchEmailGroupAction
import com.amazon.opendistroforelasticsearch.alerting.transport.TransportSearchMonitorAction
import org.opensearch.alerting.action.AcknowledgeAlertAction
import org.opensearch.alerting.action.DeleteDestinationAction
import org.opensearch.alerting.action.DeleteEmailAccountAction
import org.opensearch.alerting.action.DeleteEmailGroupAction
import org.opensearch.alerting.action.DeleteMonitorAction
import org.opensearch.alerting.action.ExecuteMonitorAction
import org.opensearch.alerting.action.GetAlertsAction
import org.opensearch.alerting.action.GetDestinationsAction
import org.opensearch.alerting.action.GetEmailAccountAction
import org.opensearch.alerting.action.GetEmailGroupAction
import org.opensearch.alerting.action.GetMonitorAction
import org.opensearch.alerting.action.IndexDestinationAction
import org.opensearch.alerting.action.IndexEmailAccountAction
import org.opensearch.alerting.action.IndexEmailGroupAction
import org.opensearch.alerting.action.IndexMonitorAction
import org.opensearch.alerting.action.SearchEmailAccountAction
import org.opensearch.alerting.action.SearchEmailGroupAction
import org.opensearch.alerting.action.SearchMonitorAction
import org.opensearch.alerting.alerts.AlertIndices
import org.opensearch.alerting.core.JobSweeper
import org.opensearch.alerting.core.ScheduledJobIndices
import org.opensearch.alerting.core.action.node.ScheduledJobsStatsAction
import org.opensearch.alerting.core.action.node.ScheduledJobsStatsTransportAction
import org.opensearch.alerting.core.model.ScheduledJob
import org.opensearch.alerting.core.model.SearchInput
import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler
import org.opensearch.alerting.core.schedule.JobScheduler
import org.opensearch.alerting.core.settings.ScheduledJobSettings
import org.opensearch.alerting.model.Monitor
import org.opensearch.alerting.resthandler.RestAcknowledgeAlertAction
import org.opensearch.alerting.resthandler.RestDeleteDestinationAction
import org.opensearch.alerting.resthandler.RestDeleteEmailAccountAction
import org.opensearch.alerting.resthandler.RestDeleteEmailGroupAction
import org.opensearch.alerting.resthandler.RestDeleteMonitorAction
import org.opensearch.alerting.resthandler.RestExecuteMonitorAction
import org.opensearch.alerting.resthandler.RestGetAlertsAction
import org.opensearch.alerting.resthandler.RestGetDestinationsAction
import org.opensearch.alerting.resthandler.RestGetEmailAccountAction
import org.opensearch.alerting.resthandler.RestGetEmailGroupAction
import org.opensearch.alerting.resthandler.RestGetMonitorAction
import org.opensearch.alerting.resthandler.RestIndexDestinationAction
import org.opensearch.alerting.resthandler.RestIndexEmailAccountAction
import org.opensearch.alerting.resthandler.RestIndexEmailGroupAction
import org.opensearch.alerting.resthandler.RestIndexMonitorAction
import org.opensearch.alerting.resthandler.RestSearchEmailAccountAction
import org.opensearch.alerting.resthandler.RestSearchEmailGroupAction
import org.opensearch.alerting.resthandler.RestSearchMonitorAction
import org.opensearch.alerting.script.TriggerScript
import org.opensearch.alerting.settings.AlertingSettings
import org.opensearch.alerting.settings.DestinationSettings
import org.opensearch.alerting.transport.TransportAcknowledgeAlertAction
import org.opensearch.alerting.transport.TransportDeleteDestinationAction
import org.opensearch.alerting.transport.TransportDeleteEmailAccountAction
import org.opensearch.alerting.transport.TransportDeleteEmailGroupAction
import org.opensearch.alerting.transport.TransportDeleteMonitorAction
import org.opensearch.alerting.transport.TransportExecuteMonitorAction
import org.opensearch.alerting.transport.TransportGetAlertsAction
import org.opensearch.alerting.transport.TransportGetDestinationsAction
import org.opensearch.alerting.transport.TransportGetEmailAccountAction
import org.opensearch.alerting.transport.TransportGetEmailGroupAction
import org.opensearch.alerting.transport.TransportGetMonitorAction
import org.opensearch.alerting.transport.TransportIndexDestinationAction
import org.opensearch.alerting.transport.TransportIndexEmailAccountAction
import org.opensearch.alerting.transport.TransportIndexEmailGroupAction
import org.opensearch.alerting.transport.TransportIndexMonitorAction
import org.opensearch.alerting.transport.TransportSearchEmailAccountAction
import org.opensearch.alerting.transport.TransportSearchEmailGroupAction
import org.opensearch.alerting.transport.TransportSearchMonitorAction
import org.opensearch.action.ActionRequest
import org.opensearch.action.ActionResponse
import org.opensearch.client.Client
Expand Down Expand Up @@ -134,7 +134,7 @@ import java.util.function.Supplier
internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, ReloadablePlugin, Plugin() {

override fun getContextWhitelists(): Map<ScriptContext<*>, List<Whitelist>> {
val whitelist = WhitelistLoader.loadFromResourceFiles(javaClass, "com.amazon.opendistroforelasticsearch.alerting.txt")
val whitelist = WhitelistLoader.loadFromResourceFiles(javaClass, "org.opensearch.alerting.txt")
return mapOf(TriggerScript.CONTEXT to listOf(whitelist))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,51 +24,51 @@
* permissions and limitations under the License.
*/

package com.amazon.opendistroforelasticsearch.alerting

import com.amazon.opendistroforelasticsearch.alerting.alerts.AlertError
import com.amazon.opendistroforelasticsearch.alerting.alerts.AlertIndices
import com.amazon.opendistroforelasticsearch.alerting.alerts.moveAlerts
import com.amazon.opendistroforelasticsearch.alerting.core.JobRunner
import com.amazon.opendistroforelasticsearch.alerting.core.model.ScheduledJob
import com.amazon.opendistroforelasticsearch.alerting.core.model.SearchInput
import com.amazon.opendistroforelasticsearch.alerting.elasticapi.InjectorContextElement
import com.amazon.opendistroforelasticsearch.alerting.elasticapi.convertToMap
import com.amazon.opendistroforelasticsearch.alerting.elasticapi.firstFailureOrNull
import com.amazon.opendistroforelasticsearch.alerting.elasticapi.retry
import com.amazon.opendistroforelasticsearch.alerting.elasticapi.suspendUntil
import com.amazon.opendistroforelasticsearch.alerting.model.ActionExecutionResult
import com.amazon.opendistroforelasticsearch.alerting.model.ActionRunResult
import com.amazon.opendistroforelasticsearch.alerting.model.Alert
import com.amazon.opendistroforelasticsearch.alerting.model.Alert.State.ACKNOWLEDGED
import com.amazon.opendistroforelasticsearch.alerting.model.Alert.State.ACTIVE
import com.amazon.opendistroforelasticsearch.alerting.model.Alert.State.COMPLETED
import com.amazon.opendistroforelasticsearch.alerting.model.Alert.State.DELETED
import com.amazon.opendistroforelasticsearch.alerting.model.Alert.State.ERROR
import com.amazon.opendistroforelasticsearch.alerting.model.AlertingConfigAccessor
import com.amazon.opendistroforelasticsearch.alerting.model.InputRunResults
import com.amazon.opendistroforelasticsearch.alerting.model.Monitor
import com.amazon.opendistroforelasticsearch.alerting.model.MonitorRunResult
import com.amazon.opendistroforelasticsearch.alerting.model.Trigger
import com.amazon.opendistroforelasticsearch.alerting.model.TriggerRunResult
import com.amazon.opendistroforelasticsearch.alerting.model.action.Action
import com.amazon.opendistroforelasticsearch.alerting.model.action.Action.Companion.MESSAGE
import com.amazon.opendistroforelasticsearch.alerting.model.action.Action.Companion.MESSAGE_ID
import com.amazon.opendistroforelasticsearch.alerting.model.action.Action.Companion.SUBJECT
import com.amazon.opendistroforelasticsearch.alerting.model.destination.DestinationContextFactory
import com.amazon.opendistroforelasticsearch.alerting.script.TriggerExecutionContext
import com.amazon.opendistroforelasticsearch.alerting.script.TriggerScript
import com.amazon.opendistroforelasticsearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_COUNT
import com.amazon.opendistroforelasticsearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_MILLIS
import com.amazon.opendistroforelasticsearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_COUNT
import com.amazon.opendistroforelasticsearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_MILLIS
import com.amazon.opendistroforelasticsearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST
import com.amazon.opendistroforelasticsearch.alerting.settings.DestinationSettings.Companion.HOST_DENY_LIST
import com.amazon.opendistroforelasticsearch.alerting.settings.DestinationSettings.Companion.loadDestinationSettings
import com.amazon.opendistroforelasticsearch.alerting.util.IndexUtils
import com.amazon.opendistroforelasticsearch.alerting.util.addUserBackendRolesFilter
import com.amazon.opendistroforelasticsearch.alerting.util.isADMonitor
import com.amazon.opendistroforelasticsearch.alerting.util.isAllowed
package org.opensearch.alerting

import org.opensearch.alerting.alerts.AlertError
import org.opensearch.alerting.alerts.AlertIndices
import org.opensearch.alerting.alerts.moveAlerts
import org.opensearch.alerting.core.JobRunner
import org.opensearch.alerting.core.model.ScheduledJob
import org.opensearch.alerting.core.model.SearchInput
import org.opensearch.alerting.elasticapi.InjectorContextElement
import org.opensearch.alerting.elasticapi.convertToMap
import org.opensearch.alerting.elasticapi.firstFailureOrNull
import org.opensearch.alerting.elasticapi.retry
import org.opensearch.alerting.elasticapi.suspendUntil
import org.opensearch.alerting.model.ActionExecutionResult
import org.opensearch.alerting.model.ActionRunResult
import org.opensearch.alerting.model.Alert
import org.opensearch.alerting.model.Alert.State.ACKNOWLEDGED
import org.opensearch.alerting.model.Alert.State.ACTIVE
import org.opensearch.alerting.model.Alert.State.COMPLETED
import org.opensearch.alerting.model.Alert.State.DELETED
import org.opensearch.alerting.model.Alert.State.ERROR
import org.opensearch.alerting.model.AlertingConfigAccessor
import org.opensearch.alerting.model.InputRunResults
import org.opensearch.alerting.model.Monitor
import org.opensearch.alerting.model.MonitorRunResult
import org.opensearch.alerting.model.Trigger
import org.opensearch.alerting.model.TriggerRunResult
import org.opensearch.alerting.model.action.Action
import org.opensearch.alerting.model.action.Action.Companion.MESSAGE
import org.opensearch.alerting.model.action.Action.Companion.MESSAGE_ID
import org.opensearch.alerting.model.action.Action.Companion.SUBJECT
import org.opensearch.alerting.model.destination.DestinationContextFactory
import org.opensearch.alerting.script.TriggerExecutionContext
import org.opensearch.alerting.script.TriggerScript
import org.opensearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_COUNT
import org.opensearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_MILLIS
import org.opensearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_COUNT
import org.opensearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_MILLIS
import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST
import org.opensearch.alerting.settings.DestinationSettings.Companion.HOST_DENY_LIST
import org.opensearch.alerting.settings.DestinationSettings.Companion.loadDestinationSettings
import org.opensearch.alerting.util.IndexUtils
import org.opensearch.alerting.util.addUserBackendRolesFilter
import org.opensearch.alerting.util.isADMonitor
import org.opensearch.alerting.util.isAllowed
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
Expand Down
Loading

0 comments on commit fbdddee

Please sign in to comment.