Skip to content

Commit b6d9058

Browse files
authored
Merge branch 'master' into migrate/ftr-service-class/visualizations
2 parents cda20e2 + ba7c027 commit b6d9058

File tree

295 files changed

+6483
-3717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+6483
-3717
lines changed

.github/ISSUE_TEMPLATE/v8_breaking_change.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ assignees: ''
1313
****************************************
1414
1515
Please add a team label to denote the team that the
16-
breaking change is applicable to.
16+
breaking change is applicable to. If the work requires
17+
changes to Upgrade Assistant itself, please tag Team:Elasticsearch UI.
1718
1819
-->
1920

@@ -23,14 +24,20 @@ breaking change is applicable to.
2324

2425
8.0
2526

27+
**Is this a Kibana or Elasticsearch breaking change?**
28+
29+
<!-- Kibana breaking changes can be registered via the Kibana deprecations service. Elasticsearch breaking changes may require custom logic in Upgrade Assistant and assistance from the Elasticsearch UI team. See more details below. -->
30+
2631
**Describe the change. How will it manifest to users?**
2732

2833
**How many users will be affected?**
2934

3035
<!-- e.g. Based on telemetry data, roughly 75% of our users will need to make changes to x. -->
3136
<!-- e.g. A majority of users will need to make changes to x. -->
3237

33-
**Can the change be registered with the [Kibana deprecation service](https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md)?**
38+
**Are there any edge cases?**
39+
40+
**[For Kibana deprecations] Can the change be registered with the [Kibana deprecation service](https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md)?**
3441

3542
<!-- The deprecation service is consumed by the Upgrade Assistant to surface Kibana deprecations.
3643
It provides a way for Kibana deprecations to be resolved automatically via an API
@@ -39,8 +46,11 @@ breaking change is applicable to.
3946
<!-- Each plugin owner is responsible for registering their deprecations via the service.
4047
Please link to the issue/PR that will add this functionality. -->
4148

42-
**Are there any edge cases?**
49+
**[For Elasticsearch deprecations] Can the Upgrade Assistant make the migration easier for users? Please explain the proposed solution in as much detail as possible.**
50+
51+
<!-- Upgrade Assistant consumes the ES deprecation info API to surface deprecations to users. In some cases, Upgrade Assistant can provide a way to resolve a particular deprecation returned from the API. Examples include: reindexing an old index, removing deprecated index settings, upgrading or deleting an old Machine Learning model snapshot. -->
4352

53+
<!-- Please provide a detailed explanation on how you foresee the proposed "fix" to work, e.g., "The deprecation will be surfaced via XXX message in the deprecation info API. Upgrade Assistant can call XXX API to resolve this deprecation". See https://github.com/elastic/kibana/issues/91879 as a real-world example. -->
4454
## Test Data
4555

4656
<!-- Provide test data. We can’t build a solution without data to test it against. -->

