Skip to content

Commit 8badb0d

Browse files
fix[backend](incident_response_audit): enabled filters on agents-with command query (#2226)
* fix[backend](incident_response_audit): enabled filters on agents-with-command query * fix[backend](go_deps): updated go dependencies --------- Signed-off-by: Yorjander Hernandez Vergara <99102374+Kbayero@users.noreply.github.com> Co-authored-by: Yorjander Hernandez Vergara <99102374+Kbayero@users.noreply.github.com>
1 parent 80c844c commit 8badb0d

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

backend/src/main/java/com/park/utmstack/web/rest/agent_manager/AgentManagerResource.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,18 @@ public ResponseEntity<List<AgentDTO>> listAgents(
6969
}
7070

7171
@GetMapping("/agents-with-commands")
72-
public ResponseEntity<List<AgentDTO>> listAgentsWithCommands() {
72+
public ResponseEntity<List<AgentDTO>> listAgentsWithCommands(
73+
@RequestParam(required = false) Integer pageNumber,
74+
@RequestParam(required = false) Integer pageSize,
75+
@RequestParam(required = false) String searchQuery,
76+
@RequestParam(required = false) String sortBy) {
7377
final String ctx = CLASSNAME + ".listAgentsWithCommands";
7478
try {
7579
ListRequest request = ListRequest.newBuilder()
76-
.setPageNumber(1)
77-
.setPageSize(1000000)
78-
.setSearchQuery("")
79-
.setSortBy("")
80+
.setPageNumber(pageNumber != null ? pageNumber : 0)
81+
.setPageSize(pageSize != null ? pageSize : 1000000)
82+
.setSearchQuery(searchQuery != null ? searchQuery : "")
83+
.setSortBy(sortBy != null ? sortBy : "")
8084
.build();
8185
ListAgentsResponseDTO response = agentGrpcService.listAgentWithCommands(request);
8286
List<AgentDTO> agentDTOList = response.getAgents();

0 commit comments

Comments
 (0)