@RestLiActions(name = "user", namespace = "azkaban.restli") public class UserManagerResource extends ResourceContextHolder {
@Action(name = "login") public String login(@ActionParam("username") final String username, @ActionParam("password") final String password) throws UserManagerException, ServletException { final String ip = ResourceUtils.getRealClientIpAddr(this.getContext()); logger .info("Attempting to login for " + username + " from ip '" + ip + "'"); final Session session = createSession(username, password, ip); logger.info("Session id created for user '" + username + "' and ip " + ip); return session.getSessionId(); }
@RestLiCollection(name = "policies", namespace = "org.apache.gobblin.restli.throttling") public class PoliciesResource extends CollectionResourceTemplate<String, Policy> {
@Action(name = "startFlashback") public void startFlashback(@ActionParam("sceneMode") String sceneMode, @ActionParam("sceneName") String sceneName, @ActionParam("matchRule") String matchRule, @ActionParam("scenePath") String scenePath, @ActionParam("proxyHost") @Optional String proxyHost, @ActionParam("proxyPort") @Optional String proxyPort, @ActionParam("caCertPath") @Optional String caCertPath, @ActionParam("caCertPwd") @Optional String caCertPwd, @ActionParam("caAlias") @Optional String caAlias, @ActionParam("caKeyPwd") @Optional String caKeyPwd, @ActionParam("caCertCN") @Optional String caCertCN, @ActionParam("caCertOU") @Optional String caCertOU, @ActionParam("caCertO") @Optional String caCertO, @ActionParam("caCertL") @Optional String caCertL, @ActionParam("caCertCC") @Optional String caCertCC) { _currSceneMode = SceneMode.fromString(sceneMode); if (_currSceneMode == null) {
@Finder("latestFlowStatus") public List<FlowStatus> getLatestFlowStatus(@Context PagingContext context, @QueryParam("flowId") FlowId flowId) { LOG.info("getLatestFlowStatus called with flowGroup " + flowId.getFlowGroup() + " flowName " + flowId.getFlowName()); org.apache.gobblin.service.monitoring.FlowStatus latestFlowStatus = _flowStatusGenerator.getLatestFlowStatus(flowId.getFlowName(), flowId.getFlowGroup()); if (latestFlowStatus != null) { return Collections.singletonList(convertFlowStatus(latestFlowStatus)); } // will return 404 status code return null; }
@RestMethod.Get public void get( ComplexResourceKey<PermitRequest, EmptyRecord> key, @CallbackParam final Callback<PermitAllocation> callback) { try (Closeable context = this.requestTimer == null ? NoopCloseable.INSTANCE : this.requestTimer.time()) {
@Action(name = "shutDownFlashback") public void shutDownFlashback() { validate(); _flashbackRunner.stop(); }
@RestLiCollection(name = "jobExecutions", namespace = "org.apache.gobblin.rest") public class JobExecutionInfoResource extends ComplexKeyResourceTemplate<JobExecutionQuery, EmptyRecord, JobExecutionQueryResult> {
@Action(name = "getUserFromSessionId") public User getUserFromSessionId(@ActionParam("sessionId") final String sessionId) { final Session session = getSessionFromSessionId(sessionId); final azkaban.user.User azUser = session.getUser(); // Fill out the restli object with properties from the Azkaban user final User user = new User(); user.setUserId(azUser.getUserId()); user.setEmail(azUser.getEmail()); return user; }
@Action(name="returnBoolOptionalParam") public boolean returnBoolOptionalParam(@Optional @ActionParam("param") final Boolean param) { return (param == null? Boolean.TRUE : param); }
@RestLiActions(name = "project", namespace = "azkaban.restli") public class ProjectManagerResource extends ResourceContextHolder {
@RestLiCollection(name = "flowstatuses", namespace = "org.apache.gobblin.service", keyName = "id") public class FlowStatusResource extends ComplexKeyResourceTemplate<FlowStatusId, EmptyRecord, FlowStatus> { private static final Logger LOG = LoggerFactory.getLogger(FlowStatusResource.class);
@Action(name = "deploy") public String deploy(@ActionParam("sessionId") final String sessionId, @ActionParam("projectName") final String projectName, @ActionParam("packageUrl") final String packageUrl) throws ProjectManagerException, RestLiServiceException, UserManagerException, ServletException, IOException, SchedulerException, ExecutorManagerException {
@RestLiActions(name = "admin", namespace = "com.linkedin.flashback") public class FlashbackAdminResource{ private static FlashbackRunner _flashbackRunner;
@RestLiCollection(name = "flowconfigsV2", namespace = "org.apache.gobblin.service", keyName = "id") public class FlowConfigsV2Resource extends ComplexKeyResourceTemplate<FlowId, FlowStatusId, FlowConfig> { private static final Logger LOG = LoggerFactory.getLogger(FlowConfigsV2Resource.class);
@Action(name = "changeMatchRule") public void changeMatchRule(@ActionParam("matchRule") String matchRule) { validate(); MatchRule namedMatchRule = NamedMatchRule.fromString(matchRule); if (namedMatchRule == null) { throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, "Unknown match rule" + matchRule); } _flashbackRunner.setMatchRule(namedMatchRule); }
@RestLiCollection(name = "flowconfigs", namespace = "org.apache.gobblin.service", keyName = "id") public class FlowConfigsResource extends ComplexKeyResourceTemplate<FlowId, EmptyRecord, FlowConfig> { private static final Logger LOG = LoggerFactory.getLogger(FlowConfigsResource.class);
@Action(name = "changeScene") public void changeScene(@ActionParam("sceneName") String sceneName) { validate(); SceneConfiguration sceneConfiguration = new SceneConfiguration(_scenePath, _currSceneMode, sceneName); try { _flashbackRunner.setScene(SceneFactory.create(sceneConfiguration)); } catch (IOException e) { throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, e); } }
@RestLiCollection(name = "permits", namespace = "org.apache.gobblin.restli.throttling") public class LimiterServerResource extends ComplexKeyResourceAsyncTemplate<PermitRequest, EmptyRecord, PermitAllocation> {
@Action(name = "FruitsRef", returnTyperef=FruitsRef.class) public Fruits FruitsFunc(@ActionParam(value="arg1", typeref=FruitsRef.class) Fruits arg1) { return Fruits.APPLE; }