Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Delete Detector results to SDK using SDKRestClient #378

Closed
1 task
Tracked by #5224
dbwiddis opened this issue Jan 29, 2023 · 2 comments
Closed
1 task
Tracked by #5224

Migrate Delete Detector results to SDK using SDKRestClient #378

dbwiddis opened this issue Jan 29, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@dbwiddis
Copy link
Member

Is your feature request related to a problem?

Part of opensearch-project/OpenSearch#5224

What solution would you like?

Migrate the Delete Detector results Rest API to Extensions SDK using SDKRestClient.

Use the implementation of #353 as a reference. Add new issues for any steps you skip.

Implement the following API endpoints:

  • DELETE _plugins/_anomaly_detection/detectors/results
@owaiskazi19
Copy link
Member

owaiskazi19 commented Mar 29, 2023

Delete Detector Results requires the index pattern ALL_AD_RESULTS_INDEX_PATTERN which will be created as a part of Start Detector: #383

Tasks:

  • Create a basic template for Delete Detector Results
  • Migrate the arguments to match up with SDK
  • Use Java Client to parse JSON query to request -> Used high level rest client to achieve this
  • Test the workflow

@owaiskazi19
Copy link
Member

API: DELETE localhost:9200/_extensions/_ad-extension/detectors/results

{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "detector_id": {
              "value": "XqAwu4cBQBVk3lUtpDvr"
            }
          }
        }
      ]
    }
  }
}

Response:

{
    "took": 304,
    "timed_out": false,
    "total": 20,
    "updated": 0,
    "created": 0,
    "deleted": 20,
    "batches": 1,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1.0,
    "throttled_until_millis": 0,
    "failures": []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants