-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboards][Discuss] Public API URL path #193758
Comments
Pinging @elastic/kibana-presentation (Team:Presentation) |
My preference would be to start standardizing on: So in this case: GET This doesn't prevent a future use of: This is the common usage pattern I've seen in the industry and avoids the redundancy of identifying a |
True. My primary concern with this is a very strict edge case. Consider that we allow users to optionally specify the saved object ID of their dashboard at Later we decide to add a That said, I do like the shorter and REST-like path you propose. But I wonder if that should restrict us from creating any other paths (e.g. I guess it really comes down to the question, does |
Could we not have To me, this pattern still makes sense and removes the edge case you mentioned @nickpeihl 🤔 But not sure if we want to be that explicit or if it's better to keep everything under the same level. |
IMO, this further muddles the question of what is |
I would suggest keeping our API path names focused on resources rather than individual applications. Applications are somewhat malleable, but resources generally aren't. This is especially true for platform-owned components. (e.g. what if we start including dashboards inside other applications in the future? would APIs need to change to A focus on applications also risks us designing our APIs around the org structure, when for users our entire platform API surface area should ideally feel like one product built by one team. My general sense here is that we probably shouldn't overthink this... simpler is usually better, and changing path names in the future is a low maintenance burden (i.e. we can easily register the same route handler for multiple paths if needed) cc @kobelb for his input |
I agree with Luke. We should keep this simple for the time being, and not try to future proof ourselves. My preference is that we use
If in the future, we want a HTTP API for dashboard config, this leaves us with two options.
A similar approach could be followed if we want to set a default dashboard. |
Prior to making the Dashboards Public API available, we should decide on how best to organize the base URL path for the CRUD routes.
Two suggested base paths are
/api/dashboards
/api/dashboards/dashboard
The expected CRUD routes for Dashboards use the following HTTP verbs and URL templates.
Create
POST <BASEPATH>/{id?}
- creates a new Dashboard using theattributes
in the request body. In the URLid
is the optionally specified saved object id. Ifid
is not provided, then a random uuid is used.Read
GET <BASEPATH>/{id}
- retrieves a Dashboard with the matching saved object id.Update
PUT <BASEPATH>/{id}
- updates an existing Dashboard using theattributes
in the request body. Theid
in the URL is required and must match an existing saved object.Delete
DELETE <BASEPATH>/{id}
- deletes an existing Dashboard that matches the provided saved object id.List
GET <BASEPATH>
- retrieves a paginated list of Dashboards. The URL may contain a query string that can be used to filter dashboards.Kibana has a mixed usage when it comes to organizing API paths for CRUD:
/api/data_views/data_view
for CRUD routes. Based on a conversation with @mattkime the CRUD routes were likely organized under thedata_views
domain to allow for future paths like/api/data_vews/default
for setting the default data view./api/alerting/rule
for CRUD routes. But there are additional non-CRUD routes under thealerting
domain such as rule_types and _health. This path also has the deprecated/api/alerting/alert
under the alerting domain./api/agents
as the basepath for the Read, Update, and Delete routes. Additionally some other operations such as bulk reassign and initiate agent setup fall under theagents
domain./api/observability/slos
, presumably this allows for other operations or CRUD routes to be created under the observability domain. However, the Synthetics APIs notably do not use theobservability
domain and instead use the top-levelsynthetics
domain formonitors
andparams
.The text was updated successfully, but these errors were encountered: