Package com.cloud.api

Examples of com.cloud.api.ServerApiException


        if (result != null) {
            TemplateResponse response = _responseGenerator.createIsoResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update iso");
        }
    }
View Full Code Here


        boolean result = _domainService.deleteDomain(id, cleanup);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain");
        }
    }
View Full Code Here

      response.setResponses(resList);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    } catch (Exception e) {
      s_logger.warn("Failed to list storage network ip range for rangeId=" + getRangeId() + " podId=" + getPodId() + " zoneId=" + getZoneId());
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
    }
  }
View Full Code Here

      StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    } catch (Exception e) {
      s_logger.warn("Update storage network IP range failed", e);
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
    }

  }
View Full Code Here

        boolean result = _configService.deletePod(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete pod");
        }
    }
View Full Code Here

            boolean result = _rulesService.enableStaticNat(ipAddressId, virtualMachineId, getNetworkId(), false);
            if (result) {
                SuccessResponse response = new SuccessResponse(getCommandName());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable static nat");
            }
        } catch (NetworkRuleConflictException ex) {
            s_logger.info("Network rule conflict: " + ex.getMessage());
            s_logger.trace("Network Rule Conflict: ", ex);
            throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
        }
    }
View Full Code Here

                List<TemplateResponse> templateResponses = _responseGenerator.createTemplateResponses(template.getId(), zoneId, false);
                response.setResponses(templateResponses);
                response.setResponseName(getCommandName());             
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to register template");
            }
        } catch (URISyntaxException ex1) {
            s_logger.info(ex1);
            throw new ServerApiException(BaseCmd.PARAM_ERROR, ex1.getMessage());
        }
    }
View Full Code Here

            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            StoragePool pool = _storageService.getStoragePool(id);
            if (pool != null && pool.getStatus() == StoragePoolStatus.Removed) {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to finish storage pool removal. The storage pool will not be used but cleanup is needed");
            } else {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete storage pool");
            }
        }
    }
View Full Code Here

        Volume volume = _storageService.allocVolume(this);
        if (volume != null) {
            this.setEntityId(volume.getId());
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create volume");
       
    }
View Full Code Here

            //FIXME - have to be moved to ApiResponseHelper
            response.setSnapshotId(getSnapshotId())// if the volume was created from a snapshot, snapshotId will be set so we pass it back in the response
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a volume");
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.api.ServerApiException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.