[OAS] Add data views openAPI folder and first entrypoints (#163444)

This commit is contained in:
Lisa Cawley 2023-08-10 08:32:28 -07:00 committed by GitHub
parent 263c534429
commit 531127c4b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 7061 additions and 0 deletions

View file

@ -6,6 +6,11 @@
experimental[] Create data views. experimental[] Create data views.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-create-request]] [[data-views-api-create-request]]
==== Request ==== Request

View file

@ -6,6 +6,11 @@
experimental[] Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one. experimental[] Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-default-get-request]] [[data-views-api-default-get-request]]
==== Request ==== Request

View file

@ -7,6 +7,11 @@
experimental[] Set a default data view ID. Kibana UI will use the default data view unless user picks a different one. experimental[] Set a default data view ID. Kibana UI will use the default data view unless user picks a different one.
The API doesn't validate if given `data_view_id` is a valid id. The API doesn't validate if given `data_view_id` is a valid id.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-default-set-request]] [[data-views-api-default-set-request]]
==== Request ==== Request

View file

@ -8,6 +8,11 @@ experimental[] Delete data views.
WARNING: Once you delete a data view, _it cannot be recovered_. WARNING: Once you delete a data view, _it cannot be recovered_.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-delete-request]] [[data-views-api-delete-request]]
==== Request ==== Request

View file

@ -6,6 +6,12 @@
experimental[] Retrieve a list of all data views. experimental[] Retrieve a list of all data views.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-get-all-request]] [[data-views-api-get-all-request]]
==== Request ==== Request

View file

@ -6,6 +6,11 @@
experimental[] Retrieve a single data view by ID. experimental[] Retrieve a single data view by ID.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-get-request]] [[data-views-api-get-request]]
==== Request ==== Request

View file

@ -6,6 +6,11 @@
experimental[] Get a runtime field experimental[] Get a runtime field
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-runtime-field-get-request]] [[data-views-runtime-field-get-request]]
==== Request ==== Request

View file

@ -7,6 +7,11 @@
experimental[] Update part of an data view. Only the specified fields are updated in the experimental[] Update part of an data view. Only the specified fields are updated in the
data view. Unspecified fields stay as they are persisted. data view. Unspecified fields stay as they are persisted.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
====
[[data-views-api-update-request]] [[data-views-api-update-request]]
==== Request ==== Request

View file

@ -0,0 +1,35 @@
# OpenAPI (Experimental)
The current self-contained spec file is available as `bundled.json` or `bundled.yaml` and can be used for online tools like those found at <https://openapi.tools/>.
This spec is experimental and may be incomplete or change later.
A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).
## The `openapi` folder
* `entrypoint.yaml` is the overview file which pulls together all the paths and components.
* [Paths](paths/README.md): Defines each endpoint. A path can have one operation per http method.
* [Components](components/README.md): Defines reusable components.
## Tools
It is possible to validate the docs before bundling them with the following
command:
```bash
npx swagger-cli validate entrypoint.yaml
```
Then you can generate the `bundled` files by running the following commands:
```bash
npx @redocly/cli bundle entrypoint.yaml --output bundled.yaml --ext yaml
npx @redocly/cli bundle entrypoint.yaml --output bundled.json --ext json
```
After generating the json bundle ensure that it is also valid by running the following command:
```bash
npx @redocly/cli lint bundled.json
```

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,16 @@
summary: Create a data view with runtime fields.
value:
{
"data_view": {
"title": "logstash-*",
"name": "My Logstash data view",
"runtimeFieldMap": {
"runtime_shape_name": {
"type": "keyword",
"script": {
"source": "emit(doc['shape_name'].value)"
}
}
}
}
}

View file

@ -0,0 +1,50 @@
summary: The create data view API returns a JSON object that contains details about the new data view.
value:
{
"data_view": {
"id": "b561acfb-0181-455e-84a3-ce8980b2272f",
"version": "WzQ5LDJd",
"title": "logstash-*",
"sourceFilters": [],
"fields": {
"runtime_shape_name": {
"count": 0,
"name": "runtime_shape_name",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"runtimeField": {
"type": "keyword",
"script": {
"source": "emit(doc['shape_name'].value)"
}
}
}
},
"typeMeta": {},
"fieldFormats": {},
"runtimeFieldMap": {
"runtime_shape_name": {
"type": "keyword",
"script": {
"source": "emit(doc['shape_name'].value)"
}
}
},
"fieldAttrs": {},
"allowNoIndex": false,
"name": "My Logstash data view",
"namespaces": [
"default"
]
}
}

