wazuh / wazuh-indexer-plugins

GNU Affero General Public License v3.0
1 stars 3 forks source link

Apply rest type endpoint path #108

Closed AlexRuiz7 closed 1 month ago

AlexRuiz7 commented 1 month ago

Description

This PR includes several improvements to the Command Manager plugin:

image

2024-10-16T11:39:11.376+0200 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :run
2024-10-16T11:39:23.171+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,124][INFO ][c.w.c.r.a.RestPostCommandAction] [integTest-0] Received POST /_plugins/_command_manager/commands request id [1] from host [127.0.0.1:9200]
2024-10-16T11:39:23.171+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,130][INFO ][c.w.c.u.h.HttpRestClient ] [integTest-0] Sending payload with id [Im6ylJIBRAPV3wyYQQ15] to [https://httpbin.org/post]
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,259][INFO ][c.w.c.r.a.RestPostCommandAction] [integTest-0] Received response to POST request with code [200]
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,259][INFO ][c.w.c.r.a.RestPostCommandAction] [integTest-0] Raw response:
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] {
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "args": {}, 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "data": "{\"agent\":{\"groups\":[\"groups000\"]},\"command\":{\"source\":\"Engine\",\"user\":\"user53\",\"target\":{\"type\":\"agent\",\"id\":\"target4\"},\"action\":{\"name\":\"restart\",\"args\":[\"/path/to/executable/arg6\",\"/path/to/executable/arg6\"],\"version\":\"v4\"},\"timeout\":30,\"status\":\"PENDING\",\"order_id\":\"IW6ylJIBRAPV3wyYQQ14\",\"request_id\":\"IG6ylJIBRAPV3wyYQQ13\"}}", 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "files": {}, 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "form": {}, 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "headers": {
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "Content-Type": "application/json; charset=UTF-8", 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "Host": "httpbin.org", 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "Transfer-Encoding": "chunked", 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "User-Agent": "Apache-HttpAsyncClient/5.4 (Java/21.0.4)", 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "X-Amzn-Trace-Id": "Root=1-670f89cb-5ef2aee502ba60465a48184b"
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   }, 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "json": {
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "agent": {
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "groups": [
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "groups000"
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       ]
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     }, 
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     "command": {
2024-10-16T11:39:23.272+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "action": {
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "args": [
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]           "/path/to/executable/arg6", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]           "/path/to/executable/arg6"
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         ], 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "name": "restart", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "version": "v4"
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       }, 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "order_id": "IW6ylJIBRAPV3wyYQQ14", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "request_id": "IG6ylJIBRAPV3wyYQQ13", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "source": "Engine", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "status": "PENDING", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "target": {
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "id": "target4", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]         "type": "agent"
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       }, 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "timeout": 30, 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]       "user": "user53"
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]     }
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   }, 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "origin": "79.117.251.93", 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask]   "url": "https://httpbin.org/post"
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] }
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] 
2024-10-16T11:39:23.273+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,263][INFO ][c.w.c.i.CommandIndex     ] [integTest-0] Indexing command with id [Im6ylJIBRAPV3wyYQQ15]
2024-10-16T11:39:23.373+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,283][INFO ][o.o.p.PluginsService     ] [integTest-0] PluginService:onIndexModule index:[BMn5uviVSRWOptDJ72Sx8w/YoKeVJ3XTpyKX8saPaqEuA]
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,400][INFO ][o.o.c.m.MetadataIndexTemplateService] [integTest-0] adding template [index-template-commands] for index patterns [.commands*]
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,406][DEBUG][o.o.c.c.PublicationTransportHandler] [integTest-0] received diff cluster state version [3] with uuid [OcaebB72Qh2Ccl9qZdMYfA], diff size [580]
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,440][DEBUG][o.o.c.c.C.CoordinatorPublication] [integTest-0] publication ended successfully: Publication{term=1, version=3}
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,442][INFO ][c.w.c.i.CommandIndex     ] [integTest-0] Index template [index-template-commands] created successfully
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,447][INFO ][o.o.p.PluginsService     ] [integTest-0] PluginService:onIndexModule index:[.commands/Ph8V5qGfR_uDkQuAdqUBrA]
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,458][INFO ][o.o.c.m.MetadataCreateIndexService] [integTest-0] [.commands] creating index, cause [auto(bulk api)], templates [index-template-commands], shards [1]/[0]
2024-10-16T11:39:23.474+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,463][WARN ][o.o.c.r.a.AllocationService] [integTest-0] Falling back to single shard assignment since batch mode disable or multiple custom allocators set
2024-10-16T11:39:23.574+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,477][DEBUG][o.o.c.c.PublicationTransportHandler] [integTest-0] received diff cluster state version [4] with uuid [vn2XtNkqQuqWc1XrYV-CNw], diff size [754]
2024-10-16T11:39:23.574+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,505][INFO ][o.o.p.PluginsService     ] [integTest-0] PluginService:onIndexModule index:[.commands/Ph8V5qGfR_uDkQuAdqUBrA]
2024-10-16T11:39:23.574+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,562][DEBUG][o.o.c.c.C.CoordinatorPublication] [integTest-0] publication ended successfully: Publication{term=1, version=4}
2024-10-16T11:39:23.775+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,719][INFO ][o.o.c.r.a.AllocationService] [integTest-0] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.commands][0]]]).
2024-10-16T11:39:23.775+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,723][DEBUG][o.o.c.c.PublicationTransportHandler] [integTest-0] received diff cluster state version [5] with uuid [OmFPmkceS5CCyY-Rg1iwrA], diff size [437]
2024-10-16T11:39:23.775+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,763][DEBUG][o.o.c.c.C.CoordinatorPublication] [integTest-0] publication ended successfully: Publication{term=1, version=5}
2024-10-16T11:39:23.775+0200 [LIFECYCLE] [org.opensearch.gradle.testclusters.RunTask] [2024-10-16T11:39:23,765][WARN ][o.o.c.r.a.AllocationService] [integTest-0] Falling back to single shard assignment since batch mode disable or multiple custom allocators set
2024-10-16T11:39:25.208+0200 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager] 

Issues Resolved

Closes #107