use of org.wso2.ei.dashboard.micro.integrator.delegates.LogsDelegate in project product-mi-tooling by wso2.
the class GroupsApi method getLogFilesByNodeIds.
@GET
@Path("/{group-id}/logs")
@Produces({ "application/json" })
@Operation(summary = "Get log files by node ids", description = "", tags = { "logFiles" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of log files of provided nodes", content = @Content(schema = @Schema(implementation = LogList.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getLogFilesByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @NotNull @QueryParam("nodes") @Parameter(description = "ID/IDs of the nodes") List<String> nodes) throws ManagementApiException {
LogsDelegate logsDelegate = new LogsDelegate();
LogList logList = logsDelegate.getLogsList(groupId, nodes);
Response.ResponseBuilder responseBuilder = Response.ok().entity(logList);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.micro.integrator.delegates.LogsDelegate in project product-mi-tooling by wso2.
the class GroupsApi method getLogContent.
@GET
@Path("/{group-id}/nodes/{node-id}/logs/{file-name}")
@Produces({ "text/plain" })
@Operation(summary = "Get log content", description = "", tags = { "logFiles" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Get log file content.", content = @Content(schema = @Schema(implementation = File.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getLogContent(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @PathParam("node-id") @Parameter(description = "Node id of the file") String nodeId, @PathParam("file-name") @Parameter(description = "Log file name") String fileName) throws ManagementApiException {
LogsDelegate logsDelegate = new LogsDelegate();
String logContent = logsDelegate.getLogByName(groupId, nodeId, fileName);
Response.ResponseBuilder responseBuilder = Response.ok().entity(logContent);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
Aggregations