Share via


Get-ServiceFabricReplica

Gets Service Fabric replicas of a partition.

Syntax

Default (Default)

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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ReplicaOrInstanceId

Specifies a Service Fabric service replica or instance ID.

Parameter properties

Type:Int64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ReplicaStatusFilter

Specifies the replica status filter as a ServiceReplicaStatusFilter object.

Parameter properties

Type:ServiceReplicaStatusFilter
Default value:None
Accepted values:Default, InBuild, Standby, Ready, Down, Dropped, Completed, All
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSec

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.Guid

System.Int64

Outputs

System.Object