Skip to content

Commit

Permalink
HTTP CRUD+ API for Index Patterns (#83576)
Browse files Browse the repository at this point in the history
* refactor: ๐Ÿ’ก extract out createIndexPatternsService() method

* feat: ๐ŸŽธ add create index pattern route

* feat: ๐ŸŽธ add index patterns http context

* feat: ๐ŸŽธ add schema for index pattern create method

* refactor: ๐Ÿ’ก compose schema out of variables

* feat: ๐ŸŽธ allow to not make the new index pattern a default one

* feat: ๐ŸŽธ implement index pattern create endpoint

* docs: โœ๏ธ add index pattern create endpoint docs

* fix: ๐Ÿ› add error handling wrapper

* feat: ๐ŸŽธ add index pattern GET route

* docs: โœ๏ธ add index pattern GET mention to docs

* feat: ๐ŸŽธ add higher order route handler to check for context

* feat: ๐ŸŽธ add index pattern deletion endpoint

* docs: โœ๏ธ add delete endpoint docs entry

* feat: ๐ŸŽธ add index pattern update route

* feat: ๐ŸŽธ add ability to update timeFieldName

* feat: ๐ŸŽธ add ability to edit intervalName, sourceFilters, fields

* feat: ๐ŸŽธ allow updating index pattern type and typeMeta

* feat: ๐ŸŽธ add ability to update index_pattern fields

* docs: โœ๏ธ add index pattern update endpoint docs

* docs: โœ๏ธ fix typo

* feat: ๐ŸŽธ disable XSRF and add Content-Type

* fix: ๐Ÿ› enable xsrf

* feat: ๐ŸŽธ send 404 status code when index pattern is not found

* fix: ๐Ÿ› correctly report empty change set error

* feat: ๐ŸŽธ fields API add route for adding field to IP

* docs: โœ๏ธ add index pattern field create route

* fix: ๐Ÿ› throw on creating an existing index pattern field

* feat: ๐ŸŽธ add field upsert route

* feat: ๐ŸŽธ add field get api endpoint

* feat: ๐ŸŽธ add field delete endpoint

* refactor: ๐Ÿ’ก improve 404 error handling

* refactor: ๐Ÿ’ก improve index pattern 404 error class

* feat: ๐ŸŽธ add field update api endpoint

* docs: โœ๏ธ typo

* refactor: ๐Ÿ’ก rename ski_field_refresh to refresh_fields in creat

* refactor: ๐Ÿ’ก rename to refresh_fields param in update call

* refactor: ๐Ÿ’ก rename parameter to refresh_fields in fields api

* feat: ๐ŸŽธ allow creating and deleting only scripted fields

* style: ๐Ÿ’„ fix TypeScript/Prettier error

* test: ๐Ÿ’ add index pattern creation negative tests

* test: ๐Ÿ’ add index pattern create method tests

* feat: ๐ŸŽธ remove make_default flag

* docs: โœ๏ธ update docs

* test: ๐Ÿ’ add index patter api get tests

* test: ๐Ÿ’ add delete index pattern tests

* fix: ๐Ÿ› fix TypeScript error after refactor

* docs: โœ๏ธ update autogenerated docs

* docs: โœ๏ธ update autogenerated docs

* refactor: ๐Ÿ’ก change Fields API to Scripted Fields API

* feat: ๐ŸŽธ allow only scripted fields in Scripted Fields API

* test: ๐Ÿ’ add index patter api update tests

* test: ๐Ÿ’ add scripted field create api tests

* test: ๐Ÿ’ add scripted field delete api tests

* test: ๐Ÿ’ add scripted fields fetch api tests

* test: ๐Ÿ’ add scripted field field put api tests

* test: ๐Ÿ’ add scripted field update api test

* feat: ๐ŸŽธ add index pattern field update endpoint

* feat: ๐ŸŽธ improve index patterns fields api

* test: ๐Ÿ’ fix test

* docs: โœ๏ธ update docs README

* test: ๐Ÿ’ add field metadata deletion teests

* docs: โœ๏ธ improve index pattern api readme

* fix: ๐Ÿ› fix TypeScript errors

* test: ๐Ÿ’ update jest tests

* docs: โœ๏ธ update auto-generated docs

* feat: ๐ŸŽธ remove intervalName from index pattern create API

* test: ๐Ÿ’ fix integration tests

* fix: ๐Ÿ› make refresh_fields default to false

* chore: ๐Ÿค– remove searchable and aggregatable from public API

* chore: ๐Ÿค– remove various field properties

* chore: ๐Ÿค– remove "index" attribute from public field schema

* docs: โœ๏ธ update docs to match API

* chore: ๐Ÿค– fix TypeScript errors

* test: ๐Ÿ’ try fixing functional tests

* docs: โœ๏ธ update auto-generated docs

* chore: ๐Ÿค– check if this fixes security tests

* fix: ๐Ÿ› create index patterns context only if user is authc

* fix: ๐Ÿ› assert on index patterns service

* test: ๐Ÿ’ try fixing integration tests

* fix: ๐Ÿ› try fixing integration tests

* chore: ๐Ÿค– update auto-generated docs

* refactor: ๐Ÿ’ก directly inject index pattern provider into create

* refactor: ๐Ÿ’ก create index pattern service directly in each route

* refactor: ๐Ÿ’ก remove index pattern route context provider

* chore: ๐Ÿค– remove unused code

* chore: ๐Ÿค– remove refresh_fields from scripted fields

* style: ๐Ÿ’„ change template param names

* refactor: ๐Ÿ’ก make field.count always be an integer

* docs: โœ๏ธ update auto-generated docs

* refactor: ๐Ÿ’ก inject index patterns using getStartServices

* docs: โœ๏ธ update autogenerated docs

* docs: โœ๏ธ update docs
  • Loading branch information
streamich committed Dec 8, 2020
1 parent 1d30283 commit 9bef95a
Show file tree
Hide file tree
Showing 77 changed files with 4,608 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
deleteFieldFormat: (fieldName: string) => void;
readonly deleteFieldFormat: (fieldName: string) => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ export declare class IndexPattern implements IIndexPattern
| [isTimeBased()](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) | | |
| [isTimeNanosBased()](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | Remove scripted field from field list |
| [setFieldAttrs(fieldName, attrName, value)](./kibana-plugin-plugins-data-public.indexpattern.setfieldattrs.md) | | |
| [setFieldCount(fieldName, count)](./kibana-plugin-plugins-data-public.indexpattern.setfieldcount.md) | | |
| [setFieldCustomLabel(fieldName, customLabel)](./kibana-plugin-plugins-data-public.indexpattern.setfieldcustomlabel.md) | | |
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [setFieldAttrs](./kibana-plugin-plugins-data-public.indexpattern.setfieldattrs.md)

## IndexPattern.setFieldAttrs() method

<b>Signature:</b>

```typescript
protected setFieldAttrs<K extends keyof FieldAttrSet>(fieldName: string, attrName: K, value: FieldAttrSet[K]): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| attrName | <code>K</code> | |
| value | <code>FieldAttrSet[K]</code> | |
<b>Returns:</b>
`void`
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [setFieldCount](./kibana-plugin-plugins-data-public.indexpattern.setfieldcount.md)

## IndexPattern.setFieldCount() method

<b>Signature:</b>

```typescript
setFieldCount(fieldName: string, count: number | undefined | null): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| count | <code>number &#124; undefined &#124; null</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [setFieldCustomLabel](./kibana-plugin-plugins-data-public.indexpattern.setfieldcustomlabel.md)

## IndexPattern.setFieldCustomLabel() method

<b>Signature:</b>

```typescript
setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| customLabel | <code>string &#124; undefined &#124; null</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void;
readonly setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) &gt; [deleteCount](./kibana-plugin-plugins-data-public.indexpatternfield.deletecount.md)

## IndexPatternField.deleteCount() method

<b>Signature:</b>

```typescript
deleteCount(): void;
```
<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export declare class IndexPatternField implements IFieldType
| Method | Modifiers | Description |
| --- | --- | --- |
| [deleteCount()](./kibana-plugin-plugins-data-public.indexpatternfield.deletecount.md) | | |
| [toJSON()](./kibana-plugin-plugins-data-public.indexpatternfield.tojson.md) | | |
| [toSpec({ getFormatterForField, })](./kibana-plugin-plugins-data-public.indexpatternfield.tospec.md) | | |
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
deleteFieldFormat: (fieldName: string) => void;
readonly deleteFieldFormat: (fieldName: string) => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ export declare class IndexPattern implements IIndexPattern
| [isTimeBased()](./kibana-plugin-plugins-data-server.indexpattern.istimebased.md) | | |
| [isTimeNanosBased()](./kibana-plugin-plugins-data-server.indexpattern.istimenanosbased.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md) | | Remove scripted field from field list |
| [setFieldAttrs(fieldName, attrName, value)](./kibana-plugin-plugins-data-server.indexpattern.setfieldattrs.md) | | |
| [setFieldCount(fieldName, count)](./kibana-plugin-plugins-data-server.indexpattern.setfieldcount.md) | | |
| [setFieldCustomLabel(fieldName, customLabel)](./kibana-plugin-plugins-data-server.indexpattern.setfieldcustomlabel.md) | | |
| [toSpec()](./kibana-plugin-plugins-data-server.indexpattern.tospec.md) | | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) &gt; [setFieldAttrs](./kibana-plugin-plugins-data-server.indexpattern.setfieldattrs.md)

## IndexPattern.setFieldAttrs() method

<b>Signature:</b>

```typescript
protected setFieldAttrs<K extends keyof FieldAttrSet>(fieldName: string, attrName: K, value: FieldAttrSet[K]): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| attrName | <code>K</code> | |
| value | <code>FieldAttrSet[K]</code> | |
<b>Returns:</b>
`void`
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) &gt; [setFieldCount](./kibana-plugin-plugins-data-server.indexpattern.setfieldcount.md)

## IndexPattern.setFieldCount() method

<b>Signature:</b>

```typescript
setFieldCount(fieldName: string, count: number | undefined | null): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| count | <code>number &#124; undefined &#124; null</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) &gt; [setFieldCustomLabel](./kibana-plugin-plugins-data-server.indexpattern.setfieldcustomlabel.md)

## IndexPattern.setFieldCustomLabel() method

<b>Signature:</b>

```typescript
setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | <code>string</code> | |
| customLabel | <code>string &#124; undefined &#124; null</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void;
readonly setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
export declare class IndexPatternsService implements Plugin<void, IndexPatternsServiceStart>
export declare class IndexPatternsServiceProvider implements Plugin<void, IndexPatternsServiceStart>
```
## Methods
Expand Down
Loading

0 comments on commit 9bef95a

Please sign in to comment.