public void Delete(IConfigurable instance) { DatabaseAvailabilityGroupNetwork databaseAvailabilityGroupNetwork = (DatabaseAvailabilityGroupNetwork)instance; DagNetworkObjectId dagNetworkObjectId = (DagNetworkObjectId)databaseAvailabilityGroupNetwork.Identity; this.GetDagByName(dagNetworkObjectId.DagName); RemoveDagNetworkRequest removeDagNetworkRequest = new RemoveDagNetworkRequest(); removeDagNetworkRequest.Name = dagNetworkObjectId.NetName; DagNetworkRpc.RemoveDagNetwork(this.m_dag, removeDagNetworkRequest); }
// Token: 0x06001782 RID: 6018 RVA: 0x00061644 File Offset: 0x0005F844 internal DatabaseAvailabilityGroupNetwork[] GetDagNets() { if (this.m_networks.Count <= 0) { return(null); } DatabaseAvailabilityGroupNetwork[] array = new DatabaseAvailabilityGroupNetwork[this.m_networks.Count]; int num = 0; foreach (KeyValuePair <string, ExchangeNetwork> keyValuePair in this.m_networks) { ExchangeNetwork value = keyValuePair.Value; array[num++] = this.DescribeDagNetwork(value); } return(array); }
public void Save(IConfigurable instance) { DatabaseAvailabilityGroupNetwork databaseAvailabilityGroupNetwork = (DatabaseAvailabilityGroupNetwork)instance; DagNetworkObjectId dagNetworkObjectId = (DagNetworkObjectId)databaseAvailabilityGroupNetwork.Identity; SetDagNetworkRequest setDagNetworkRequest = new SetDagNetworkRequest(); if (dagNetworkObjectId == null) { setDagNetworkRequest.Name = databaseAvailabilityGroupNetwork.Name; } else { setDagNetworkRequest.Name = dagNetworkObjectId.NetName; } if (databaseAvailabilityGroupNetwork.IsChanged(DatabaseAvailabilityGroupNetworkSchema.Name)) { setDagNetworkRequest.NewName = databaseAvailabilityGroupNetwork.Name; } if (databaseAvailabilityGroupNetwork.IsChanged(DatabaseAvailabilityGroupNetworkSchema.Description)) { setDagNetworkRequest.Description = databaseAvailabilityGroupNetwork.Description; } if (databaseAvailabilityGroupNetwork.IsChanged(DatabaseAvailabilityGroupNetworkSchema.ReplicationEnabled)) { setDagNetworkRequest.ReplicationEnabled = databaseAvailabilityGroupNetwork.ReplicationEnabled; } if (databaseAvailabilityGroupNetwork.IsChanged(DatabaseAvailabilityGroupNetworkSchema.IgnoreNetwork)) { setDagNetworkRequest.IgnoreNetwork = databaseAvailabilityGroupNetwork.IgnoreNetwork; } if (databaseAvailabilityGroupNetwork.IsChanged(DatabaseAvailabilityGroupNetworkSchema.Subnets)) { setDagNetworkRequest.SubnetListIsSet = true; foreach (DatabaseAvailabilityGroupNetworkSubnet databaseAvailabilityGroupNetworkSubnet in databaseAvailabilityGroupNetwork.Subnets) { setDagNetworkRequest.Subnets.Add(databaseAvailabilityGroupNetworkSubnet.SubnetId, null); } } this.GetDagByName(dagNetworkObjectId.DagName); DagNetworkRpc.SetDagNetwork(this.m_dag, setDagNetworkRequest); DagNetworkObjectId identity = new DagNetworkObjectId(this.m_dag.Name, databaseAvailabilityGroupNetwork.Name); databaseAvailabilityGroupNetwork.SetIdentity(identity); databaseAvailabilityGroupNetwork.ResetChangeTracking(); this.m_dagNet = databaseAvailabilityGroupNetwork; }
public bool FindSubNet(DatabaseAvailabilityGroupSubnetId subnetToFind, out DatabaseAvailabilityGroupNetwork existingNetwork, out DatabaseAvailabilityGroupNetworkSubnet existingSubnet) { existingNetwork = null; existingSubnet = null; foreach (DatabaseAvailabilityGroupNetwork databaseAvailabilityGroupNetwork in this.Networks) { foreach (DatabaseAvailabilityGroupNetworkSubnet databaseAvailabilityGroupNetworkSubnet in databaseAvailabilityGroupNetwork.Subnets) { if (databaseAvailabilityGroupNetworkSubnet.SubnetId.Equals(subnetToFind)) { existingNetwork = databaseAvailabilityGroupNetwork; existingSubnet = databaseAvailabilityGroupNetworkSubnet; return(true); } } } return(false); }
// Token: 0x06001781 RID: 6017 RVA: 0x000614B8 File Offset: 0x0005F6B8 internal DatabaseAvailabilityGroupNetwork DescribeDagNetwork(ExchangeNetwork xNet) { DatabaseAvailabilityGroupNetwork databaseAvailabilityGroupNetwork = new DatabaseAvailabilityGroupNetwork(); databaseAvailabilityGroupNetwork.Name = xNet.Name; databaseAvailabilityGroupNetwork.Description = xNet.Description; databaseAvailabilityGroupNetwork.MapiAccessEnabled = xNet.MapiAccessEnabled; databaseAvailabilityGroupNetwork.ReplicationEnabled = xNet.ReplicationEnabled; databaseAvailabilityGroupNetwork.IgnoreNetwork = xNet.IgnoreNetwork; List <DatabaseAvailabilityGroupNetworkSubnet> list = new List <DatabaseAvailabilityGroupNetworkSubnet>(); foreach (ExchangeSubnet exchangeSubnet in xNet.Subnets) { if (xNet.IsMisconfigured) { exchangeSubnet.SubnetAndState.State = DatabaseAvailabilityGroupNetworkSubnet.SubnetState.Misconfigured; } list.Add(exchangeSubnet.SubnetAndState); } databaseAvailabilityGroupNetwork.Subnets = list.ToArray(); List <DatabaseAvailabilityGroupNetworkInterface> list2 = new List <DatabaseAvailabilityGroupNetworkInterface>(); if (xNet.EndPoints != null) { foreach (NetworkNodeEndPoints networkNodeEndPoints in xNet.EndPoints) { if (networkNodeEndPoints != null) { foreach (NetworkEndPoint networkEndPoint in networkNodeEndPoints.EndPoints) { list2.Add(new DatabaseAvailabilityGroupNetworkInterface { NodeName = networkEndPoint.NodeName, State = networkEndPoint.ClusterNicState, IPAddress = networkEndPoint.IPAddress }); } } } } databaseAvailabilityGroupNetwork.Interfaces = list2.ToArray(); return(databaseAvailabilityGroupNetwork); }
internal static void ValidateSwitches(DatabaseAvailabilityGroupNetwork net, Task.TaskErrorLoggingDelegate writeError) { if (net.IsModified(DatabaseAvailabilityGroupNetworkSchema.ReplicationEnabled) && net.IsModified(DatabaseAvailabilityGroupNetworkSchema.IgnoreNetwork)) { if (net.IgnoreNetwork && net.ReplicationEnabled) { writeError(new DagNetworkInconsistentRoleException(), ErrorCategory.InvalidArgument, null); return; } } else { if (net.IsModified(DatabaseAvailabilityGroupNetworkSchema.ReplicationEnabled) && net.ReplicationEnabled) { net.IgnoreNetwork = false; } if (net.IsModified(DatabaseAvailabilityGroupNetworkSchema.IgnoreNetwork) && net.IgnoreNetwork) { net.ReplicationEnabled = false; } } }
public DagNetwork(DatabaseAvailabilityGroupNetwork network) { this.Identity = network.Identity.ToIdentity(network.Name); this.ReplicationEnabled = network.ReplicationEnabled; }
public DatabaseAvailabilityGroupNetworkIdParameter(DatabaseAvailabilityGroupNetwork dagNet) { this.m_objectId = (DagNetworkObjectId)dagNet.Identity; this.m_rawName = this.m_objectId.FullName; }
internal static void ValidateSubnets(IEnumerable <DatabaseAvailabilityGroupSubnetId> subnets, DagNetworkConfiguration netConfig, string networkName, DatabaseAvailabilityGroupNetwork networkBeingChanged, Task.TaskErrorLoggingDelegate writeError, Task.TaskWarningLoggingDelegate writeWarning, Task.TaskVerboseLoggingDelegate writeVerbose) { SortedList <DatabaseAvailabilityGroupSubnetId, object> sortedList = new SortedList <DatabaseAvailabilityGroupSubnetId, object>(DagSubnetIdComparer.Comparer); foreach (DatabaseAvailabilityGroupSubnetId databaseAvailabilityGroupSubnetId in subnets) { int num = sortedList.IndexOfKey(databaseAvailabilityGroupSubnetId); if (num >= 0) { writeError(new DagNetworkDistinctSubnetListException(databaseAvailabilityGroupSubnetId.ToString(), sortedList.Keys[num].ToString()), ErrorCategory.InvalidArgument, null); } sortedList.Add(databaseAvailabilityGroupSubnetId, null); } foreach (DatabaseAvailabilityGroupSubnetId databaseAvailabilityGroupSubnetId2 in subnets) { DatabaseAvailabilityGroupNetwork databaseAvailabilityGroupNetwork; DatabaseAvailabilityGroupNetworkSubnet databaseAvailabilityGroupNetworkSubnet; if (!netConfig.FindSubNet(databaseAvailabilityGroupSubnetId2, out databaseAvailabilityGroupNetwork, out databaseAvailabilityGroupNetworkSubnet)) { writeWarning(Strings.DagNetworkUnknownSubnetWarning(databaseAvailabilityGroupSubnetId2.ToString())); } else { if (databaseAvailabilityGroupNetworkSubnet.State != DatabaseAvailabilityGroupNetworkSubnet.SubnetState.Unknown && !databaseAvailabilityGroupSubnetId2.IPRange.Equals(databaseAvailabilityGroupNetworkSubnet.SubnetId.IPRange)) { writeError(new DagNetworkSubnetIdConflictException(databaseAvailabilityGroupSubnetId2.ToString(), databaseAvailabilityGroupNetworkSubnet.SubnetId.ToString()), ErrorCategory.InvalidArgument, null); } if (databaseAvailabilityGroupNetwork != networkBeingChanged) { ExTraceGlobals.CmdletsTracer.TraceError <DatabaseAvailabilityGroupSubnetId, string, string>(0L, "Subnet {0} is moving from network {1} to {2}", databaseAvailabilityGroupSubnetId2, databaseAvailabilityGroupNetwork.Name, networkName); if (writeVerbose != null) { writeVerbose(Strings.DagNetworkSubnetMoving(databaseAvailabilityGroupSubnetId2.ToString(), databaseAvailabilityGroupNetwork.Name, networkName)); } } } } }