use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method registerGatewayProfile.
private void registerGatewayProfile() throws TException {
GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
ComputeResourcePreference localhostResourcePreference = RegisterSampleApplicationsUtils.createComputeResourcePreference(localhostId, gatewayId, false, null, null, null, "/tmp");
gatewayResourceProfile.setGatewayID(gatewayId);
gatewayResourceProfile.addToComputeResourcePreferences(localhostResourcePreference);
airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method createEchoExperiment.
private void createEchoExperiment() throws TException {
Project project = new Project();
project.setName("default-project");
project.setOwner(userId);
String projectId = airavataClient.createProject(new AuthzToken(""), gatewayId, project);
ExperimentModel experimentModel = new ExperimentModel();
experimentModel.setExperimentName("dummy-echo-experiment");
experimentModel.setProjectId(projectId);
experimentModel.setUserName(userId);
experimentModel.setGatewayId(gatewayId);
experimentModel.setExecutionId(echoInterfaceId);
UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
ComputationalResourceSchedulingModel computationalResourceSchedulingModel = new ComputationalResourceSchedulingModel();
computationalResourceSchedulingModel.setNodeCount(1);
computationalResourceSchedulingModel.setTotalCPUCount(1);
computationalResourceSchedulingModel.setTotalPhysicalMemory(512);
computationalResourceSchedulingModel.setResourceHostId(localhostId);
userConfigurationDataModel.setComputationalResourceScheduling(computationalResourceSchedulingModel);
experimentModel.setUserConfigurationData(userConfigurationDataModel);
List<InputDataObjectType> experimentInputs = new ArrayList<>();
experimentInputs.add(RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null));
experimentModel.setExperimentInputs(experimentInputs);
experimentModel.setExperimentOutputs(airavataClient.getApplicationOutputs(new AuthzToken(""), echoInterfaceId));
echoExperimentId = airavataClient.createExperiment(new AuthzToken(""), gatewayId, experimentModel);
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method registerEchoInterface.
private void registerEchoInterface() {
try {
System.out.println("#### Registering Echo Interface ####");
List<String> appModules = new ArrayList<String>();
appModules.add(echoModuleId);
InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null);
List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
applicationInputs.add(input1);
OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output", "", DataType.STRING, true, false, null);
List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
applicationOutputs.add(output1);
echoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), gatewayId, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Echo", "Echo application description", appModules, applicationInputs, applicationOutputs));
System.out.println("Echo Application Interface Id " + echoInterfaceId);
} catch (TException e) {
e.printStackTrace();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method registerGateway.
private String registerGateway() throws TException {
Gateway gateway = new Gateway();
gateway.setGatewayName(gatewayId);
gateway.setGatewayId(gatewayId);
gateway.setGatewayApprovalStatus(GatewayApprovalStatus.APPROVED);
return airavataClient.addGateway(new AuthzToken(""), gateway);
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterOGCEUS3Application method registerGatewayResourceProfile.
public static void registerGatewayResourceProfile() {
try {
System.out.println("#### Registering Gateway proflie #### \n");
ComputeResourcePreference stampedeResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(stampedeResourceId, "TG-STA110014S", false, null, null, null, "/scratch/01437/ogce/ultrascan_testing/");
ComputeResourcePreference trestlesResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(trestlesResourceId, "sds128", false, null, null, null, "/oasis/scratch/trestles/ogce/temp_project/gta-work-dirs/");
// ComputeResourcePreference lonestarResourcePreferences = RegisterSampleApplicationsUtils.
// createComputeResourcePreference(lonestarResourceId, "ULTRASCAN", false, null, null, null,
// "/scratch/01623/us3/airavata/");
//
// ComputeResourcePreference alamoResourcePreferences = RegisterSampleApplicationsUtils.
// createComputeResourcePreference(alamoResourceId, null, false, null, null, null,
// "/mnt/glusterfs/work/");
GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
gatewayResourceProfile.addToComputeResourcePreferences(stampedeResourcePreferences);
gatewayResourceProfile.addToComputeResourcePreferences(trestlesResourcePreferences);
// gatewayResourceProfile.addToComputeResourcePreferences(lonestarResourcePreferences);
// gatewayResourceProfile.addToComputeResourcePreferences(alamoResourcePreferences);
String gatewayProfile = airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
} catch (TException e) {
e.printStackTrace();
}
}
Aggregations