-
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.
[EDR Workflows] Create missing OpenAPI specs for Endpoint management …
…API (#187261) This PR adds OpenAPI schemas for Defend Workflows API endpoints that previously didn't have them. Here are the changes made: 1. Added a schema for `/api/endpoint/isolate`, which is deprecated and now redirects as a `308` to the new path (`/api/endpoint/action/isolate`). It's tagged with `x-labels` as `ess` only. 2. Added a schema for `/api/endpoint/unisolate`, which is deprecated and now redirects as a `308` to the new path (`/api/endpoint/action/unisolate`). It's tagged with `x-labels` as `ess` only. 3. Added a schema for `/api/endpoint/protection_updates_note/{package_policy_id}`. 4. Added `x-labels` field to all existing Defend Workflows API paths for proper tagging. For more information on `x-labels`, please refer to #184348
- Loading branch information
1 parent
4802a0f
commit 68d5370
Showing
23 changed files
with
369 additions
and
0 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
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
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
28 changes: 28 additions & 0 deletions
28
x-pack/plugins/security_solution/common/api/endpoint/actions/isolate_route.gen.ts
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,28 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Endpoint Isolate Schema | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import type { z } from 'zod'; | ||
|
||
import { BaseActionSchema, SuccessResponse } from '../model/schema/common.gen'; | ||
|
||
export type EndpointIsolateRedirectRequestBody = z.infer<typeof EndpointIsolateRedirectRequestBody>; | ||
export const EndpointIsolateRedirectRequestBody = BaseActionSchema; | ||
export type EndpointIsolateRedirectRequestBodyInput = z.input< | ||
typeof EndpointIsolateRedirectRequestBody | ||
>; | ||
|
||
export type EndpointIsolateRedirectResponse = z.infer<typeof EndpointIsolateRedirectResponse>; | ||
export const EndpointIsolateRedirectResponse = SuccessResponse; |
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/security_solution/common/api/endpoint/actions/isolate_route.schema.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,33 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Endpoint Isolate Schema | ||
version: '2023-10-31' | ||
paths: | ||
/api/endpoint/isolate: | ||
post: | ||
summary: Permanently redirects to a new location | ||
operationId: EndpointIsolateRedirect | ||
x-codegen-enabled: true | ||
x-labels: | ||
- ess | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../model/schema/common.schema.yaml#/components/schemas/BaseActionSchema' | ||
responses: | ||
'308': | ||
description: Permanent Redirect | ||
headers: | ||
Location: | ||
description: Permanently redirects to "/api/endpoint/action/isolate" | ||
schema: | ||
type: string | ||
example: "/api/endpoint/action/isolate" | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../model/schema/common.schema.yaml#/components/schemas/SuccessResponse' |
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
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/security_solution/common/api/endpoint/actions/unisolate_route.gen.ts
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,30 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Endpoint Unisolate Schema | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import type { z } from 'zod'; | ||
|
||
import { BaseActionSchema, SuccessResponse } from '../model/schema/common.gen'; | ||
|
||
export type EndpointUnisolateRedirectRequestBody = z.infer< | ||
typeof EndpointUnisolateRedirectRequestBody | ||
>; | ||
export const EndpointUnisolateRedirectRequestBody = BaseActionSchema; | ||
export type EndpointUnisolateRedirectRequestBodyInput = z.input< | ||
typeof EndpointUnisolateRedirectRequestBody | ||
>; | ||
|
||
export type EndpointUnisolateRedirectResponse = z.infer<typeof EndpointUnisolateRedirectResponse>; | ||
export const EndpointUnisolateRedirectResponse = SuccessResponse; |
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/security_solution/common/api/endpoint/actions/unisolate_route.schema.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,33 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Endpoint Unisolate Schema | ||
version: '2023-10-31' | ||
paths: | ||
/api/endpoint/unisolate: | ||
post: | ||
summary: Permanently redirects to a new location | ||
operationId: EndpointUnisolateRedirect | ||
x-codegen-enabled: true | ||
x-labels: | ||
- ess | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../model/schema/common.schema.yaml#/components/schemas/BaseActionSchema' | ||
responses: | ||
'308': | ||
description: Permanent Redirect | ||
headers: | ||
Location: | ||
description: Permanently redirects to "/api/endpoint/action/unisolate" | ||
schema: | ||
type: string | ||
example: "/api/endpoint/action/unisolate" | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../model/schema/common.schema.yaml#/components/schemas/SuccessResponse' |
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
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
Oops, something went wrong.