mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-3642: [Usage][PortableIP] CS is not generating usage events
for portable IPs generating usage event for acquire and release
This commit is contained in:
parent
4c729e758b
commit
b2fdfc5084
@ -540,8 +540,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||||||
String guestType = vlan.getVlanType().toString();
|
String guestType = vlan.getVlanType().toString();
|
||||||
|
|
||||||
if (!isIpDedicated(addr)) {
|
if (!isIpDedicated(addr)) {
|
||||||
String eventType = addr.isPortable() ? EventTypes.EVENT_PORTABLE_IP_ASSIGN : EventTypes.EVENT_NET_IP_ASSIGN;
|
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_ASSIGN, owner.getId(),
|
||||||
UsageEventUtils.publishUsageEvent(eventType, owner.getId(),
|
|
||||||
addr.getDataCenterId(), addr.getId(), addr.getAddress().toString(), addr.isSourceNat(), guestType,
|
addr.getDataCenterId(), addr.getId(), addr.getAddress().toString(), addr.isSourceNat(), guestType,
|
||||||
addr.getSystem(), addr.getClass().getName(), addr.getUuid());
|
addr.getSystem(), addr.getClass().getName(), addr.getUuid());
|
||||||
}
|
}
|
||||||
@ -844,6 +843,11 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||||||
ipaddr.setAllocatedToAccountId(ipOwner.getId());
|
ipaddr.setAllocatedToAccountId(ipOwner.getId());
|
||||||
ipaddr= _ipAddressDao.persist(ipaddr);
|
ipaddr= _ipAddressDao.persist(ipaddr);
|
||||||
|
|
||||||
|
String guestType = vlan.getVlanType().toString();
|
||||||
|
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_PORTABLE_IP_ASSIGN, ipaddr.getId(),
|
||||||
|
ipaddr.getDataCenterId(), ipaddr.getId(), ipaddr.getAddress().toString(), ipaddr.isSourceNat(), null,
|
||||||
|
ipaddr.getSystem(), ipaddr.getClass().getName(), ipaddr.getUuid());
|
||||||
|
|
||||||
txn.commit();
|
txn.commit();
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user