Get-ServiceFabricReplica

Gets Service Fabric replicas of a partition.

Syntax

Get-ServiceFabricReplica
   [-PartitionId] <Guid>
   [[-ReplicaOrInstanceId] <Int64>]
   [-ReplicaStatusFilter <ServiceReplicaStatusFilter>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

Gets the list of System.Fabric.Query.Replica objects containing information such as health state and the address the replica is listening on.

This cmdlet is commonly used for diagnostic purposes.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Get the replica for a partition

PS C:\> $CalculatorPartition01 = Get-ServiceFabricPartition -ServiceName fabric:/myapp/calculator/svc1
PS C:\> Get-ServiceFabricReplica -PartitionId $CalculatorPartition01.PartitionId

The first command uses the Get-ServiceFabricPartition cmdlet to get the partition for the specified service, and then stores it in the $CalculatorPartition01.

The second command gets the Service Fabric replica by using the PartitionId property of the partition stored in $CalculatorPartition01.

Example 2: Get the partitioned replicas for a system service

PS C:\> Get-ServiceFabricPartition -ServiceName fabric:/System/FailoverManagerService | Get-ServiceFabricReplica

This command gets the list of replicas for the Failover Manager system service.

Parameters

-PartitionId

Specifies the ID of a Service Fabric partition.

Type:Guid
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ReplicaOrInstanceId

Specifies a Service Fabric service replica or instance ID.

Type:Int64
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ReplicaStatusFilter

Specifies the replica status filter as a ServiceReplicaStatusFilter object.

Type:ServiceReplicaStatusFilter
Accepted values:Default, InBuild, Standby, Ready, Down, Dropped, Completed, All
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Guid

System.Int64

Outputs

System.Object