use of org.apache.airavata.model.data.movement.SCPDataMovement in project airavata by apache.
the class RegisterUS3Application method updateComputeHost.
public static String updateComputeHost(String computeResourceId, String hostName, String hostDesc, ResourceJobManagerType resourceJobManagerType, String monitoringEndPoint, String jobMangerBinPath, SecurityProtocol securityProtocol, int portNumber, String jobManagerCommand) throws TException {
if (computeResourceId.isEmpty())
throw new AiravataClientException();
ResourceJobManager resourceJobManager = RegisterSampleApplicationsUtils.createResourceJobManager(resourceJobManagerType, monitoringEndPoint, jobMangerBinPath, null);
if (jobManagerCommand != null) {
Map<JobManagerCommand, String> jobManagerCommandStringMap = new HashMap<JobManagerCommand, String>();
jobManagerCommandStringMap.put(JobManagerCommand.SUBMISSION, jobManagerCommand);
resourceJobManager.setJobManagerCommands(jobManagerCommandStringMap);
}
SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
sshJobSubmission.setResourceJobManager(resourceJobManager);
sshJobSubmission.setSecurityProtocol(securityProtocol);
sshJobSubmission.setSshPort(portNumber);
airavataClient.addSSHJobSubmissionDetails(new AuthzToken(""), computeResourceId, 1, sshJobSubmission);
ComputeResourceDescription computeResourceDescription = airavataClient.getComputeResource(new AuthzToken(""), computeResourceId);
computeResourceDescription.getJobSubmissionInterfacesIterator();
SCPDataMovement scpDataMovement = new SCPDataMovement();
scpDataMovement.setSecurityProtocol(securityProtocol);
scpDataMovement.setSshPort(portNumber);
airavataClient.addSCPDataMovementDetails(new AuthzToken(""), computeResourceId, DMType.COMPUTE_RESOURCE, 1, scpDataMovement);
return computeResourceId;
}
Aggregations