Пример #1
0
 /**
  * Define configuration constants
  */
 public static function register_or_update_storage_resource($storageResourceDesc, $update = false)
 {
     if ($update) {
         $storageResourceId = $storageResourceDesc->storageResourceId;
         if (Airavata::updateStorageResource(Session::get('authz-token'), $storageResourceId, $storageResourceDesc)) {
             $storageResource = Airavata::getStorageResource(Session::get('authz-token'), $storageResourceId);
             return $storageResource;
         } else {
             print_r("Something went wrong while updating!");
         }
         exit;
     } else {
         $sr = new StorageResourceDescription($storageResourceDesc);
         $storageResourceId = Airavata::registerStorageResource(Session::get('authz-token'), $sr);
     }
     $storageResource = Airavata::getStorageResource(Session::get('authz-token'), $storageResourceId);
     return $storageResource;
 }