@Override @ActionEvent(eventType = EventTypes.EVENT_DISK_OFFERING_CREATE, eventDescription = "creating disk offering") public DiskOffering createDiskOffering(final CreateDiskOfferingCmd cmd) { final String name = cmd.getOfferingName(); final String description = cmd.getDisplayText(); final String provisioningType = cmd.getProvisioningType(); final Long numGibibytes = cmd.getDiskSize(); final boolean isDisplayOfferingEnabled = cmd.getDisplayOffering() != null ? cmd.getDisplayOffering() : true; final boolean isCustomized = cmd.isCustomized() != null ? cmd.isCustomized() : false; // false final String tags = cmd.getTags(); final Long domainId = cmd.getDomainId(); final String storageType = cmd.getStorageType(); if (storageType != null) { if (storageType.equalsIgnoreCase(ServiceOffering.StorageType.local.toString())) { final Boolean isCustomizedIops = cmd.isCustomizedIops(); final Long minIops = cmd.getMinIops(); final Long maxIops = cmd.getMaxIops(); final Long bytesReadRate = cmd.getBytesReadRate(); final Long bytesWriteRate = cmd.getBytesWriteRate(); final Long iopsReadRate = cmd.getIopsReadRate(); final Long iopsWriteRate = cmd.getIopsWriteRate(); final Integer hypervisorSnapshotReserve = cmd.getHypervisorSnapshotReserve();
@Override public void execute() { DiskOffering offering = _configService.createDiskOffering(this); if (offering != null) { DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering); response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create disk offering"); } } }