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

[BUG] Alerting API throws 405 error #1078

Open
prudhvigodithi opened this issue Aug 4, 2023 · 2 comments
Open

[BUG] Alerting API throws 405 error #1078

prudhvigodithi opened this issue Aug 4, 2023 · 2 comments
Labels
documentation needed Issue was created due to gaps in documentationn that doesnt make this functionality clear enough

Comments

@prudhvigodithi
Copy link
Member

prudhvigodithi commented Aug 4, 2023

What is the bug?
Following the documentation to create an alerting destination https://opensearch.org/docs/latest/observing-your-data/alerting/api/#create-destination, I have the following command

curl -XPOST "http://admin:admin@localhost:9200/_plugins/_alerting/destinations" -d "{'name': 'my-destination','type': 'slack','slack': {'url': 'http://www.example.com/'}}"  -H 'Content-Type: application/json'

However I get the following error:

{"error":"Incorrect HTTP method for uri [/_plugins/_alerting/destinations] and method [POST], allowed: [GET]","status":405}

For 1.x it used be /_opendistro/_alerting/destinations and works fine but /_plugins/_alerting/destinations throws 405 error. Is this a bug from alerting API?

Do you have any additional context?
I’m working on to adding 2.x support for terraform provider opensearch-project/terraform-provider-opensearch#62 and found this issue.
Related Issues:
opensearch-project/terraform-provider-opensearch#30
opensearch-project/documentation-website#1994
https://forum.opensearch.org/t/unable-to-create-alerting-destination-in-v2-1-0/10479

@prudhvigodithi prudhvigodithi added bug Something isn't working untriaged labels Aug 4, 2023
@prudhvigodithi
Copy link
Member Author

The notifications API works _plugins/_notifications/configs
https://opensearch.org/docs/latest/observing-your-data/notifications/api/
so the destination is now called channel ?

curl -d '{
  "config_id": "sample-id",
  "name": "sample-name",
  "config": {
    "name": "Sample Slack Channel",
    "description": "This is a Slack channel",
    "config_type": "slack",
    "is_enabled": true,
    "slack": {
      "url": "https://sample-slack-webhook/"
    }
  }
}' -H "Content-Type: application/json" -X POST 'http://admin:admin@localhost:9200/_plugins/_notifications/configs/'

@lezzago lezzago added documentation needed Issue was created due to gaps in documentationn that doesnt make this functionality clear enough and removed bug Something isn't working untriaged labels Aug 12, 2023
@lezzago
Copy link
Member

lezzago commented Aug 12, 2023

Oh the documentation is not updated. Alerting destinations have been deprecated in 2.0 and we do not allow the creation of new alerting destinations. The user needs to use Notification channels instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation needed Issue was created due to gaps in documentationn that doesnt make this functionality clear enough
Projects
None yet
Development

No branches or pull requests

2 participants