Share via


AvailabilityGroupState Class

Definition

This is an adapter class that implements the IAvailabilityGroupState logical facet for an Availability Group.

public class AvailabilityGroupState : Microsoft.SqlServer.Management.Common.IRefreshable, Microsoft.SqlServer.Management.Facets.IDmfAdapter, Microsoft.SqlServer.Management.Sdk.Sfc.IDmfFacet, Microsoft.SqlServer.Management.Smo.IAvailabilityGroupState
type AvailabilityGroupState = class
    interface IAvailabilityGroupState
    interface IDmfFacet
    interface IRefreshable
    interface IDmfAdapter
Public Class AvailabilityGroupState
Implements IAvailabilityGroupState, IDmfAdapter, IDmfFacet, IRefreshable
Inheritance
AvailabilityGroupState
Implements

Constructors

AvailabilityGroupState(AvailabilityGroup)

Initializes a new instance of the AvailabilityGroupState class.

Properties

IsAutoFailover

Gets a value indicating whether the failover mode of the availability group is is Automatic Failover. Accessing this property may result in an exception, so we initialize it seperately. Specifically, if the primary replica is not currently visible, we throw an exception indicating this. This only occurs when accessing this property from a secondary replica that cannot communicate with the cluster store.

IsOnline

Gets a value indicating whether the Availability Group is up. This is true if a functioning primary replica exists for the Availability Group.

NumberOfDisconnectedReplicas

Gets the nubmer of replicas that are not in a "Connected" state

NumberOfNotSynchronizedReplicas

Gets the number of replicas that are not in a "Synchronized" state. Since only synchronous replicas can be in a "synchronized" state, this does not apply to asynchronous replicas

NumberOfNotSynchronizingReplicas

Gets the nubmer of replicas in a "Not Synchronizing" state.

NumberOfReplicasWithUnhealthyRole

Gets the number of replicas that are neither a primary or a secondary in the Availability Group.

NumberOfSynchronizedSecondaryReplicas

Gets the number of synchronous secondary replicas with Automatic Failover mode and Synchronized state.

Methods

Refresh()

Refresh the availability group state data.

Applies to