CLOUDSTACK-3642: [Usage][PortableIP] CS is not generating usage events

for portable IPs

generating usage events for acquire/release of portable IP
This commit is contained in:
Murali Reddy 2013-07-19 18:42:52 +05:30
parent 2d9566eb8a
commit 28aaa7534a

View File

@ -535,7 +535,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
String guestType = vlan.getVlanType().toString();
if (!isIpDedicated(addr)) {
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_ASSIGN, owner.getId(),
String eventType = addr.isPortable() ? EventTypes.EVENT_PORTABLE_IP_ASSIGN : EventTypes.EVENT_NET_IP_ASSIGN;
UsageEventUtils.publishUsageEvent(eventType, owner.getId(),
addr.getDataCenterId(), addr.getId(), addr.getAddress().toString(), addr.isSourceNat(), guestType,
addr.getSystem(), addr.getClass().getName(), addr.getUuid());
}
@ -3531,7 +3532,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
String guestType = vlan.getVlanType().toString();
if (!isIpDedicated(ip)) {
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_RELEASE,
String eventType = ip.isPortable() ? EventTypes.EVENT_PORTABLE_IP_RELEASE : EventTypes.EVENT_NET_IP_RELEASE;
UsageEventUtils.publishUsageEvent( eventType,
ip.getAllocatedToAccountId(), ip.getDataCenterId(), addrId, ip.getAddress().addr(),
ip.isSourceNat(), guestType, ip.getSystem(), ip.getClass().getName(), ip.getUuid());
}