Get-​Service​Fabric​Deployed​Service​Package​Health

Gets the health of a Service Fabric service package.

Syntax

Get-ServiceFabricDeployedServicePackageHealth
   [-ApplicationName] <Uri>
   [-ServiceManifestName] <String>
   [-NodeName] <String>
   [-ConsiderWarningAsError <Boolean>]
   [-EventsFilter <HealthStateFilter>]
   [-EventsHealthStateFilter <Int64>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricDeployedServicePackageHealth cmdlet gets the health of a Service Fabric service package deployed on a specified node. Service Fabric reports the following health states:

- OK. The entity meets health guidelines.

  • Error. The entity does not meet health guidelines.
  • Warning. The entity meets health guidelines but experienced some issue.

    If the application is not deployed on the specified node, this cmdlet returns error. If the deployed service package does not exist, this cmdlet returns error.

    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 health of a deployed service package

PS C:\> Get-ServiceFabricDeployedServicePackageHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01" -ServiceManifestName "ServicePackageA"

This command queries the health of the specified deployed service package.

Example 2: Get the health of a deployed service package using custom health policy and return filters

PS C:\> Get-ServiceFabricDeployedServicePackageHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01" -ServiceManifestName "ServicePackageA" -ConsiderWarningAsError $True -EventsFilter Error

This command queries the health of the specified deployed service package with custom health policy and error events filter.

Required Parameters

-ApplicationName

Specifies the Uniform Resource Identifier (URI) of a Service Fabric application. The cmdlet gets health information for the deployed service package of the application that you specify.

Type:Uri
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NodeName

Specifies the name of a Service Fabric node. The cmdlet gets health information for the service package for the node that you specify.

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServiceManifestName

Specifies the name of a Service Fabric service manifest. The cmdlet gets health information for the service manifest that you specify.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ConsiderWarningAsError

Indicates whether to treat a warning health report as error during health evaluation.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsFilter

Specifies the filter for the collection of HealthEvents reported on the service package based on health state. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only events that match the filter are returned. All events are used to evaluate the service package aggregated health state. If not specified, all entries are returned.

Type:HealthStateFilter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsHealthStateFilter

This parameter has been deprecated. Specify the EventsFilter parameter instead.

Type:Int64
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Uri, String

Outputs

System.Object