View file

@ -0,0 +1,31 @@
summary: The get all data views API returns a list of data views.
value:
{
"data_view": [
{
"id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f",
"namespaces": [
"default"
],
"title": "kibana_sample_data_ecommerce",
"typeMeta": {},
"name": "Kibana Sample Data eCommerce"
},
{
"id": "d3d7af60-4c81-11e8-b3d7-01146121b73d",
"namespaces": [
"default"
],
"title": "kibana_sample_data_flights",
"name": "Kibana Sample Data Flights"
},
{
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"namespaces": [
"default"
],
"title": "kibana_sample_data_logs",
"name": "Kibana Sample Data Logs"
}
]
}

View file

@ -0,0 +1,5 @@
summary: The get default data view API returns the default data view identifier.
value:
{
"data_view_id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
}

View file

@ -0,0 +1,617 @@
summary: The get runtime field API returns a JSON object that contains information about the runtime field (`hour_of_day`) and the data view (`d3d7af60-4c81-11e8-b3d7-01146121b73d`).
value:
{
"fields": [
{
"count": 0,
"name": "hour_of_day",
"type": "number",
"esTypes": [
"long"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false,
"shortDotsEnable": false,
"runtimeField": {
"type": "long",
"script": {
"source": "emit(doc['timestamp'].value.getHour());"
}
}
}
],
"data_view": {
"id": "d3d7af60-4c81-11e8-b3d7-01146121b73d",
"version": "WzM2LDJd",
"title": "kibana_sample_data_flights",
"timeFieldName": "timestamp",
"sourceFilters": [],
"fields": {
"hour_of_day": {
"count": 0,
"name": "hour_of_day",
"type": "number",
"esTypes": [
"long"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false,
"format": {
"id": "number",
"params": {
"pattern": "00"
}
},
"shortDotsEnable": false,
"runtimeField": {
"type": "long",
"script": {
"source": "emit(doc['timestamp'].value.getHour());"
}
}
},
"AvgTicketPrice": {
"count": 0,
"name": "AvgTicketPrice",
"type": "number",
"esTypes": [
"float"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number",
"params": {
"pattern": "$0,0.[00]"
}
},
"shortDotsEnable": false,
"isMapped": true
},
"Cancelled": {
"count": 0,
"name": "Cancelled",
"type": "boolean",
"esTypes": [
"boolean"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "boolean"
},
"shortDotsEnable": false,
"isMapped": true
},
"Carrier": {
"count": 0,
"name": "Carrier",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"Dest": {
"count": 0,
"name": "Dest",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DestAirportID": {
"count": 0,
"name": "DestAirportID",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DestCityName": {
"count": 0,
"name": "DestCityName",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DestCountry": {
"count": 0,
"name": "DestCountry",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DestLocation": {
"count": 0,
"name": "DestLocation",
"type": "geo_point",
"esTypes": [
"geo_point"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "geo_point",
"params": {
"transform": "wkt"
}
},
"shortDotsEnable": false,
"isMapped": true
},
"DestRegion": {
"count": 0,
"name": "DestRegion",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DestWeather": {
"count": 0,
"name": "DestWeather",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"DistanceKilometers": {
"count": 0,
"name": "DistanceKilometers",
"type": "number",
"esTypes": [
"float"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"DistanceMiles": {
"count": 0,
"name": "DistanceMiles",
"type": "number",
"esTypes": [
"float"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightDelay": {
"count": 0,
"name": "FlightDelay",
"type": "boolean",
"esTypes": [
"boolean"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "boolean"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightDelayMin": {
"count": 0,
"name": "FlightDelayMin",
"type": "number",
"esTypes": [
"integer"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightDelayType": {
"count": 0,
"name": "FlightDelayType",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightNum": {
"count": 0,
"name": "FlightNum",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightTimeHour": {
"count": 0,
"name": "FlightTimeHour",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"FlightTimeMin": {
"count": 0,
"name": "FlightTimeMin",
"type": "number",
"esTypes": [
"float"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"Origin": {
"count": 0,
"name": "Origin",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginAirportID": {
"count": 0,
"name": "OriginAirportID",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginCityName": {
"count": 0,
"name": "OriginCityName",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginCountry": {
"count": 0,
"name": "OriginCountry",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginLocation": {
"count": 0,
"name": "OriginLocation",
"type": "geo_point",
"esTypes": [
"geo_point"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "geo_point",
"params": {
"transform": "wkt"
}
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginRegion": {
"count": 0,
"name": "OriginRegion",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"OriginWeather": {
"count": 0,
"name": "OriginWeather",
"type": "string",
"esTypes": [
"keyword"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"_id": {
"count": 0,
"name": "_id",
"type": "string",
"esTypes": [
"_id"
],
"scripted": false,
"searchable": true,
"aggregatable": false,
"readFromDocValues": false,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"_index": {
"count": 0,
"name": "_index",
"type": "string",
"esTypes": [
"_index"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false,
"format": {
"id": "string"
},
"shortDotsEnable": false,
"isMapped": true
},
"_score": {
"count": 0,
"name": "_score",
"type": "number",
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"_source": {
"count": 0,
"name": "_source",
"type": "_source",
"esTypes": [
"_source"
],
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false,
"format": {
"id": "_source"
},
"shortDotsEnable": false,
"isMapped": true
},
"dayOfWeek": {
"count": 0,
"name": "dayOfWeek",
"type": "number",
"esTypes": [
"integer"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "number"
},
"shortDotsEnable": false,
"isMapped": true
},
"timestamp": {
"count": 0,
"name": "timestamp",
"type": "date",
"esTypes": [
"date"
],
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true,
"format": {
"id": "date"
},
"shortDotsEnable": false,
"isMapped": true
}
},
"fieldFormats": {
"hour_of_day": {
"id": "number",
"params": {
"pattern": "00"
}
},
"AvgTicketPrice": {
"id": "number",
"params": {
"pattern": "$0,0.[00]"
}
}
},
"runtimeFieldMap": {
"hour_of_day": {
"type": "long",
"script": {
"source": "emit(doc['timestamp'].value.getHour());"
}
}
},
"fieldAttrs": {},
"allowNoIndex": false,
"name": "Kibana Sample Data Flights"
}
}

View file

@ -0,0 +1,6 @@
summary: Set the default data view identifier.
value:
{
"data_view_id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f",
"force": true
}

View file

@ -0,0 +1,11 @@
summary: Update some properties for a data view.
value:
{
"data_view": {
"title": "kibana_sample_data_ecommerce",
"timeFieldName": "order_date",
"allowNoIndex": false,
"name": "Kibana Sample Data eCommerce"
},
"refresh_fields": true
}

View file

@ -0,0 +1,6 @@
schema:
type: string
in: header
name: kbn-xsrf
description: Cross-site request forgery protection
required: true

View file

@ -0,0 +1,7 @@
in: path
name: fieldName
description: The name of the runtime field.
required: true
schema:
type: string
example: hour_of_day

View file

@ -0,0 +1,7 @@
in: path
name: viewId
description: An identifier for the data view.
required: true
schema:
type: string
example: ff959d40-b880-11e8-a6d9-e546fe2bba5f

View file

@ -0,0 +1,15 @@
title: Bad request
type: object
required:
- statusCode
- error
- message
properties:
statusCode:
type: number
example: 400
error:
type: string
example: Bad Request
message:
type: string

View file

@ -0,0 +1,15 @@
type: object
properties:
error:
type: string
example: Not Found
enum:
- Not Found
message:
type: string
example: "Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] not found"
statusCode:
type: integer
example: 404
enum:
- 404

View file

@ -0,0 +1,2 @@
type: boolean
description: Allows the data view saved object to exist before the data is available.

View file

@ -0,0 +1,44 @@
title: Create data view request
type: object
required:
- data_view
properties:
data_view:
type: object
required:
- title
description: The data view object.
properties:
allowNoIndex:
$ref: 'allownoindex.yaml'
fieldAttrs:
$ref: 'fieldattrs.yaml'
fieldFormats:
$ref: 'fieldformats.yaml'
fields:
type: object
id:
type: string
name:
type: string
description: The data view name.
namespaces:
$ref: 'namespaces.yaml'
runtimeFieldMap:
$ref: 'runtimefieldmap.yaml'
sourceFilters:
$ref: 'sourcefilters.yaml'
timeFieldName:
$ref: 'timefieldname.yaml'
title:
$ref: 'title.yaml'
type:
$ref: 'type.yaml'
typeMeta:
$ref: 'typemeta.yaml'
version:
type: string
override:
type: boolean
description: Override an existing data view if a data view with the provided title already exists.
default: false

View file

@ -0,0 +1,36 @@
title: Data view response properties
type: object
properties:
data_view:
type: object
properties:
allowNoIndex:
$ref: 'allownoindex.yaml'
fieldAttrs:
$ref: 'fieldattrs.yaml'
fieldFormats:
$ref: 'fieldformats.yaml'
fields:
type: object
id:
type: string
example: ff959d40-b880-11e8-a6d9-e546fe2bba5f
name:
type: string
description: The data view name.
namespaces:
$ref: 'namespaces.yaml'
runtimeFieldMap:
$ref: 'runtimefieldmap.yaml'
sourceFilters:
$ref: 'sourcefilters.yaml'
timeFieldName:
$ref: 'timefieldname.yaml'
title:
$ref: 'title.yaml'
typeMeta:
$ref: 'typemeta.yaml'
version:
type: string
example: WzQ2LDJd

View file

@ -0,0 +1,2 @@
type: object
description: A map of field attributes by field name.

View file

@ -0,0 +1,2 @@
type: object
description: A map of field formats by field name.

View file

@ -0,0 +1,5 @@
type: array
description: An array of space identifiers for sharing the data view between multiple spaces.
items:
type: string
default: default

View file

@ -0,0 +1,2 @@
type: object
description: A map of runtime field definitions by field name.

View file

@ -0,0 +1,2 @@
type: array
description: The array of field names you want to filter out in Discover.

View file

@ -0,0 +1,2 @@
type: string
description: The timestamp field name, which you use for time-based data views.

View file

@ -0,0 +1,2 @@
type: string
description: Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`).

View file

@ -0,0 +1,2 @@
type: string
description: When set to `rollup`, identifies the rollup data views.

View file

@ -0,0 +1,2 @@
type: object
description: When you use rollup indices, contains the field list for the rollup data view API endpoints.

View file

@ -0,0 +1,35 @@
title: Update data view request
type: object
required:
- data_view
properties:
data_view:
type: object
description: >
The data view properties you want to update.
Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted.
properties:
allowNoIndex:
$ref: 'allownoindex.yaml'
fieldFormats:
$ref: 'fieldformats.yaml'
fields:
type: object
name:
type: string
runtimeFieldMap:
$ref: 'runtimefieldmap.yaml'
sourceFilters:
$ref: 'sourcefilters.yaml'
timeFieldName:
$ref: 'timefieldname.yaml'
title:
$ref: 'title.yaml'
type:
$ref: 'type.yaml'
typeMeta:
$ref: 'typemeta.yaml'
refresh_fields:
type: boolean
description: Reloads the data view fields after the data view is updated.
default: false

View file

@ -0,0 +1,59 @@
openapi: 3.1.0
info:
title: Data views
description: OpenAPI schema for data view endpoints
version: '0.1'
contact:
name: Kibana Core Team
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
tags:
- name: data views
description: Data view APIs enable you to manage data views, formerly known as Kibana index patterns.
servers:
- url: 'http://localhost:5601'
description: local
paths:
# Default space
'/api/data_views':
$ref: 'paths/api@data_views.yaml'
'/api/data_views/data_view':
$ref: 'paths/api@data_views@data_view.yaml'
'/api/data_views/data_view/{viewId}':
$ref: 'paths/api@data_views@data_view@{viewid}.yaml'
# '/api/data_views/data_view/{viewId}/fields':
# $ref: 'paths/api@data_views@data_view@{viewid}@fields.yaml'
# '/api/data_views/data_view/{viewId}/runtime_field':
# $ref: 'paths/api@data_views@data_view@{viewid}@runtime_field.yaml'
'/api/data_views/data_view/{viewId}/runtime_field/{fieldName}':
$ref: 'paths/api@data_views@data_view@{viewid}@runtime_field@{fieldname}.yaml'
'/api/data_views/default':
$ref: 'paths/api@data_views@default.yaml'
# Non-default space
# '/s/{spaceId}/api/data_views':
# $ref: 'paths/s@{spaceid}@api@data_views.yaml'
# '/s/{spaceId}/api/data_views/data_view':
# $ref: 'paths/s@{spaceid}@api@data_views@data_view.yaml'
# '/s/{spaceId}/api/data_views/data_view/{viewId}':
# $ref: 'paths/s@{spaceid}@api@data_views@data_view@{viewid}.yaml'
# '/s/{spaceId}/api/data_views/default':
# $ref: 'paths/s@{spaceid}@api@data_views@default.yaml'
# '/s/{spaceId}/api/data_views/data_view/{viewId}/fields':
# $ref: 'paths/s@{spaceid}@api@data_views@data_view@{viewid}@fields.yaml'
# '/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field':
# $ref: 'paths/s@{spaceid}@api@data_views@data_view@{viewid}@runtime_field.yaml'
# '/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}':
# $ref: 'paths/s@{spaceid}@api@data_views@data_view@{viewid}@runtime_field@{fieldname}.yaml'
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
security:
- basicAuth: []
- apiKeyAuth: []

View file

@ -0,0 +1,37 @@
get:
summary: Retrieves a list of all data views.
operationId: getAllDataViews
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
data_view:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
namespaces:
type: array
items:
type: string
title:
type: string
typeMeta:
type: object
examples:
getAllDataViewsResponse:
$ref: '../components/examples/get_data_views_response.yaml'
servers:
- url: https://localhost:5601

View file

@ -0,0 +1,36 @@
post:
summary: Creates a data view.
operationId: createDataView
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/headers/kbn_xsrf.yaml'
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/create_data_view_request_object.yaml'
examples:
createDataViewRequest:
$ref: '../components/examples/create_data_view_request.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
$ref: '../components/schemas/data_view_response_object.yaml'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../components/schemas/400_response.yaml'
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601

View file

@ -0,0 +1,85 @@
get:
summary: Retrieves a single data view by identifier.
operationId: getDataView
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/parameters/view_id.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
$ref: '../components/schemas/data_view_response_object.yaml'
examples:
getDataViewResponse:
$ref: '../components/examples/get_data_view_response.yaml'
'404':
description: Object is not found.
content:
application/json:
schema:
$ref: '../components/schemas/404_response.yaml'
delete:
summary: Deletes a data view.
operationId: deleteDataView
description: >
WARNING: When you delete a data view, it cannot be recovered.
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/parameters/view_id.yaml'
responses:
'204':
description: Indicates a successful call.
'404':
description: Object is not found.
content:
application/json:
schema:
$ref: '../components/schemas/404_response.yaml'
servers:
- url: https://localhost:5601
post:
summary: Updates a data view.
operationId: updateDataView
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/headers/kbn_xsrf.yaml'
- $ref: '../components/parameters/view_id.yaml'
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/update_data_view_request_object.yaml'
examples:
updateDataViewRequest:
$ref: '../components/examples/update_data_view_request.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
$ref: '../components/schemas/data_view_response_object.yaml'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../components/schemas/400_response.yaml'
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601

View file

@ -0,0 +1,35 @@
get:
summary: Retrieves a runtime field.
operationId: getRuntimeField
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/parameters/field_name.yaml'
- $ref: '../components/parameters/view_id.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
data_view:
type: object
fields:
type: array
items:
type: object
examples:
getRuntimeFieldResponse:
$ref: '../components/examples/get_runtime_field_response.yaml'
'404':
description: Object is not found.
content:
application/json:
schema:
$ref: '../components/schemas/404_response.yaml'
servers:
- url: https://localhost:5601

View file

@ -0,0 +1,67 @@
get:
summary: Retrieves the default data view identifier.
operationId: getDefaultDataView
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
data_view_id:
type: string
examples:
getDefaultDataViewResponse:
$ref: '../components/examples/get_default_data_view_response.yaml'
post:
summary: Sets the default data view identifier.
operationId: setDefaultDatailView
description: >
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
tags:
- data views
parameters:
- $ref: '../components/headers/kbn_xsrf.yaml'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- data_view_id
properties:
data_view_id:
type: ['string', 'null']
description: >
The data view identifier.
NOTE: The API does not validate whether it is a valid identifier.
Use `null` to unset the default data view.
force:
type: boolean
description: Update an existing default data view identifier.
default: false
examples:
setDefaultDataViewRequest:
$ref: '../components/examples/set_default_data_view_request.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601