Get-ServiceFabricDeployedServicePackageHealth

Gets the health of a Service Fabric service package.

Syntax

Get-ServiceFabricDeployedServicePackageHealth
   [-ApplicationName] <Uri>
   [-ServiceManifestName] <String>
   [-NodeName] <String>
   [-ConsiderWarningAsError <Boolean>]
   [-EventsHealthStateFilter <Int64>]
   [-EventsFilter <HealthStateFilter>]
   [-ServicePackageActivationId <String>]
   [-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.

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:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ConsiderWarningAsError

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

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

-EventsFilter

Specifies the filter for the collection of HealthEvent objects 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
Accepted values:Default, None, Ok, Warning, Error, All
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
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:2
Default value:None
Required:True
Accept pipeline input:True
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:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServicePackageActivationId

The activation id of the deployed ServicePackage. This can be obtained by using the query Get-ServiceFabricDeployedServicePackage.

If ServicePackageActivationMode specified at the time of creating the service (using New-ServiceFabricService) is SharedProcess (or if it is not specified, in which case it defaults to SharedProcess), then value of ServicePackageActivationId is always an empty string and need not be specified. To learn more about service package activation id, please see [Service Fabric Hosting Model][1].

Type:String
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.Uri

System.String

Outputs

System.Object