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

[EPM] Change EPM package api route from POST to PUT #62479

Closed
neptunian opened this issue Apr 3, 2020 · 6 comments
Closed

[EPM] Change EPM package api route from POST to PUT #62479

neptunian opened this issue Apr 3, 2020 · 6 comments
Labels
Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team technical debt Improvement of the software architecture and operational architecture

Comments

@neptunian
Copy link
Contributor

neptunian commented Apr 3, 2020

PUTing a package will install a package if it does not exist or perform an update if it does. Updating a package to a new version is similar to just installing a package.

The route to change:
/api/ingest_manager/epm/packages/nginx-1.2.0

@jfsiii Let me know if you see any issues with this proposed change

@neptunian neptunian added Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team labels Apr 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Feature:EPM)

@jfsiii
Copy link
Contributor

jfsiii commented Apr 3, 2020

I believe the consensus was to use GET for read and POST for the others, but we do use DELETE and perhaps PUT elsewhere already.

I think PUT is ok for "upsert" and should be nbd if we want to change later 👍

@neptunian
Copy link
Contributor Author

Okay, not sure why we came to that consensus. Because this action is idempotent I think PUT is more intuitive.

@jfsiii
Copy link
Contributor

jfsiii commented Apr 3, 2020

It was during a weekly sync. Good Enough™️ is my TL;DR; There can be issues with PUT and DELETE. I think our specific example was @jen-huang using POST over DELETE due to an issue passing ids(?)

@neptunian neptunian changed the title [EPM] Change install package api from POST to PUT [EPM] Change EPM package api route from POST to PUT Apr 3, 2020
@nchaulet
Copy link
Member

nchaulet commented Apr 3, 2020

Yes the jen example was using POST for bulk delete operation I think it's still ok to use DELETE for operation that concern one resource only.

@joshdover
Copy link
Contributor

Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

6 participants