Search in sources :

Example 1 with LogConfigs

use of org.wso2.ei.dashboard.core.rest.model.LogConfigs in project product-mi-tooling by wso2.

the class GroupsApi method updateLogLevelByNodeId.

@PATCH
@Path("/{group-id}/log-configs/nodes/{node-id}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Update log level by nodeId", description = "", tags = { "logConfigs" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Logger update status", content = @Content(schema = @Schema(implementation = SuccessStatus.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response updateLogLevelByNodeId(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @PathParam("node-id") @Parameter(description = "NodeId") String nodeId, @Valid LogConfigUpdateRequest request) throws ManagementApiException {
    LogConfigDelegate logConfigDelegate = new LogConfigDelegate();
    Ack ack = logConfigDelegate.updateLogLevelByNodeId(groupId, nodeId, request);
    return Response.ok().entity(ack).build();
}
Also used : LogConfigDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogConfigDelegate) Ack(org.wso2.ei.dashboard.core.rest.model.Ack) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 2 with LogConfigs

use of org.wso2.ei.dashboard.core.rest.model.LogConfigs in project product-mi-tooling by wso2.

the class GroupsApi method getLogConfigs.

@GET
@Path("/{group-id}/log-configs")
@Produces({ "application/json" })
@Operation(summary = "Get log configs", description = "", tags = { "logConfigs" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of log configs", content = @Content(schema = @Schema(implementation = LogConfigs.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getLogConfigs(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId) throws ManagementApiException {
    LogConfigDelegate logConfigDelegate = new LogConfigDelegate();
    LogConfigs logConfigs = logConfigDelegate.fetchLogConfigs(groupId);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(logConfigs);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) LogConfigs(org.wso2.ei.dashboard.core.rest.model.LogConfigs) LogConfigDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogConfigDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 3 with LogConfigs

use of org.wso2.ei.dashboard.core.rest.model.LogConfigs in project product-mi-tooling by wso2.

the class GroupsApi method addLogger.

@POST
@Path("/{group-id}/log-configs")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Add logger", description = "", tags = { "logConfigs" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Logger insert status", content = @Content(schema = @Schema(implementation = SuccessStatus.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response addLogger(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @Valid LogConfigAddRequest request) throws ManagementApiException {
    LogConfigDelegate logConfigDelegate = new LogConfigDelegate();
    Ack ack = logConfigDelegate.addLogger(groupId, request);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(ack);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) LogConfigDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogConfigDelegate) Ack(org.wso2.ei.dashboard.core.rest.model.Ack) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 4 with LogConfigs

use of org.wso2.ei.dashboard.core.rest.model.LogConfigs in project product-mi-tooling by wso2.

the class GroupsApi method getLogConfigsByNodeIds.

@GET
@Path("/{group-id}/log-configs/nodes/{node-id}")
@Produces({ "application/json" })
@Operation(summary = "Get log configs by node id", description = "", tags = { "logConfigs" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of log configs in provided node id", content = @Content(schema = @Schema(implementation = LogConfigs.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getLogConfigsByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @PathParam("node-id") @Parameter(description = "NodeId") String nodeId) throws ManagementApiException {
    LogConfigDelegate logConfigDelegate = new LogConfigDelegate();
    LogConfigs logConfigs = logConfigDelegate.fetchLogConfigsByNodeId(groupId, nodeId);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(logConfigs);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) LogConfigs(org.wso2.ei.dashboard.core.rest.model.LogConfigs) LogConfigDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LogConfigDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 5 with LogConfigs

use of org.wso2.ei.dashboard.core.rest.model.LogConfigs in project product-mi-tooling by wso2.

the class LogConfigDelegate method createLogConfigsObject.

private LogConfigs createLogConfigsObject(JsonArray logConfigsArray) {
    LogConfigs logConfigs = new LogConfigs();
    for (JsonElement element : logConfigsArray) {
        LogConfigsInner logConfigsInner = createLogConfig(element);
        logConfigs.add(logConfigsInner);
    }
    return logConfigs;
}
Also used : LogConfigs(org.wso2.ei.dashboard.core.rest.model.LogConfigs) JsonElement(com.google.gson.JsonElement) LogConfigsInner(org.wso2.ei.dashboard.core.rest.model.LogConfigsInner)

Aggregations

Operation (io.swagger.v3.oas.annotations.Operation)5 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)5 LogConfigDelegate (org.wso2.ei.dashboard.micro.integrator.delegates.LogConfigDelegate)5 ApiResponse (io.swagger.v3.oas.annotations.responses.ApiResponse)4 Response (javax.ws.rs.core.Response)4 Ack (org.wso2.ei.dashboard.core.rest.model.Ack)3 LogConfigs (org.wso2.ei.dashboard.core.rest.model.LogConfigs)3 JsonElement (com.google.gson.JsonElement)1 LogConfigsInner (org.wso2.ei.dashboard.core.rest.model.LogConfigsInner)1