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

The PUT connector should have connector_id as optional? #2715

Open
ezimuel opened this issue Jul 15, 2024 · 4 comments
Open

The PUT connector should have connector_id as optional? #2715

ezimuel opened this issue Jul 15, 2024 · 4 comments

Comments

@ezimuel
Copy link
Contributor

ezimuel commented Jul 15, 2024

Reading the specification of connector.put endpoint that has 2 URL:

  • /_connector/{connector_id}
  • /_connector

It appears the connector_id should be optional but it's required right now.

Moreover, reading the documentation it seems the connector_id is required and there's no mention about the PUT /_connector URL.

@flobernd
Copy link
Member

cc @jedrazb

@ezimuel
Copy link
Contributor Author

ezimuel commented Jul 15, 2024

I just tried with Elasticsearch 8.14.3 and it seems the PUT /_connector requires the connector_id:

HTTP/1.1 405 Method Not Allowed
Allow: GET,POST
X-elastic-product: Elasticsearch
content-encoding: gzip
content-length: 126
content-type: application/json

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

This means we should remove the path PUT /_connector in the specification.

@ezimuel
Copy link
Contributor Author

ezimuel commented Jul 15, 2024

I just sent this PR to fix the rest-api-spec of Elasticsearch.

@jedrazb
Copy link
Member

jedrazb commented Jul 18, 2024

Hey @ezimuel Thank you for reporting this issue. Since other PUT endpoints in ES generally expect a given resource ID (rather than auto-generating one) when creating a resource, I believe we should adhere to this pattern in the connector API and always expect an ID path param for PUT _connector/{id} requests. Thank you for opening PR in ES!

There appears to be one failing unit test due to validation logic. Let me fix that!

I will include the necessary changes to the client spec as a part of this PR: #2675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants