Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add settings to disable/enable AD dynamically #105

Merged
merged 1 commit into from
May 4, 2020

Conversation

kaituo
Copy link
Member

@kaituo kaituo commented May 4, 2020

Issue #, if available:

Description of changes:

This PR adds settings to disable/enable AD dynamically. AD plugin rejects RESTful requests and stops AD jobs when it is disabled.

Testing done:

  • added tests to verify if AD plugin rejects RESTful requests when it is disabled
  • manually verified AD jobs are stopped when AD plugin is disabled

Usage:

curl -XPUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "opendistro.anomaly_detection.enabled": false
  }
}'

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kaituo kaituo requested review from jngz-es and ylwu-amzn May 4, 2020 21:40
/**
* AD plugin enable/disable setting
*/
put(AD_PLUGIN_ENABLED, Setting.boolSetting(AD_PLUGIN_ENABLED, true, NodeScope, Dynamic));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will set AD plugin as enabled by default. After user disabling it and restart domain, are we able to read the latest configuration and set AD as disabled by defulat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on whether they do it in a transient fashion or persistent fashion. If transient, after reboot, it would be enabled by default. If persistent, after reboot, it would disabled by default.

Copy link
Contributor

@ylwu-amzn ylwu-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the change.

This PR adds settings to disable/enable AD dynamically.  AD plugin rejects RESTful requests and stops AD jobs when it is disabled.

Testing done:
- added tests to verify if AD plugin rejects RESTful requests when it is disabled
- manually verified AD jobs are stopped when AD plugin is disabled
@kaituo kaituo merged commit 8109660 into opendistro-for-elasticsearch:opendistro-1.4 May 4, 2020
kaituo added a commit to kaituo/anomaly-detection that referenced this pull request May 19, 2020
…search#105)

This PR adds settings to disable/enable AD dynamically.  AD plugin rejects RESTful requests and stops AD jobs when it is disabled.

Testing done:
- added tests to verify if AD plugin rejects RESTful requests when it is disabled
- manually verified AD jobs are stopped when AD plugin is disabled
kaituo added a commit that referenced this pull request May 19, 2020
…" (#127)

* Add settings to disable/enable AD dynamically (#105)

This PR adds settings to disable/enable AD dynamically.  AD plugin rejects RESTful requests and stops AD jobs when it is disabled.

Testing done:
- added tests to verify if AD plugin rejects RESTful requests when it is disabled
- manually verified AD jobs are stopped when AD plugin is disabled

* Add locale encoding as tests complains about UTF issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants