コード例 #1
0
 @Override
 public void execute()
     throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
         ConcurrentOperationException, ResourceAllocationException {
   try {
     netappMgr.destroyVolumeOnFiler(ipAddr, aggrName, volumeName);
     DeleteVolumeOnFilerCmdResponse response = new DeleteVolumeOnFilerCmdResponse();
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } catch (InvalidParameterValueException e) {
     throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
   } catch (ResourceInUseException e) {
     throw new ServerApiException(ApiErrorCode.RESOURCE_IN_USE_ERROR, e.toString());
   } catch (ServerException e) {
     throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString());
   }
 }
コード例 #2
0
  @Override
  public void execute()
      throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
          ConcurrentOperationException, ResourceAllocationException {
    // param checks
    if (snapshotReservation != null && (snapshotReservation < 0 || snapshotReservation > 100))
      throw new InvalidParameterValueException("Invalid snapshot reservation");

    ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
    NetappManager netappMgr = locator.getManager(NetappManager.class);

    StringBuilder s = new StringBuilder(getVolSize().toString());
    s.append("g");

    try {
      netappMgr.createVolumeOnFiler(
          ipAddress,
          aggrName,
          poolName,
          volName,
          s.toString(),
          snapshotPolicy,
          snapshotReservation,
          userName,
          password);
      CreateVolumeOnFilerCmdResponse response = new CreateVolumeOnFilerCmdResponse();
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    } catch (ServerException e) {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString());
    } catch (InvalidParameterValueException e) {
      throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
    } catch (UnknownHostException e) {
      throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
    }
  }