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

REST-like CRUD+ HTTP API for index patterns #72360

Closed
17 tasks done
mattkime opened this issue Jul 17, 2020 · 4 comments · Fixed by #83576
Closed
17 tasks done

REST-like CRUD+ HTTP API for index patterns #72360

mattkime opened this issue Jul 17, 2020 · 4 comments · Fixed by #83576
Assignees
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0

Comments

@mattkime
Copy link
Contributor

mattkime commented Jul 17, 2020

Create a REST API for index patterns—a wrapper around the Index Patterns service.

  • CRUD
    • Create — POST /api/index_patterns/index_pattern
    • Read — GET /api/index_patterns/index_pattern/{id}
    • Delete — DELETE /api/index_patterns/index_pattern/{id}
  • Update portion of an index pattern — POST /api/index_patterns/index_pattern/{id}
    • title
    • timeFieldName
    • intervalName
    • fields
      • Optionally refresh fields.
    • sourceFilters
    • fieldFormatMap
    • type
    • typeMeta
  • Fields API
    • Create a new field — POST /api/index_patterns/index_pattern/{id}/field
    • Read a new field — GET /api/index_patterns/index_pattern/{id}/field/{name}
    • Update a an existing field — POST /api/index_patterns/index_pattern/{id}/field/{name}
    • Upsert a field — PUT /api/index_patterns/index_pattern/{id}/field
    • Remove a field — DELETE /api/index_patterns/index_pattern/{id}/field/{name}
@mattkime mattkime added Feature:Data Views Data Views code and UI - index patterns before 8.0 Team:AppArch labels Jul 17, 2020
@mattkime mattkime self-assigned this Jul 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@samtriolo
Copy link

A couple use cases for myself -

  1. creating an index pattern after I’ve created a new index - all I typically need to do is select the index name and default time series, if applicable, and it’s gtg.

  2. modify an existing index pattern - remove or update a field in an existing index pattern.

@walterra
Copy link
Contributor

walterra commented Oct 5, 2020

This could be quite useful if you're using other parts of ES via APIs programmatically and in the same workflow you'd want to make indices accessible for Kibana users without manually creating an index pattern yourself.

For example, a Python developer might use Machine Learning analytics. The results will be written to a destination index. When using the ML plugin's Kibana UI you can opt in to create an index pattern, but if you're just using the ES API in Python that option is not available. So you'd need to go to Kibana and manually create an index pattern so other users can view the results for example in Kibana Discover.

Here's a repository with an exemplary workflow on how data scientists can use Python/Jupyter notebooks in combination with Kibana: https://github.com/walterra/jupyter2kibana — a REST API for index patterns would be a great addition!

Even our own Python library eland (https://github.com/elastic/eland) could make use of that API under the hood! https://github.com/elastic/eland

@samtriolo
Copy link

@walterra explained it much better than I did, but that's basically the use case I was trying to outline in my comment. I create indices programmatically all the time, and yet there's always the manual step of having to create the index pattern. For me, it's only a couple things I specify each time, eg the time series, so it seems it would be relatively straightforward to build a programmatic interface for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants