|
24 | 24 | import com.cloud.configuration.dao.ConfigurationDao; |
25 | 25 | import com.cloud.event.ActionEvent; |
26 | 26 | import com.cloud.event.EventTypes; |
| 27 | +import com.cloud.event.UsageEventUtils; |
27 | 28 | import com.cloud.exception.InvalidParameterValueException; |
28 | 29 | import com.cloud.exception.ResourceUnavailableException; |
29 | 30 | import com.cloud.network.Network; |
@@ -140,6 +141,11 @@ public GlobalLoadBalancerRule createGlobalLoadBalancerRule(CreateGlobalLoadBalan |
140 | 141 | stickyMethod, serviceType, regionId, gslbOwner.getId(), gslbOwner.getDomainId(), |
141 | 142 | GlobalLoadBalancerRule.State.Staged); |
142 | 143 | _gslbRuleDao.persist(newGslbRule); |
| 144 | + |
| 145 | + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_CREATE, newGslbRule.getAccountId(), |
| 146 | + 0, newGslbRule.getId(), name, GlobalLoadBalancerRule.class.getName(), |
| 147 | + newGslbRule.getUuid()); |
| 148 | + |
143 | 149 | txn.commit(); |
144 | 150 |
|
145 | 151 | s_logger.debug("successfully created new global load balancer rule for the account " + gslbOwner.getId()); |
@@ -438,6 +444,9 @@ private void revokeGslbRule(long gslbRuleId, Account caller) { |
438 | 444 | s_logger.debug("Rule Id: " + gslbRuleId + " is still in Staged state so just removing it."); |
439 | 445 | } |
440 | 446 | _gslbRuleDao.remove(gslbRuleId); |
| 447 | + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE, gslbRule.getAccountId(), |
| 448 | + 0, gslbRule.getId(), gslbRule.getName(), GlobalLoadBalancerRule.class.getName(), |
| 449 | + gslbRule.getUuid()); |
441 | 450 | return; |
442 | 451 | } else if (gslbRule.getState() == GlobalLoadBalancerRule.State.Add || gslbRule.getState() == GlobalLoadBalancerRule.State.Active) { |
443 | 452 | //mark the GSlb rule to be in revoke state |
@@ -480,6 +489,10 @@ private void revokeGslbRule(long gslbRuleId, Account caller) { |
480 | 489 | //remove the GSLB rule itself |
481 | 490 | _gslbRuleDao.remove(gslbRuleId); |
482 | 491 |
|
| 492 | + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE, gslbRule.getAccountId(), |
| 493 | + 0, gslbRule.getId(), gslbRule.getName(), GlobalLoadBalancerRule.class.getName(), |
| 494 | + gslbRule.getUuid()); |
| 495 | + |
483 | 496 | txn.commit(); |
484 | 497 | } |
485 | 498 |
|
|
0 commit comments