use of com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementMetricTransformerHelper in project kylo by Teradata.
the class ServiceLevelAgreementRestController method saveAndScheduleFeedSla.
/**
* Save an SLA and attach the ref to the Feed
*/
@POST
@Path("/feed/{feedId}")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Saves the SLA and attaches it to the specified feed.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the SLA.", response = ServiceLevelAgreementGroup.class), @ApiResponse(code = 400, message = "The feedId is not a valid UUID.", response = RestResponseStatus.class), @ApiResponse(code = 500, message = "The SLA could not be saved.", response = RestResponseStatus.class) })
public Response saveAndScheduleFeedSla(@UUID @PathParam("feedId") String feedId, ServiceLevelAgreementGroup sla) {
accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_SERVICE_LEVEL_AGREEMENTS);
ServiceLevelAgreement serviceLevelAgreement = serviceLevelAgreementService.saveAndScheduleFeedSla(sla, feedId);
ServiceLevelAgreementMetricTransformerHelper helper = new ServiceLevelAgreementMetricTransformerHelper();
ServiceLevelAgreementGroup serviceLevelAgreementGroup = helper.toServiceLevelAgreementGroup(serviceLevelAgreement);
return Response.ok(serviceLevelAgreementGroup).build();
}
use of com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementMetricTransformerHelper in project kylo by Teradata.
the class ServiceLevelAgreementRestController method saveSla.
/**
* Save the General SLA coming in from the UI that is not related to a Feed
*/
@POST
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Saves the specified SLA.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the SLA.", response = ServiceLevelAgreementGroup.class), @ApiResponse(code = 500, message = "The SLA could not be saved.", response = RestResponseStatus.class) })
public Response saveSla(ServiceLevelAgreementGroup sla) {
accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_SERVICE_LEVEL_AGREEMENTS);
ServiceLevelAgreement serviceLevelAgreement = serviceLevelAgreementService.saveAndScheduleSla(sla);
ServiceLevelAgreementMetricTransformerHelper helper = new ServiceLevelAgreementMetricTransformerHelper();
ServiceLevelAgreementGroup serviceLevelAgreementGroup = helper.toServiceLevelAgreementGroup(serviceLevelAgreement);
return Response.ok(serviceLevelAgreementGroup).build();
}
Aggregations