Skip to content

Handle index not exists for detector search and delete#396

Merged
eirsep merged 1 commit intoopensearch-project:mainfrom
eirsep:handle_404
Apr 12, 2023
Merged

Handle index not exists for detector search and delete#396
eirsep merged 1 commit intoopensearch-project:mainfrom
eirsep:handle_404

Conversation

@eirsep
Copy link
Copy Markdown
Member

@eirsep eirsep commented Apr 12, 2023

Description

Detector search api throws 404 when detector config index doesn't exist. this PR fixes that scenario to return a 0 hits search response.

Detector deletion API returns message that index is not found when index doesnt exist. Fixed it to return "detector not found" message.

Issues Resolved

#206 #370

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@eirsep eirsep requested a review from a team April 12, 2023 18:09
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
@eirsep eirsep merged commit e50c70a into opensearch-project:main Apr 12, 2023
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.5 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-396-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e50c70ab8bdbd55337598cc4b3f5c68b7fb9525d
# Push it to GitHub
git push --set-upstream origin backport/backport-396-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5

Then, create a pull request where the base branch is 2.5 and the compare/head branch is backport/backport-396-to-2.5.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 12, 2023
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit e50c70a)
eirsep added a commit that referenced this pull request Apr 12, 2023
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit e50c70a)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
petardz pushed a commit to petardz/security-analytics that referenced this pull request May 2, 2023
…oject#396)

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
AWSHurneyt pushed a commit to AWSHurneyt/security-analytics that referenced this pull request Jun 9, 2023
…oject#396) (opensearch-project#397)

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit e50c70a)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
AWSHurneyt added a commit that referenced this pull request Jun 9, 2023
* handle index not exists for detector search and delete (#396) (#397)

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit e50c70a)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>

* Handle monitor or monitor index not exists during detector deletion (#384) (#398)

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 6271399)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

---------

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
riysaxen-amzn pushed a commit to riysaxen-amzn/security-analytics that referenced this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants