-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[* As Code] Use PUT for upserts #260047
Copy link
Copy link
Closed
Labels
Team:PresentationPresentation Team for Dashboard, Input Controls, and Canvas t//Presentation Team for Dashboard, Input Controls, and Canvas t//impact:criticalThis issue should be addressed immediately due to a critical level of impact on the product.This issue should be addressed immediately due to a critical level of impact on the product.loe:mediumMedium Level of EffortMedium Level of Effort
Metadata
Metadata
Assignees
Labels
Team:PresentationPresentation Team for Dashboard, Input Controls, and Canvas t//Presentation Team for Dashboard, Input Controls, and Canvas t//impact:criticalThis issue should be addressed immediately due to a critical level of impact on the product.This issue should be addressed immediately due to a critical level of impact on the product.loe:mediumMedium Level of EffortMedium Level of Effort
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, creating any as code resource with a custom ID is done via a POST on the
/api/{RESOURCE_NAME}/{MY_ID}endpoint. Currently the operation fails when the specified ID already exists.To update a Dashboard by its id, users need to run a PUT request against the
/api/{RESOURCE_NAME}/{MY_ID}endpoint. Currently, the operation fails when the specified ID does not yet exist.To be more aligned with general REST best practices we should change the POST verb to not accept a custom ID, and instead always generate a new ID for the resource.
The PUT verb should be updated to perform an upsert - creating the resource if it doesn't exist, or overwriting the resource if it does not exist.
This change will need to be made to all existing as code resources - Lens, Markdown, Dashboards etc.