Search in sources :

Example 1 with LogsDelegate

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();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) LogList(org.wso2.ei.dashboard.core.rest.model.LogList) LogsDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogsDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 2 with LogsDelegate

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();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) LogsDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogsDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

Operation (io.swagger.v3.oas.annotations.Operation)2 ApiResponse (io.swagger.v3.oas.annotations.responses.ApiResponse)2 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)2 Response (javax.ws.rs.core.Response)2 LogsDelegate (org.wso2.ei.dashboard.micro.integrator.delegates.LogsDelegate)2 LogList (org.wso2.ei.dashboard.core.rest.model.LogList)1