Skip to content

Commit

Permalink
[OAS] Adding update and delete to runtime fields OAS (#163777)
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjtechwriter authored Aug 21, 2023
1 parent 23d3955 commit 037cbce
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 0 deletions.
103 changes: 103 additions & 0 deletions src/plugins/data_views/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,99 @@
}
}
},
"delete": {
"summary": "Delete a runtime field from a data view.",
"operationId": "deleteRuntimeField",
"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.\n",
"tags": [
"data views"
],
"parameters": [
{
"$ref": "#/components/parameters/field_name"
},
{
"$ref": "#/components/parameters/view_id"
}
],
"responses": {
"200": {
"description": "Indicates a successful call."
},
"404": {
"description": "Object is not found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/404_response"
}
}
}
}
}
},
"post": {
"summary": "Update an existing runtime field.",
"operationId": "updateRuntimeField",
"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.\n",
"tags": [
"data views"
],
"parameters": [
{
"$ref": "#/components/parameters/field_name"
},
{
"$ref": "#/components/parameters/view_id"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data_view": {
"type": "object"
},
"fields": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"examples": {
"updateRuntimeFieldRequest": {
"$ref": "#/components/examples/update_runtime_field_request"
}
}
}
}
},
"responses": {
"200": {
"description": "Indicates a successful call."
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/400_response"
}
}
}
}
},
"servers": [
{
"url": "https://localhost:5601"
}
]
},
"servers": [
{
"url": "https://localhost:5601"
Expand Down Expand Up @@ -2434,6 +2527,16 @@
}
}
},
"update_runtime_field_request": {
"summary": "Update an existing runtime field on a data view.",
"value": {
"runtimeField": {
"script": {
"source": "emit(doc[\"bar\"].value)"
}
}
}
},
"get_default_data_view_response": {
"summary": "The get default data view API returns the default data view identifier.",
"value": {
Expand Down
62 changes: 62 additions & 0 deletions src/plugins/data_views/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,62 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404_response'
delete:
summary: Delete a runtime field from a data view.
operationId: deleteRuntimeField
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'
- $ref: '#/components/parameters/view_id'
responses:
'200':
description: Indicates a successful call.
'404':
description: Object is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/404_response'
post:
summary: Update an existing runtime field.
operationId: updateRuntimeField
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'
- $ref: '#/components/parameters/view_id'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data_view:
type: object
fields:
type: array
items:
type: object
examples:
updateRuntimeFieldRequest:
$ref: '#/components/examples/update_runtime_field_request'
responses:
'200':
description: Indicates a successful call.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/400_response'
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601
/api/data_views/default:
Expand Down Expand Up @@ -1832,6 +1888,12 @@ components:
fieldAttrs: {}
allowNoIndex: false
name: Kibana Sample Data Flights
update_runtime_field_request:
summary: Update an existing runtime field on a data view.
value:
runtimeField:
script:
source: emit(doc["bar"].value)
get_default_data_view_response:
summary: The get default data view API returns the default data view identifier.
value:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
summary: Update an existing runtime field on a data view.
value:
{
"runtimeField": {
"script": {
"source": 'emit(doc["bar"].value)'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,63 @@ get:
application/json:
schema:
$ref: '../components/schemas/404_response.yaml'

delete:
summary: Delete a runtime field from a data view.
operationId: deleteRuntimeField
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.
'404':
description: Object is not found.
content:
application/json:
schema:
$ref: '../components/schemas/404_response.yaml'

post:
summary: Update an existing runtime field.
operationId: updateRuntimeField
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'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data_view:
type: object
fields:
type: array
items:
type: object
examples:
updateRuntimeFieldRequest:
$ref: '../components/examples/update_runtime_field_request.yaml'
responses:
'200':
description: Indicates a successful call.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../components/schemas/400_response.yaml'
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601

0 comments on commit 037cbce

Please sign in to comment.