mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[OAS][ML] Add sync API tags and description, minor OpenAPI fixes (#189230)
This commit is contained in:
parent
6c093b643b
commit
841e95c64b
6 changed files with 40 additions and 127 deletions
|
@ -1073,8 +1073,6 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse'
|
||||
security:
|
||||
- Machine_learning_APIs_apiKeyAuth: []
|
||||
/api/saved_objects/_export:
|
||||
post:
|
||||
summary: Export saved objects in the default space
|
||||
|
@ -9063,10 +9061,6 @@ components:
|
|||
enum:
|
||||
- 404
|
||||
securitySchemes:
|
||||
Machine_learning_APIs_apiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: ApiKey
|
||||
Serverless_saved_objects_apiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
|
|
|
@ -1401,43 +1401,6 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse'
|
||||
security:
|
||||
- Machine_learning_APIs_basicAuth: []
|
||||
- Machine_learning_APIs_apiKeyAuth: []
|
||||
/s/{spaceId}/api/ml/saved_objects/sync:
|
||||
get:
|
||||
summary: Sync saved objects
|
||||
description: >
|
||||
Synchronizes Kibana saved objects for machine learning jobs and trained
|
||||
models. You must have `all` privileges for the **Machine Learning**
|
||||
feature in the **Analytics** section of the Kibana feature privileges.
|
||||
This API runs automatically when you start Kibana and periodically
|
||||
thereafter.
|
||||
operationId: mlSyncWithSpaceId
|
||||
tags:
|
||||
- ml
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/Machine_learning_APIs_spaceParam'
|
||||
- $ref: '#/components/parameters/Machine_learning_APIs_simulateParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Indicates a successful call
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response'
|
||||
examples:
|
||||
syncExample:
|
||||
$ref: '#/components/examples/Machine_learning_APIs_mlSyncExample'
|
||||
'401':
|
||||
description: Authorization information is missing or invalid.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse'
|
||||
security:
|
||||
- Machine_learning_APIs_basicAuth: []
|
||||
- Machine_learning_APIs_apiKeyAuth: []
|
||||
/api/encrypted_saved_objects/_rotate_key:
|
||||
post:
|
||||
summary: Rotate a key for encrypted saved objects
|
||||
|
@ -3127,15 +3090,6 @@ components:
|
|||
schema:
|
||||
type: string
|
||||
example: hour_of_day
|
||||
Machine_learning_APIs_spaceParam:
|
||||
in: path
|
||||
name: spaceId
|
||||
description: >-
|
||||
An identifier for the space. If `/s/` and the identifier are omitted
|
||||
from the path, the default space is used.
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
Machine_learning_APIs_simulateParam:
|
||||
in: query
|
||||
name: simulate
|
||||
|
@ -11340,13 +11294,6 @@ components:
|
|||
schema:
|
||||
$ref: '#/components/schemas/Connectors_action_response_properties'
|
||||
securitySchemes:
|
||||
Machine_learning_APIs_basicAuth:
|
||||
type: http
|
||||
scheme: basic
|
||||
Machine_learning_APIs_apiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: ApiKey
|
||||
Saved_objects_basicAuth:
|
||||
type: http
|
||||
scheme: basic
|
||||
|
|
|
@ -4,17 +4,4 @@ The current self-contained spec file can be used for online tools like those fou
|
|||
|
||||
A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).
|
||||
|
||||
The `ml_apis_v3.yaml` file uses OpenAPI Specification Version 3.0.1.
|
||||
|
||||
## Tools
|
||||
|
||||
It is possible to validate the docs before bundling them by running these
|
||||
commands in the `x-pack/plugins/ml/common/openapi/` folder:
|
||||
|
||||
```
|
||||
npx swagger-cli validate ml_apis.yaml
|
||||
npx @redocly/cli lint ml_apis.yaml
|
||||
|
||||
npx swagger-cli validate ml_apis_serverless.yaml
|
||||
npx @redocly/cli lint ml_apis_serverless.yaml
|
||||
```
|
||||
These files are joined with the rest of the Kibana APIs per `oas_docs/README.md`
|
||||
|
|
|
@ -41,44 +41,44 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/mlSync4xxResponse'
|
||||
|
||||
/s/{spaceId}/api/ml/saved_objects/sync:
|
||||
get:
|
||||
summary: Sync saved objects
|
||||
description: >
|
||||
Synchronizes Kibana saved objects for machine learning jobs and trained models.
|
||||
You must have `all` privileges for the **Machine Learning** feature in the **Analytics** section of the Kibana feature privileges.
|
||||
This API runs automatically when you start Kibana and periodically thereafter.
|
||||
operationId: mlSyncWithSpaceId
|
||||
tags:
|
||||
- ml
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/spaceParam'
|
||||
- $ref: '#/components/parameters/simulateParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Indicates a successful call
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/mlSync200Response'
|
||||
examples:
|
||||
syncExample:
|
||||
$ref: '#/components/examples/mlSyncExample'
|
||||
'401':
|
||||
description: Authorization information is missing or invalid.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/mlSync4xxResponse'
|
||||
# /s/{spaceId}/api/ml/saved_objects/sync:
|
||||
# get:
|
||||
# summary: Sync saved objects
|
||||
# description: >
|
||||
# Synchronizes Kibana saved objects for machine learning jobs and trained models.
|
||||
# You must have `all` privileges for the **Machine Learning** feature in the **Analytics** section of the Kibana feature privileges.
|
||||
# This API runs automatically when you start Kibana and periodically thereafter.
|
||||
# operationId: mlSyncWithSpaceId
|
||||
# tags:
|
||||
# - ml
|
||||
# parameters:
|
||||
# - $ref: '#/components/parameters/spaceParam'
|
||||
# - $ref: '#/components/parameters/simulateParam'
|
||||
# responses:
|
||||
# '200':
|
||||
# description: Indicates a successful call
|
||||
# content:
|
||||
# application/json:
|
||||
# schema:
|
||||
# $ref: '#/components/schemas/mlSync200Response'
|
||||
# examples:
|
||||
# syncExample:
|
||||
# $ref: '#/components/examples/mlSyncExample'
|
||||
# '401':
|
||||
# description: Authorization information is missing or invalid.
|
||||
# content:
|
||||
# application/json:
|
||||
# schema:
|
||||
# $ref: '#/components/schemas/mlSync4xxResponse'
|
||||
components:
|
||||
parameters:
|
||||
spaceParam:
|
||||
in: path
|
||||
name: spaceId
|
||||
description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used.
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
# spaceParam:
|
||||
# in: path
|
||||
# name: spaceId
|
||||
# description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used.
|
||||
# required: true
|
||||
# schema:
|
||||
# type: string
|
||||
simulateParam:
|
||||
in: query
|
||||
name: simulate
|
||||
|
@ -87,14 +87,6 @@ components:
|
|||
schema:
|
||||
type: boolean
|
||||
example: 'true'
|
||||
securitySchemes:
|
||||
basicAuth:
|
||||
type: http
|
||||
scheme: basic
|
||||
apiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: ApiKey
|
||||
schemas:
|
||||
mlSyncResponseSuccess:
|
||||
type: boolean
|
||||
|
@ -212,6 +204,3 @@ components:
|
|||
"datafeedsAdded": {},
|
||||
"datafeedsRemoved": {}
|
||||
}
|
||||
security:
|
||||
- basicAuth: [ ]
|
||||
- apiKeyAuth: [ ]
|
|
@ -49,11 +49,6 @@ components:
|
|||
schema:
|
||||
type: boolean
|
||||
example: 'true'
|
||||
securitySchemes:
|
||||
apiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: ApiKey
|
||||
schemas:
|
||||
mlSyncResponseSuccess:
|
||||
type: boolean
|
||||
|
@ -171,5 +166,3 @@ components:
|
|||
"datafeedsAdded": {},
|
||||
"datafeedsRemoved": {}
|
||||
}
|
||||
security:
|
||||
- apiKeyAuth: [ ]
|
|
@ -84,8 +84,11 @@ export function savedObjectsRoutes(
|
|||
'access:ml:canCreateJob',
|
||||
'access:ml:canCreateDataFrameAnalytics',
|
||||
'access:ml:canCreateTrainedModels',
|
||||
'oas-tag:machine learning',
|
||||
],
|
||||
},
|
||||
description:
|
||||
'Synchronizes Kibana saved objects for machine learning jobs and trained models. This API runs automatically when you start Kibana and periodically thereafter.',
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue