use of com.netflix.titus.common.framework.fit.FitAction in project titus-control-plane by Netflix.
the class DefaultFitInjection method getAction.
@Override
public FitAction getAction(String actionId) {
FitAction action = actions.get(actionId);
Preconditions.checkArgument(action != null, "Action %s not found", actionId);
return action;
}
use of com.netflix.titus.common.framework.fit.FitAction in project titus-control-plane by Netflix.
the class FitSpringResource method addAction.
@RequestMapping(method = RequestMethod.POST, path = "/actions", consumes = "application/json")
public Response addAction(@RequestBody Fit.AddAction request) {
FitComponent fitComponent = FitUtil.getFitComponentOrFail(fitFramework, request.getComponentId());
FitInjection fitInjection = FitUtil.getFitInjectionOrFail(request.getInjectionId(), fitComponent);
Function<FitInjection, FitAction> fitActionFactory = fitFramework.getFitRegistry().newFitActionFactory(request.getActionKind(), request.getActionId(), request.getPropertiesMap());
fitInjection.addAction(fitActionFactory.apply(fitInjection));
return Response.noContent().build();
}
use of com.netflix.titus.common.framework.fit.FitAction in project titus-control-plane by Netflix.
the class FitResource method addAction.
@POST
@Path("/actions")
public Response addAction(Fit.AddAction request) {
FitComponent fitComponent = FitUtil.getFitComponentOrFail(fitFramework, request.getComponentId());
FitInjection fitInjection = FitUtil.getFitInjectionOrFail(request.getInjectionId(), fitComponent);
Function<FitInjection, FitAction> fitActionFactory = fitFramework.getFitRegistry().newFitActionFactory(request.getActionKind(), request.getActionId(), request.getPropertiesMap());
fitInjection.addAction(fitActionFactory.apply(fitInjection));
return Response.noContent().build();
}
Aggregations