GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingRulesService { @Override @ActionEvent(eventType = EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE, eventDescription = "Delete global load balancer rule") public boolean deleteGlobalLoadBalancerRule(DeleteGlobalLoadBalancerRuleCmd deleteGslbCmd) { CallContext ctx = CallContext.current(); Account caller = ctx.getCallingAccount(); long gslbRuleId = deleteGslbCmd.getGlobalLoadBalancerId(); try { revokeGslbRule(gslbRuleId, caller); } catch (Exception e) { s_logger.warn("Failed to delete GSLB rule due to" + e.getMessage()); return false; } return true; }  void setGslbServiceProviders(List<GslbServiceProvider> providers); @Override @DB @ActionEvent(eventType = EventTypes.EVENT_GLOBAL_LOAD_BALANCER_CREATE, eventDescription = "creating global load " + "balancer rule", create = true) GlobalLoadBalancerRule createGlobalLoadBalancerRule(CreateGlobalLoadBalancerRuleCmd newRule); @Override @DB @ActionEvent(eventType = EventTypes.EVENT_ASSIGN_TO_GLOBAL_LOAD_BALANCER_RULE, eventDescription = "Assigning a load balancer rule to global load balancer rule", async = true) boolean assignToGlobalLoadBalancerRule(AssignToGlobalLoadBalancerRuleCmd assignToGslbCmd); @Override @DB @ActionEvent(eventType = EventTypes.EVENT_REMOVE_FROM_GLOBAL_LOAD_BALANCER_RULE, eventDescription = "Removing a load balancer rule to be part of global load balancer rule") boolean removeFromGlobalLoadBalancerRule(RemoveFromGlobalLoadBalancerRuleCmd removeFromGslbCmd); @Override @ActionEvent(eventType = EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE, eventDescription = "Delete global load balancer rule") boolean deleteGlobalLoadBalancerRule(DeleteGlobalLoadBalancerRuleCmd deleteGslbCmd); @Override GlobalLoadBalancerRule updateGlobalLoadBalancerRule(UpdateGlobalLoadBalancerRuleCmd updateGslbCmd); @Override List<GlobalLoadBalancerRule> listGlobalLoadBalancerRule(ListGlobalLoadBalancerRuleCmd listGslbCmd); @Override List<LoadBalancer> listSiteLoadBalancers(long gslbRuleId); @Override boolean revokeAllGslbRulesForAccount(com.cloud.user.Account caller, long accountId); @Override GlobalLoadBalancerRule findById(long gslbRuleId);  }
@Test public void testDeleteGlobalLoadBalancerRule() throws Exception { s_logger.info("Running tests for DeleteGlobalLoadBalancerRule() service API"); runDeleteGlobalLoadBalancerRuleTestWithNoLbRules(); runDeleteGlobalLoadBalancerRuleTestWithLbRules(); }