コード例 #1
0
 public static function create_or_update_DMIObject($inputs, $update = false)
 {
     $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
     if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
         if (Cache::has('CR-' . $inputs["crId"])) {
             Cache::forget('CR-' . $inputs["crId"]);
         }
     }
     if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) {
         $localDataMovement = new LOCALDataMovement();
         $localdmp = Airavata::addLocalDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $localDataMovement);
         if ($localdmp) {
             print_r("The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.\n                Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
         }
     } else {
         if ($inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) {
             //var_dump( $inputs); exit;
             $scpDataMovement = new SCPDataMovement(array("securityProtocol" => intval($inputs["securityProtocol"]), "alternativeSCPHostName" => $inputs["alternativeSSHHostName"], "sshPort" => intval($inputs["sshPort"])));
             if ($update) {
                 $scpdmp = Airavata::updateSCPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $scpDataMovement);
             } else {
                 $scpdmp = Airavata::addSCPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $scpDataMovement);
             }
         } else {
             if ($inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) {
                 $gridFTPDataMovement = new GridFTPDataMovement(array("securityProtocol" => $inputs["securityProtocol"], "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]));
                 if ($update) {
                     $gridftpdmp = Airavata::updateGridFTPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $gridFTPDataMovement);
                 } else {
                     $gridftpdmp = Airavata::addGridFTPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $gridFTPDataMovement);
                 }
             } else {
                 if ($inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) {
                     $unicoreDataMovement = new UnicoreDataMovement(array("securityProtocol" => intval($inputs["securityProtocol"]), "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]));
                     if ($update) {
                         $unicoredmp = Airavata::updateUnicoreDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $unicoreDataMovement);
                     } else {
                         $unicoredmp = Airavata::addUnicoreDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreDataMovement);
                     }
                 } else {
                     print_r("Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
                 }
             }
         }
     }
 }
コード例 #2
0
public static function create_or_update_DMIObject( $inputs, $update = false){

    $computeResource = Utilities::get_compute_resource(  $inputs["crId"] );
    if( $inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */
    {
        $localDataMovement = new LOCALDataMovement();
        $localdmp = Airavata::addLocalDataMovementDetails( $computeResource->computeResourceId, 0, $localDataMovement);
        
        if( $localdmp)
            print_r( "The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.
                Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
    }
    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) /* SCP */
    {
        //var_dump( $inputs); exit;
        $scpDataMovement = new SCPDataMovement( array(
                                                "securityProtocol" => intval( $inputs["securityProtocol"] ),
                                                "alternativeSCPHostName" => $inputs["alternativeSSHHostName"],
                                                "sshPort" => intval( $inputs["sshPort"] )
                                                )

                                            );

        if( $update)
            $scpdmp = Airavata::updateSCPDataMovementDetails( $inputs["dmiId"], $scpDataMovement);
        else
            $scpdmp = Airavata::addSCPDataMovementDetails( $computeResource->computeResourceId, 0, $scpDataMovement);
   }
    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) /* GridFTP */
    {
        $gridFTPDataMovement = new GridFTPDataMovement( array(
                "securityProtocol" => $inputs["securityProtocol"],
                "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]
            ));
        if( $update)
            $gridftpdmp = Airavata::updateGridFTPDataMovementDetails( $inputs["dmiId"], $gridFTPDataMovement);
        else
            $gridftpdmp = Airavata::addGridFTPDataMovementDetails( $computeResource->computeResourceId, 0, $gridFTPDataMovement);
    }
    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) /* Unicore Storage Service */
    {
        $unicoreDataMovement  = new UnicoreDataMovement( array
                                                            (
                                                                "securityProtocol" => intval( $inputs["securityProtocol"]),
                                                                "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
                                                            )
                                                        );
        if( $update)
            $unicoredmp = Airavata::updateUnicoreDataMovementDetails( $inputs["dmiId"], $unicoreDataMovement);
        else
            $unicoredmp = Airavata::addUnicoreDataMovementDetails( $computeResource->computeResourceId, 0, $unicoreDataMovement);
    }
    else /* other data movement protocols */
    {
        print_r( "Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
    }
}
コード例 #3
0
 public static function create_or_update_DMIObject($inputs, $update = false)
 {
     $storageResource = SRUtilities::get_storage_resource($inputs["srId"]);
     if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) {
         $localDataMovement = new LOCALDataMovement();
         $localdmp = Airavata::addLocalDataMovementDetails(Session::get('authz-token'), $storageResource->storageResourceId, DMType::STORAGE_RESOURCE, 0, $localDataMovement);
     } else {
         if ($inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) {
             $scpDataMovement = new SCPDataMovement(array("securityProtocol" => intval($inputs["securityProtocol"]), "alternativeSCPHostName" => $inputs["alternativeSSHHostName"], "sshPort" => intval($inputs["sshPort"])));
             if ($update) {
                 $scpdmp = Airavata::updateSCPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $scpDataMovement);
             } else {
                 $scpdmp = Airavata::addSCPDataMovementDetails(Session::get('authz-token'), $storageResource->storageResourceId, DMType::STORAGE_RESOURCE, 0, $scpDataMovement);
             }
         } else {
             if ($inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) {
                 $gridFTPDataMovement = new GridFTPDataMovement(array("securityProtocol" => $inputs["securityProtocol"], "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]));
                 if ($update) {
                     $gridftpdmp = Airavata::updateGridFTPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $gridFTPDataMovement);
                 } else {
                     $gridftpdmp = Airavata::addGridFTPDataMovementDetails(Session::get('authz-token'), $storageResource->storageResourceId, DMType::STORAGE_RESOURCE, 0, $gridFTPDataMovement);
                 }
             } else {
                 if ($inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) {
                     $unicoreDataMovement = new UnicoreDataMovement(array("securityProtocol" => intval($inputs["securityProtocol"]), "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]));
                     if ($update) {
                         $unicoredmp = Airavata::updateUnicoreDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $unicoreDataMovement);
                     } else {
                         $unicoredmp = Airavata::addUnicoreDataMovementDetails(Session::get('authz-token'), $storageResource->storageResourceId, DMType::STORAGE_RESOURCE, 0, $unicoreDataMovement);
                     }
                 } else {
                     print_r("Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
                 }
             }
         }
     }
 }