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

[8.15] [Discover] Update data view API docs (#187146) #188067

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/api/data-views/create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,13 @@ The API returns the {data-source} object:
.Properties of the fieldAttrs[fieldName] objects:
[%collapsible%open]
=====
`customLabel`:::
`customLabel`::
(Optional, string) Custom label for the field.

`count`:::
`customDescription`::
(Optional, string) Custom description for the field. Max length is 300 characters.

`count`::
(Optional, number) Popularity count for the field.
=====

Expand Down
5 changes: 3 additions & 2 deletions docs/api/data-views/update-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
++++

experimental[] Update fields presentation metadata, such as `count`,
`customLabel`, and `format`. You can update multiple fields in one request. Updates
`customLabel`, `customDescription`, and `format`. You can update multiple fields in one request. Updates
are merged with persisted metadata. To remove existing metadata, specify `null` as the value.


Expand Down Expand Up @@ -119,7 +119,8 @@ $ curl -X POST api/data_views/data_view/my-view/fields
"customLabel": "Foo"
},
"bar": {
"customLabel": "Bar"
"customLabel": "Bar",
"customDescription": "Bar Custom description"
}
}
}
Expand Down
40 changes: 33 additions & 7 deletions src/plugins/data_views/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@
"post": {
"summary": "Update data view fields metadata in the default space",
"operationId": "updateFieldsMetadataDefault",
"description": "Update fields presentation metadata such as count, customLabel and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.\n",
"description": "Update fields presentation metadata such as count, customLabel, customDescription, and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.\n",
"tags": [
"data views"
],
Expand Down Expand Up @@ -2786,11 +2786,16 @@
}
},
"update_field_metadata_request": {
"summary": "Set popularity count for field foo.",
"summary": "Update multiple metadata fields.",
"value": {
"fields": {
"foo": {
"count": 123
"field1": {
"count": 123,
"customLabel": "Field 1 label"
},
"field2": {
"customLabel": "Field 2 label",
"customDescription": "Field 2 description"
}
}
}
Expand Down Expand Up @@ -3465,7 +3470,22 @@
},
"fieldattrs": {
"type": "object",
"description": "A map of field attributes by field name."
"description": "A map of field attributes by field name.",
"properties": {
"count": {
"type": "integer",
"description": "Popularity count for the field."
},
"customDescription": {
"type": "string",
"description": "Custom description for the field.",
"maxLength": 300
},
"customLabel": {
"type": "string",
"description": "Custom label for the field."
}
}
},
"fieldformats": {
"type": "object",
Expand Down Expand Up @@ -3532,7 +3552,10 @@
"$ref": "#/components/schemas/allownoindex"
},
"fieldAttrs": {
"$ref": "#/components/schemas/fieldattrs"
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/fieldattrs"
}
},
"fieldFormats": {
"$ref": "#/components/schemas/fieldformats"
Expand Down Expand Up @@ -3591,7 +3614,10 @@
"$ref": "#/components/schemas/allownoindex"
},
"fieldAttrs": {
"$ref": "#/components/schemas/fieldattrs"
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/fieldattrs"
}
},
"fieldFormats": {
"$ref": "#/components/schemas/fieldformats"
Expand Down
29 changes: 24 additions & 5 deletions src/plugins/data_views/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ paths:
summary: Update data view fields metadata in the default space
operationId: updateFieldsMetadataDefault
description: |
Update fields presentation metadata such as count, customLabel and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.
Update fields presentation metadata such as count, customLabel, customDescription, and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.
tags:
- data views
parameters:
Expand Down Expand Up @@ -1966,11 +1966,15 @@ components:
data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f
force: true
update_field_metadata_request:
summary: Set popularity count for field foo.
summary: Update multiple metadata fields.
value:
fields:
foo:
field1:
count: 123
customLabel: Field 1 label
field2:
customLabel: Field 2 label
customDescription: Field 2 description
create_runtime_field_request:
summary: Create a runtime field.
value:
Expand Down Expand Up @@ -2507,6 +2511,17 @@ components:
fieldattrs:
type: object
description: A map of field attributes by field name.
properties:
count:
type: integer
description: Popularity count for the field.
customDescription:
type: string
description: Custom description for the field.
maxLength: 300
customLabel:
type: string
description: Custom label for the field.
fieldformats:
type: object
description: A map of field formats by field name.
Expand Down Expand Up @@ -2556,7 +2571,9 @@ components:
allowNoIndex:
$ref: '#/components/schemas/allownoindex'
fieldAttrs:
$ref: '#/components/schemas/fieldattrs'
type: object
additionalProperties:
$ref: '#/components/schemas/fieldattrs'
fieldFormats:
$ref: '#/components/schemas/fieldformats'
fields:
Expand Down Expand Up @@ -2596,7 +2613,9 @@ components:
allowNoIndex:
$ref: '#/components/schemas/allownoindex'
fieldAttrs:
$ref: '#/components/schemas/fieldattrs'
type: object
additionalProperties:
$ref: '#/components/schemas/fieldattrs'
fieldFormats:
$ref: '#/components/schemas/fieldformats'
fields:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
summary: Set popularity count for field foo.
summary: Update metadata for multiple fields.
value:
{
"fields": {
"foo": {
"count": 123
"field1": {
"count": 123,
"customLabel": "Field 1 label"
},
"field2": {
"customLabel": "Field 2 label",
"customDescription": "Field 2 description"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ properties:
allowNoIndex:
$ref: 'allownoindex.yaml'
fieldAttrs:
$ref: 'fieldattrs.yaml'
type: object
additionalProperties:
$ref: 'fieldattrs.yaml'
fieldFormats:
$ref: 'fieldformats.yaml'
fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ properties:
allowNoIndex:
$ref: 'allownoindex.yaml'
fieldAttrs:
$ref: 'fieldattrs.yaml'
type: object
additionalProperties:
$ref: 'fieldattrs.yaml'
fieldFormats:
$ref: 'fieldformats.yaml'
fields:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
type: object
description: A map of field attributes by field name.
description: A map of field attributes by field name.
properties:
count:
type: integer
description: Popularity count for the field.
customDescription:
type: string
description: Custom description for the field.
maxLength: 300
customLabel:
type: string
description: Custom label for the field.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ post:
summary: Update data view fields metadata in the default space
operationId: updateFieldsMetadataDefault
description: >
Update fields presentation metadata such as count, customLabel and format.
Update fields presentation metadata such as count, customLabel, customDescription, and format.
This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.
tags:
- data views
Expand Down