Skip to content

[* As Code] Use PUT for upserts #260047

@ThomThomson

Description

@ThomThomson

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.

Metadata

Metadata

Assignees

Labels

Team:PresentationPresentation 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.loe:mediumMedium Level of Effort

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions