use of org.wso2.carbon.apimgt.devops.impl.logging.APILoggingImpl in project carbon-apimgt by wso2.
the class TenantLogsApiServiceImpl method tenantLogsTenantIdApisApiIdGet.
public Response tenantLogsTenantIdApisApiIdGet(String tenantId, String apiId, MessageContext messageContext) throws APIManagementException {
APILoggingImpl apiLoggingImpl = new APILoggingImpl();
List<APILogInfoDTO> apiLogInfoDTOList = apiLoggingImpl.getAPILoggerListByApiId(tenantId, apiId);
LoggingApiOutputListDTO loggingApiOutputListDT = DevopsAPIUtils.getLoggingAPIList(apiLogInfoDTOList);
return Response.ok().entity(loggingApiOutputListDT).build();
}
use of org.wso2.carbon.apimgt.devops.impl.logging.APILoggingImpl in project carbon-apimgt by wso2.
the class TenantLogsApiServiceImpl method tenantLogsTenantIdApisGet.
public Response tenantLogsTenantIdApisGet(String tenantId, String logLevel, MessageContext messageContext) throws APIManagementException {
APILoggingImpl apiLoggingImpl = new APILoggingImpl();
List<APILogInfoDTO> apiLogInfoDTOList = apiLoggingImpl.getAPILoggerList(tenantId, logLevel);
LoggingApiOutputListDTO loggingApiOutputListDTO = DevopsAPIUtils.getLoggingAPIList(apiLogInfoDTOList);
return Response.ok().entity(loggingApiOutputListDTO).build();
}
use of org.wso2.carbon.apimgt.devops.impl.logging.APILoggingImpl in project carbon-apimgt by wso2.
the class TenantLogsApiServiceImpl method tenantLogsTenantIdApisApiIdPut.
public Response tenantLogsTenantIdApisApiIdPut(String tenantId, String apiId, LoggingApiInputDTO loggingApiInputDTO, MessageContext messageContext) throws APIManagementException {
if (apiId != null) {
if (DevopsAPIUtils.validateLogLevel(loggingApiInputDTO.getLogLevel())) {
APILoggingImpl apiLoggingImpl = new APILoggingImpl();
apiLoggingImpl.addUpdateAPILogger(tenantId, apiId, loggingApiInputDTO.getLogLevel().toUpperCase());
return Response.ok().entity(loggingApiInputDTO).build();
} else {
throw new APIManagementException("The input log level is incorrect: Input log level : " + loggingApiInputDTO.getLogLevel(), ExceptionCodes.from(ExceptionCodes.LOGGING_API_INCORRECT_LOG_LEVEL));
}
} else {
throw new APIManagementException("API ID is missing", ExceptionCodes.from(ExceptionCodes.LOGGING_API_MISSING_DATA));
}
}
Aggregations