mirror of https://github.com/apache/cloudstack.git
For volumes created from template, do not log offering ID in VOLUME.CREATE in usage_event. Moved offering type to DiskOffering interface
This commit is contained in:
parent
42cecbb000
commit
9eb8d538dd
|
|
@ -34,6 +34,10 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
|
|||
Inactive, Active,
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
Disk, Service
|
||||
};
|
||||
|
||||
State getState();
|
||||
|
||||
public enum DiskCacheMode {
|
||||
|
|
@ -114,4 +118,6 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
|
|||
DiskCacheMode getCacheMode();
|
||||
|
||||
void setCacheMode(DiskCacheMode cacheMode);
|
||||
|
||||
Type getType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -712,7 +712,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
|
|||
|
||||
Long offeringId = null;
|
||||
|
||||
offeringId = offering.getId();
|
||||
if (offering.getType() == DiskOffering.Type.Disk) {
|
||||
offeringId = offering.getId();
|
||||
}
|
||||
|
||||
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offeringId, vol.getTemplateId(), size,
|
||||
Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ import com.cloud.utils.db.GenericDao;
|
|||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING, length = 32)
|
||||
public class DiskOfferingVO implements DiskOffering {
|
||||
public enum Type {
|
||||
Disk, Service
|
||||
};
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import javax.persistence.EntityExistsException;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.storage.DiskOfferingVO;
|
||||
import com.cloud.storage.DiskOfferingVO.Type;
|
||||
import com.cloud.offering.DiskOffering.Type;
|
||||
import com.cloud.utils.db.Attribute;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import com.cloud.storage.Storage;
|
|||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.storage.DiskOfferingVO.Type;
|
||||
import com.cloud.offering.DiskOffering.Type;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
@Entity
|
||||
|
|
|
|||
Loading…
Reference in New Issue