docs/api/index-patterns.asciidoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[[index-patterns-api]]
2+
== Index patterns APIs
3+
4+
experimental[] Manage {kib} index patterns.
5+
6+
WARNING: Do not write documents directly to the `.kibana` index. When you write directly
7+
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.
8+
9+
WARNING: Use the index patterns API for managing {kib} index patterns instead of lower-level <<saved-objects-api, saved objects API>>.
10+
11+
The following index patterns APIs are available:
12+
13+
* Index patterns
14+
** <<index-patterns-api-get, Get index pattern API>> to retrieve a single {kib} index pattern
15+
** <<index-patterns-api-create, Create index pattern API>> to create {kib} index pattern
16+
** <<index-patterns-api-update, Update index pattern API>> to partially updated {kib} index pattern
17+
** <<index-patterns-api-delete, Delete index pattern API>> to delete {kib} index pattern
18+
* Fields
19+
** <<index-patterns-fields-api-update, Update index pattern field>> to change field metadata, such as `count`, `customLabel` and `format`.
20+
21+
22+
23+
include::index-patterns/get.asciidoc[]
24+
include::index-patterns/create.asciidoc[]
25+
include::index-patterns/update.asciidoc[]
26+
include::index-patterns/delete.asciidoc[]
27+
include::index-patterns/update-fields.asciidoc[]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
[[index-patterns-api-create]]
2+
=== Create index pattern API
3+
++++
4+
<titleabbrev>Create index pattern</titleabbrev>
5+
++++
6+
7+
experimental[] Create {kib} index patterns.
8+
9+
[[index-patterns-api-create-request]]
10+
==== Request
11+
12+
`POST <kibana host>:<port>/api/index_patterns/index_pattern`
13+
14+
`POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern`
15+
16+
[[index-patterns-api-create-path-params]]
17+
==== Path parameters
18+
19+
`space_id`::
20+
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
21+
22+
[[index-patterns-api-create-body-params]]
23+
==== Request body
24+
25+
`override`:: (Optional, boolean) Overrides an existing index pattern if an
26+
index pattern with the provided title already exists. The default is `false`.
27+
28+
`refresh_fields`:: (Optional, boolean) Reloads index pattern fields after
29+
the index pattern is stored. The default is `false`.
30+
31+
`index_pattern`:: (Required, object) The index pattern object. All fields are optional.
32+
33+
[[index-patterns-api-create-request-codes]]
34+
==== Response code
35+
36+
`200`::
37+
Indicates a successful call.
38+
39+
[[index-patterns-api-create-example]]
40+
==== Examples
41+
42+
Create an index pattern with a custom title:
43+
44+
[source,sh]
45+
--------------------------------------------------
46+
$ curl -X POST api/index_patterns/index_pattern
47+
{
48+
"index_pattern": {
49+
"title": "hello"
50+
}
51+
}
52+
--------------------------------------------------
53+
// KIBANA
54+
55+
Customize the creation behavior:
56+
57+
[source,sh]
58+
--------------------------------------------------
59+
$ curl -X POST api/index_patterns/index_pattern
60+
{
61+
"override": false,
62+
"refresh_fields": true,
63+
"index_pattern": {
64+
"title": "hello"
65+
}
66+
}
67+
--------------------------------------------------
68+
// KIBANA
69+
70+
At creation, all index pattern fields are optional:
71+
72+
[source,sh]
73+
--------------------------------------------------
74+
$ curl -X POST api/index_patterns/index_pattern
75+
{
76+
"index_pattern": {
77+
"id": "...",
78+
"version": "...",
79+
"title": "...",
80+
"type": "...",
81+
"timeFieldName": "...",
82+
"sourceFilters": [],
83+
"fields": {},
84+
"typeMeta": {},
85+
"fieldFormats": {},
86+
"fieldAttrs": {},
87+
"allowNoIndex": "..."
88+
}
89+
}
90+
--------------------------------------------------
91+
// KIBANA
92+
93+
94+
The API returns the index pattern object:
95+
96+
[source,sh]
97+
--------------------------------------------------
98+
{
99+
"index_pattern": {...}
100+
}
101+
--------------------------------------------------
102+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[[index-patterns-api-delete]]
2+
=== Delete index pattern API
3+
++++
4+
<titleabbrev>Delete index pattern</titleabbrev>
5+
++++
6+
7+
experimental[] Delete {kib} index patterns.
8+
9+
WARNING: Once you delete an index pattern, _it cannot be recovered_.
10+
11+
[[index-patterns-api-delete-request]]
12+
==== Request
13+
14+
`DELETE <kibana host>:<port>/api/index_patterns/index_pattern/<id>`
15+
16+
`DELETE <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>`
17+
18+
[[index-patterns-api-delete-path-params]]
19+
==== Path parameters
20+
21+
`space_id`::
22+
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
23+
24+
`id`::
25+
(Required, string) The ID of the index pattern you want to delete.
26+
27+
[[index-patterns-api-delete-response-codes]]
28+
==== Response code
29+
30+
`200`::
31+
Indicates that index pattern is deleted. Returns an empty response body.
32+
33+
==== Example
34+
35+
Delete an index pattern object with the `my-pattern` ID:
36+
37+
[source,sh]
38+
--------------------------------------------------
39+
$ curl -X DELETE api/index_patterns/index_pattern/my-pattern
40+
--------------------------------------------------
41+
// KIBANA
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[[index-patterns-api-get]]
2+
=== Get index pattern API
3+
++++
4+
<titleabbrev>Get index pattern</titleabbrev>
5+
++++
6+
7+
experimental[] Retrieve a single {kib} index pattern by ID.
8+
9+
[[index-patterns-api-get-request]]
10+
==== Request
11+
12+
`GET <kibana host>:<port>/api/index_patterns/index_pattern/<id>`
13+
14+
`GET <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>`
15+
16+
[[index-patterns-api-get-params]]
17+
==== Path parameters
18+
19+
`space_id`::
20+
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
21+
22+
`id`::
23+
(Required, string) The ID of the index pattern you want to retrieve.
24+
25+
[[index-patterns-api-get-codes]]
26+
==== Response code
27+
28+
`200`::
29+
Indicates a successful call.
30+
31+
`404`::
32+
The specified index pattern and ID doesn't exist.
33+
34+
[[index-patterns-api-get-example]]
35+
==== Example
36+
37+
Retrieve the index pattern object with the `my-pattern` ID:
38+
39+
[source,sh]
40+
--------------------------------------------------
41+
$ curl -X GET api/index_patterns/index_pattern/my-pattern
42+
--------------------------------------------------
43+
// KIBANA
44+
45+
The API returns an index pattern object:
46+
47+
[source,sh]
48+
--------------------------------------------------
49+
{
50+
"index_pattern": {
51+
"id": "my-pattern",
52+
"version": "...",
53+
"title": "...",
54+
"type": "...",
55+
"timeFieldName": "...",
56+
"sourceFilters": [],
57+
"fields": {},
58+
"typeMeta": {},
59+
"fieldFormats": {},
60+
"fieldAttrs": {},
61+
"allowNoIndex: "..."
62+
}
63+
}
64+
--------------------------------------------------
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
[[index-patterns-fields-api-update]]
2+
=== Update index pattern fields API
3+
++++
4+
<titleabbrev>Update index pattern fields metadata</titleabbrev>
5+
++++
6+
7+
experimental[] Update fields presentation metadata, such as `count`,
8+
`customLabel`, and `format`. You can update multiple fields in one request. Updates
9+
are merged with persisted metadata. To remove existing metadata, specify `null` as the value.
10+
11+
[[index-patterns-fields-api-update-request]]
12+
==== Request
13+
14+
`POST <kibana host>:<port>/api/index_patterns/index_pattern/<id>/fields`
15+
16+
`POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>/fields`
17+
18+
[[index-patterns-fields-api-update-path-params]]
19+
==== Path parameters
20+
21+
`space_id`::
22+
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
23+
24+
`id`::
25+
(Required, string) The ID of the index pattern fields you want to update.
26+
27+
[[index-patterns-fields-api-update-request-body]]
28+
==== Request body
29+
30+
`fields`::
31+
(Required, object) the field object
32+
33+
34+
[[index-patterns-fields-api-update-errors-codes]]
35+
==== Response code
36+
37+
`200`::
38+
Indicates a successful call.
39+
40+
[[index-patterns-fields-api-update-example]]
41+
==== Examples
42+
43+
Set popularity `count` for field `foo`:
44+
45+
[source,sh]
46+
--------------------------------------------------
47+
$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
48+
{
49+
"fields": {
50+
"foo": {
51+
"count": 123
52+
}
53+
}
54+
}
55+
--------------------------------------------------
56+
// KIBANA
57+
58+
Update multiple metadata fields in one request:
59+
60+
[source,sh]
61+
--------------------------------------------------
62+
$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
63+
{
64+
"fields": {
65+
"foo": {
66+
"count": 123,
67+
"customLabel": "Foo"
68+
},
69+
"bar": {
70+
"customLabel": "Bar"
71+
}
72+
}
73+
}
74+
--------------------------------------------------
75+
// KIBANA
76+
77+
Use `null` value to delete metadata:
78+
[source,sh]
79+
--------------------------------------------------
80+
$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields
81+
{
82+
"fields": {
83+
"foo": {
84+
"customLabel": null
85+
}
86+
}
87+
}
88+
--------------------------------------------------
89+
// KIBANA
90+
91+
92+
The endpoint returns the updated index pattern object:
93+
[source,sh]
94+
--------------------------------------------------
95+
{
96+
"index_pattern": {
97+
98+
}
99+
}
100+
--------------------------------------------------

0 commit comments

Comments
 (0)