public static void ApplyNode(Node node) { var existingNode = FindNode(node.Address); if (existingNode == null) { InsertNewNode(node); } else { UpdateNode(node); } }
private static void InsertNewNode(Node node) { if (_version.Major >= MajorVersionThatSwitchedToV2Classes) { F5Interfaces.LocalLBNodeAddressV2.create( new[] { node.Name }, new[] { node.Address }, new[] { node.ConnectionLimit }); } else { F5Interfaces.LocalLBNodeAddress.create( new[] { node.Address }, new[] { node.ConnectionLimit }); F5Interfaces.LocalLBNodeAddress.set_screen_name( new[] { node.Address }, new[] { node.Name }); } }
private static void UpdateNode(Node node) { F5Interfaces.LocalLBNodeAddress.set_connection_limit( new[] { node.Address }, new[] { new CommonULong64 { low = node.ConnectionLimit } }); }