public RemoteServiceManager(ServiceId serviceId, ClientConfig clientConfig, RESTClient restClient, RemoteApplicationManager remoteApplicationManager) { super(serviceId, remoteApplicationManager); this.serviceId = serviceId; this.metricsClient = new MetricsClient(clientConfig, restClient); this.programClient = new ProgramClient(clientConfig, restClient); this.serviceClient = new ServiceClient(clientConfig, restClient); }
public RemoteApplicationManager(ApplicationId application, ClientConfig clientConfig, RESTClient restClient) { super(application); this.clientConfig = clientConfig; this.programClient = new ProgramClient(clientConfig, restClient); this.applicationClient = new ApplicationClient(clientConfig, restClient); this.restClient = restClient; }
public RemoteWorkflowManager(WorkflowId programId, ClientConfig clientConfig, RESTClient restClient, RemoteApplicationManager applicationManager) { super(programId, applicationManager); this.workflowId = programId; this.workflowClient = new WorkflowClient(clientConfig, restClient); this.scheduleClient = new ScheduleClient(clientConfig, restClient); }
public IntegrationTestManager(ClientConfig clientConfig, RESTClient restClient, File tmpFolder) { this.clientConfig = clientConfig; this.restClient = restClient; this.tmpFolder = tmpFolder; this.locationFactory = new LocalLocationFactory(tmpFolder); this.applicationClient = new ApplicationClient(clientConfig, restClient); this.artifactClient = new ArtifactClient(clientConfig, restClient); this.datasetClient = new DatasetClient(clientConfig, restClient); this.datasetModuleClient = new DatasetModuleClient(clientConfig, restClient); this.namespaceClient = new NamespaceClient(clientConfig, restClient); this.programClient = new ProgramClient(clientConfig, restClient); this.scheduleClient = new ScheduleClient(clientConfig, restClient); }
/** * Starts a program using the stored runtime arguments. * * @param program the program to start * @throws IOException if a network error occurred * @throws ProgramNotFoundException if the program with the specified name could not be found * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server */ public void start(ProgramId program, boolean debug) throws IOException, ProgramNotFoundException, UnauthenticatedException, UnauthorizedException { start(program, debug, null); }
/** * Retrieve the specified key from the {@link WorkflowToken} for the specified workflow run. * * @param workflowRunId the run id of the workflow * @param key the specified key * @return {@link WorkflowTokenDetail} containing all the values for the specified key */ public WorkflowTokenDetail getWorkflowToken(ProgramRunId workflowRunId, String key) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowToken(workflowRunId, null, key); }
@Override public String call() throws Exception { return getStatus(program); } }, timeout, timeoutUnit, 1, TimeUnit.SECONDS);
/** * Retrieve all the key-value pairs in a workflow run's {@link WorkflowToken} that were set by the specified node. * * @param workflowRunId the run id of the workflow * @param nodeName the name of the node * @return {@link WorkflowTokenNodeDetail} containing all the key-value pairs set by the specified node in the * specified workflow run's {@link WorkflowToken} */ public WorkflowTokenNodeDetail getWorkflowTokenAtNode(ProgramRunId workflowRunId, String nodeName) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowTokenAtNode(workflowRunId, nodeName, null, null); }
@Override public Boolean call() throws Exception { try { serviceClient.checkAvailability(serviceId); return true; } catch (ServiceUnavailableException e) { // simply retry in case its not yet available return false; } } }, timeout, timeoutUnit);
@Override public Map<String, String> getRuntimeArgs(ProgramId programId) throws Exception { return programClient.getRuntimeArgs(programId); } }
@Override public void delete() throws Exception { artifactClient.delete(artifactId); } }
@Override public void call() throws Exception { client.createRole(admins); } }, feature, configSetting);
@Override public void call() throws Exception { client.addRoleToPrincipal(admins, admin); } }, feature, configSetting);
@Override public void call() throws Exception { client.removeRoleFromPrincipal(admins, admin); } }, feature, configSetting);
@Override public void call() throws Exception { client.dropRole(admins); } }, feature, configSetting);
@Override public Boolean call() throws Exception { return exists(app); } }, timeout, timeoutUnit, 1, TimeUnit.SECONDS);
/** * Get information about all application classes in the specified namespace, of the specified class name. * * @param namespace the namespace to list application classes from * @return summaries of all application classes in the given namespace, including classes from system artifacts * @throws IOException if a network error occurred * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server */ public List<ApplicationClassInfo> getApplicationClasses(NamespaceId namespace, String className) throws IOException, UnauthenticatedException, UnauthorizedException { return getApplicationClasses(namespace, className, ArtifactScope.USER); }
@Override public RuntimeMetrics getMetrics() { return metricsClient.getServiceMetrics(serviceId); } }
/** * List all schedules for an existing workflow. * * @param workflow the ID of the workflow */ public List<ScheduleDetail> listSchedules(WorkflowId workflow) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException { return doList(workflow); }
/** * Retrieve all the keys in the {@link WorkflowToken} with the specified scope for the specified workflow run. * * @param workflowRunId the run id of the workflow * @param scope the specified {@link WorkflowToken.Scope} * @return {@link WorkflowTokenDetail} containing all the keys in the specified {@link WorkflowToken.Scope} * for the specified workflow run */ public WorkflowTokenDetail getWorkflowToken(ProgramRunId workflowRunId, WorkflowToken.Scope scope) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowToken(workflowRunId, scope, null); }