public static void renameVPlexVolume(Volume vplexVolume,String newVolumeName,VPlexApiClient client,DbClient dbClient) throws Exception {
  try {
    if (vplexVolume == null) {
      s_logger.warn("The passed volume is null.");
      return;
    }
    if (!VPlexUtil.isVplexVolume(vplexVolume,dbClient)) {
      s_logger.warn("Volume {} can not be renamed because it is not a VPLEX volume.",vplexVolume.getId());
      return;
    }
    VPlexVirtualVolumeInfo vvInfo=client.findVirtualVolume(vplexVolume.getDeviceLabel(),vplexVolume.getNativeId());
    vvInfo=renameVolumeOnVPlex(vvInfo,newVolumeName,client);
    vplexVolume.setNativeId(vvInfo.getPath());
    vplexVolume.setNativeGuid(vvInfo.getPath());
    vplexVolume.setLabel(vvInfo.getName());
    vplexVolume.setDeviceLabel(vvInfo.getName());
    dbClient.updateObject(vplexVolume);
  }
 catch (  Exception e) {
    s_logger.warn(String.format("Error attempting to rename VPLEX volume %s",vplexVolume.getDeviceLabel()),e);
    throw e;
  }
}

public static void renameVPlexVolume ( Volume vplexVolume , String newVolumeName , VPlexApiClient client , DbClient dbClient ) throws Exception { try { if ( vplexVolume == null ) { s_logger . warn ( "The passed volume is null." ) ; return ; } if ( ! VPlexUtil . isVplexVolume ( vplexVolume , dbClient ) ) { s_logger . warn ( "Volume {} can not be renamed because it is not a VPLEX volume." , vplexVolume . getId ( ) ) ; return ; } VPlexVirtualVolumeInfo vvInfo = client . findVirtualVolume ( vplexVolume . getDeviceLabel ( ) , vplexVolume . getNativeId ( ) ) ; vvInfo = renameVolumeOnVPlex ( vvInfo , newVolumeName , client ) ; vplexVolume . setNativeId ( vvInfo . getPath ( ) ) ; vplexVolume . setNativeGuid ( vvInfo . getPath ( ) ) ; vplexVolume . setLabel ( vvInfo . getName ( ) ) ; vplexVolume . setDeviceLabel ( vvInfo . getName ( ) ) ; dbClient . updateObject ( vplexVolume ) ; } catch ( Exception e ) { s_logger . warn ( String . format ( "Error attempting to rename VPLEX volume %s" , vplexVolume . getDeviceLabel ( ) ) , e ) ; throw e ; } }
renames the volume represented by the passed vplex volume info with the passed name .
