kibana/.github
Nick Partridge 17c2556fc6
[Lens] Add internal CRUD api routes (#223296)
## Summary

This adds basic Lens CRUD api routes using the Content Management
system.

| Operation | URI |
|--------|--------|
| Create | `POST api/lens/visualizations` |
| Get | `GET api/lens/visualizations/{id}` |
| Search | `GET api/lens/visualizations?query=test` |
| Update | `PUT api/lens/visualizations/{id}` |
| Delete | `DELETE api/lens/visualizations/{id}` |

### Changes to Lens Content Management

The custom `update` method uses `soClient.create` under the hood for
reasons (i.e. #160116). However, doing this acts as an update or create
method with the provided `id`. I changed this behavior so now any update
where the id is not found will return a `404` error.

Closes #221941
Closes #221942 - OpenAPI docs auto generate from route schema

### Testing

You can testing this locally in kibana dev console like so...

```
GET kbn:/api/lens/visualizations/<id>?apiVersion=1
```

> The `apiVersion` query param is needed to test `internal` api routes.

## Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2025-06-25 20:01:35 +01:00
..
codeql chore: exclude new solution-specific test folders from CodeQL scans (#222741) 2025-06-05 07:53:24 +00:00
ISSUE_TEMPLATE Remove 8.0 breaking change template (#157044) 2023-05-08 15:25:24 -04:00
updatecli/values.d ci(bump automation): bump ubi9 for ironbank (#191660) 2024-10-10 22:00:38 +02:00
workflows [Dependency Review] Skipping health check for draft PRs (#225008) 2025-06-24 07:58:54 -04:00
CODEOWNERS [Lens] Add internal CRUD api routes (#223296) 2025-06-25 20:01:35 +01:00
ISSUE_TEMPLATE.md Add elasticsearch version to issue template 2016-07-25 11:00:27 -05:00
paths-labeller.yml Change path to observability_ai_assistant_management following reloca… (#218571) 2025-04-17 16:41:55 +01:00
PULL_REQUEST_TEMPLATE.md Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653) 2025-01-04 11:47:24 -07:00
relabel.yml Improve needs-team auto labeling regex (#143787) 2022-10-27 09:03:34 -07:00
stale.yml Remove Infra Monitoring UI team (#175745) 2024-01-30 13:33:57 -06:00