-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply rest type endpoint path (#108)
* Apply Restful type endpoint path for the commands resource * Extract POST requests handling to a separate method * Add OpenAPI spec for the Command Manager API * Test cycle Sends the command to a fake Management API on incoming POST requests for the command manager plugin. * Rename logger * Improve logging * Fix testPost_success() test * Remove redundant anidation of the command fields on the POST endpoint * Remove rest.action package
- Loading branch information
Showing
11 changed files
with
234 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
openapi: "3.0.3" | ||
info: | ||
title: Wazuh Indexer Command Manager API | ||
version: "1.0" | ||
servers: | ||
- url: http://127.0.0.1:9200/_plugins/_command_manager | ||
paths: | ||
/commands: | ||
post: | ||
tags: | ||
- "commands" | ||
summary: Add a new command to the queue. | ||
description: Add a new command to the queue. | ||
requestBody: | ||
required: true | ||
content: | ||
"application/json": | ||
schema: | ||
$ref: "#/components/schemas/Command" | ||
responses: | ||
"200": | ||
description: OK | ||
|
||
components: | ||
schemas: | ||
Command: | ||
type: object | ||
properties: | ||
source: | ||
type: string | ||
example: "Engine" | ||
user: | ||
type: string | ||
example: "user53" | ||
target: | ||
$ref: '#/components/schemas/Target' | ||
action: | ||
$ref: '#/components/schemas/Action' | ||
timeout: | ||
type: integer | ||
example: 30 | ||
Target: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
example: "target4" | ||
type: | ||
type: string | ||
example: "agent" | ||
Action: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: "restart" | ||
args: | ||
type: array | ||
items: | ||
type: string | ||
example: "/path/to/executable/arg6" | ||
version: | ||
type: string | ||
example: "v4" |
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.