Search in sources :

Example 1 with LOCALDataMovement

use of org.apache.airavata.model.data.movement.LOCALDataMovement in project airavata by apache.

the class ComputeResourceRegister method registerComputeHost.

public ComputeResourceProperties registerComputeHost(String hostName, String hostDesc, ResourceJobManagerType resourceJobManagerType, String monitoringEndPoint, String jobMangerBinPath, SecurityProtocol securityProtocol, String jobManagerCommand) throws TException {
    ComputeResourceDescription computeResourceDescription = createComputeResourceDescription(hostName, hostDesc, null, null);
    ComputeResourceProperties computeResourceProperties = new ComputeResourceProperties();
    String computeResourceId = airavata.registerComputeResource(authzToken, computeResourceDescription);
    computeResourceProperties.setComputeResourceId(computeResourceId);
    if (computeResourceId.isEmpty())
        throw new AiravataClientException();
    ResourceJobManager resourceJobManager = createResourceJobManager(resourceJobManagerType, monitoringEndPoint, jobMangerBinPath, null);
    if (jobManagerCommand != null) {
        Map<JobManagerCommand, String> jobManagerCommandStringMap = new HashMap<JobManagerCommand, String>();
        jobManagerCommandStringMap.put(JobManagerCommand.SUBMISSION, jobManagerCommand);
        resourceJobManager.setJobManagerCommands(jobManagerCommandStringMap);
    }
    LOCALSubmission localobSubmission = new LOCALSubmission();
    localobSubmission.setResourceJobManager(resourceJobManager);
    localobSubmission.setSecurityProtocol(securityProtocol);
    String localJobSubmissionId = airavata.addLocalSubmissionDetails(authzToken, computeResourceId, 0, localobSubmission);
    computeResourceProperties.setJobSubmissionId(localJobSubmissionId);
    airavata.addLocalDataMovementDetails(authzToken, computeResourceId, DMType.COMPUTE_RESOURCE, 0, new LOCALDataMovement());
    return computeResourceProperties;
}
Also used : HashMap(java.util.HashMap) LOCALDataMovement(org.apache.airavata.model.data.movement.LOCALDataMovement) ComputeResourceProperties(org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties) AiravataClientException(org.apache.airavata.model.error.AiravataClientException)

Example 2 with LOCALDataMovement

use of org.apache.airavata.model.data.movement.LOCALDataMovement in project airavata by apache.

the class StorageResourceRegister method registerStorageResource.

public String registerStorageResource(String hostName, String hostDesc) throws TException {
    StorageResourceDescription storageResourceDescription = createStorageResourceDescription(hostName, hostDesc);
    String storageResourceId = airavata.registerStorageResource(authzToken, storageResourceDescription);
    airavata.addLocalDataMovementDetails(authzToken, storageResourceId, DMType.STORAGE_RESOURCE, 0, new LOCALDataMovement());
    return storageResourceId;
}
Also used : StorageResourceDescription(org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription) LOCALDataMovement(org.apache.airavata.model.data.movement.LOCALDataMovement)

Aggregations

LOCALDataMovement (org.apache.airavata.model.data.movement.LOCALDataMovement)2 HashMap (java.util.HashMap)1 StorageResourceDescription (org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription)1 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)1 ComputeResourceProperties (org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties)1