[server][ executor]- 完成底层的代码 - 1
This commit is contained in:
@@ -34,10 +34,12 @@ public class ExecutionController {
|
||||
SyncExecutionService syncExecutionService;
|
||||
|
||||
@PostMapping("/command/one")
|
||||
@ApiOperation("[命令] - 手动发送命令")
|
||||
@ApiOperation("[命令] [异步]- 单台主机")
|
||||
public R<String> patchCommandToAgent(
|
||||
@RequestParam(value = "topicName") @ApiParam(name = "topicName", value = "目标主机名称") String topicName,
|
||||
@RequestParam(value = "commandList", required = false) @Nullable List<String> commandList,
|
||||
@RequestParam(value = "completeCommandList", required = false)
|
||||
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
|
||||
@RequestParam(value = "type", required = false) @Nullable String type
|
||||
) {
|
||||
|
||||
@@ -45,47 +47,57 @@ public class ExecutionController {
|
||||
.SendCommandToAgent(
|
||||
topicName,
|
||||
type,
|
||||
commandList
|
||||
commandList,
|
||||
completeCommandList,
|
||||
false,
|
||||
null,
|
||||
false
|
||||
);
|
||||
|
||||
return R.ok(streamKey);
|
||||
}
|
||||
|
||||
@PostMapping("/command/batch")
|
||||
@ApiOperation("[命令] - 批量发送命令")
|
||||
@ApiOperation("[命令] [异步] - 批量主机")
|
||||
public R<List<String>> patchCommandToAgentList(
|
||||
@RequestParam(value = "topicNameList")
|
||||
@ApiParam(name = "topicNameList", value = "目标机器列表") List<String> topicNameList,
|
||||
@RequestParam(value = "commandList", required = false)
|
||||
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
|
||||
@RequestParam(value = "completeCommandList", required = false)
|
||||
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
|
||||
@RequestParam(value = "type", required = false) @Nullable String type
|
||||
) {
|
||||
|
||||
return R.ok(asyncExecutionService.SendCommandToAgent(
|
||||
return R.ok(asyncExecutionService.SendCommandToAgentComplete(
|
||||
topicNameList,
|
||||
type,
|
||||
commandList
|
||||
commandList,
|
||||
completeCommandList
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/command/all")
|
||||
@ApiOperation("[命令] - 发送命令至所有的主机")
|
||||
@ApiOperation("[命令] [异步] - 所有的主机")
|
||||
public R<List<String>> patchCommandToAllAgent(
|
||||
@RequestParam(value = "commandList", required = false)
|
||||
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
|
||||
@RequestParam(value = "completeCommandList", required = false)
|
||||
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
|
||||
@RequestParam(value = "type", required = false) @Nullable String type
|
||||
) {
|
||||
|
||||
return R.ok(asyncExecutionService.SendCommandToAgent(
|
||||
return R.ok(asyncExecutionService.SendCommandToAgentComplete(
|
||||
ALL_AGENT_TOPIC_NAME_LIST,
|
||||
type,
|
||||
commandList
|
||||
commandList,
|
||||
completeCommandList
|
||||
));
|
||||
}
|
||||
|
||||
@PostMapping("/command/healthy")
|
||||
@ApiOperation("[命令] - 发送命令至健康的主机")
|
||||
@ApiOperation("[命令] [异步] - 健康的主机")
|
||||
public R<List<String>> patchCommandToHealthyAgent(
|
||||
@RequestParam(value = "commandList", required = false)
|
||||
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
|
||||
|
||||
Reference in New Issue
Block a user