-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,279 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/cloud_security_posture/public/pages/findings/findings_flyout/json_tab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { CodeEditor } from '@kbn/kibana-react-plugin/public'; | ||
import { XJsonLang } from '@kbn/monaco'; | ||
import { CspFinding } from '../types'; | ||
|
||
const offsetHeight = 120; | ||
|
||
export const JsonTab = ({ data }: { data: CspFinding }) => ( | ||
<div style={{ position: 'absolute', inset: 0, top: offsetHeight }}> | ||
<CodeEditor | ||
isCopyable | ||
allowFullScreen | ||
languageId={XJsonLang.ID} | ||
value={JSON.stringify(data, null, 2)} | ||
options={{ | ||
readOnly: true, | ||
lineNumbers: 'on', | ||
folding: true, | ||
}} | ||
/> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# OpenAPI (Experimental) | ||
|
||
The current self-contained spec file 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/). | ||
|
||
## Tools | ||
|
||
It is possible to validate the docs before bundling them by running the following command in the `x-pack/plugins/ml/common/openapi/` folder: | ||
``` | ||
npx swagger-cli validate ml_apis.yaml | ||
``` | ||
|
||
Then generate the `bundled` files with the following commands: | ||
|
||
``` | ||
npx @redocly/openapi-cli bundle --ext yaml --output bundled.yaml ml_apis.yaml | ||
npx @redocly/openapi-cli bundle --ext json --output bundled.json ml_apis.yaml | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,225 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "Machine learning APIs", | ||
"description": "Kibana APIs for the machine learning feature", | ||
"version": "1.0.0", | ||
"license": { | ||
"name": "Elastic License 2.0", | ||
"url": "https://www.elastic.co/licensing/elastic-license" | ||
} | ||
}, | ||
"tags": [ | ||
{ | ||
"name": "ml", | ||
"description": "Machine learning" | ||
} | ||
], | ||
"servers": [ | ||
{ | ||
"url": "https://localhost:5601/" | ||
} | ||
], | ||
"paths": { | ||
"/s/{spaceId}/api/ml/saved_objects/sync": { | ||
"get": { | ||
"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.\n", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/spaceParam" | ||
}, | ||
{ | ||
"$ref": "#/components/parameters/simulateParam" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Indicates a successful call", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"items": { | ||
"$ref": "#/components/schemas/syncResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/api/ml/saved_objects/sync": { | ||
"get": { | ||
"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.\n", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/simulateParam" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Indicates a successful call", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"items": { | ||
"$ref": "#/components/schemas/syncResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"spaceParam": { | ||
"in": "path", | ||
"name": "spaceId", | ||
"description": "An identifier for the space.", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"simulateParam": { | ||
"in": "query", | ||
"name": "simulate", | ||
"description": "When true, simulates the synchronization by returning only the list actions that would be performed.", | ||
"required": false, | ||
"schema": { | ||
"type": "boolean" | ||
}, | ||
"example": "true" | ||
} | ||
}, | ||
"securitySchemes": { | ||
"basicAuth": { | ||
"type": "http", | ||
"scheme": "basic" | ||
} | ||
}, | ||
"schemas": { | ||
"syncResponse": { | ||
"type": "object", | ||
"properties": { | ||
"datafeedsAdded": { | ||
"type": "object", | ||
"description": "If a saved object for an anomaly detection job is missing a datafeed identifier, it is added. This list contains the datafeed identifiers and indicates whether the synchronization was successful.", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
}, | ||
"datafeedsRemoved": { | ||
"type": "object", | ||
"description": "If a saved object for an anomaly detection job references a datafeed that no longer exists, it is deleted. This list contains the datafeed identifiers and indicates whether the synchronization was successful.", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
}, | ||
"savedObjectsCreated": { | ||
"type": "object", | ||
"description": "If saved objects are missing for machine learning jobs or trained models, they are created. This list contains the job and model identifiers and indicates whether the synchronization was successful.", | ||
"properties": { | ||
"anomaly-detector": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
}, | ||
"data-frame-analytics": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
}, | ||
"trained-model": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"savedObjectsDeleted": { | ||
"type": "object", | ||
"description": "If saved objects exist for machine learning jobs or trained models that no longer exist, they are deleted. This list contains the job and model identifiers and indicates whether the synchronization was successful.", | ||
"properties": { | ||
"anomaly-detector": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
}, | ||
"data-frame-analytics": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
}, | ||
"trained-model": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"type": "boolean", | ||
"example": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"basicAuth": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.