public void UnSubscribeNode(ApUnSubscribeNodeRequest request) { Log.Debug(typeof(ApNodeControllerService), "UnSubscribeNode()"); try { Node node = Database.GetInstance().Nodes.Find(x => x.IpAddress.Equals(request.IpAddress)); if (node != null) { Database.GetInstance().Nodes.Remove(node); // Update routing mesh in the load balancer LbRemoveApplicationInstanceRequest request_ = new LbRemoveApplicationInstanceRequest(Credentials); request_.NodeId = node.Id; request_.ApplicationId = -1; request_.InstanceId = -1; EndPoints.GetLbApplicationGridService().RemoveApplicationInstances(request_); } Log.Debug(typeof(ApNodeControllerService), "Node " + node.IpAddress + " removed successfully"); } catch (Exception e) { Log.Error(this, e); throw e; } }
private void UnSubscribeFromApplicationGrid() { try { ApUnSubscribeNodeRequest request = new ApUnSubscribeNodeRequest(Settings.Credentials); request.IpAddress = Database.Node.IpAddress; EndPoints.GetApNodeControllerService().UnSubscribeNode(request); } catch (Exception e) { Log.Error(this, e); } }