Get-​Service​Fabric​Deployed​Application​Health

Gets the health of a Service Fabric application on a node.

Syntax

Get-ServiceFabricDeployedApplicationHealth
   [-NodeName] <String>
   [-ApplicationName] <Uri>
   [-ConsiderWarningAsError <Boolean>]
   [-DeployedServicePackagesFilter <HealthStateFilter>]
   [-DeployedServicePackagesHealthStateFilter <Int64>]
   [-EventsFilter <HealthStateFilter>]
   [-EventsHealthStateFilter <Int64>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricDeployedApplicationHealth cmdlet gets the health of Service Fabric applications deployed on a node in a cluster. 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 an 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 application

PS C:\> Get-ServiceFabricDeployedApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01"

This command queries the health of the named application deployed on node named Node01.

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

PS C:\> Get-ServiceFabricDeployedApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01" -ConsiderWarningAsError $True -EventsFilter Error -DeployedServicePackagesFilter 'Warning,Error'

This command queries the health of the named application deployed on node Node01. It specifies values for health policy. It uses filters to return only Error events, and children with Error or Warning health states.

Required Parameters

-ApplicationName

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

Type:Uri
Position:2
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 application deployed to the node that you specify.

Type:String
Position:1
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
-DeployedServicePackagesFilter

Specifies the filter for DeployedServicePackageHealthState children based on health state. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only children that match the filter are returned. All children are used to evaluate the entity 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
-DeployedServicePackagesHealthStateFilter

This parameter has been deprecated. Specify the DeployedServicePackagesFilter instead.

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

Specifies the filter for the collection of HealthEvent reported on the entity 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 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

This cmdlet accepts a URI that represents the name of the Service Fabric application, or a string representing the Service Fabric node name.

Outputs

System.Object

This cmdlet returns the System.Fabric.Health.DeployedApplicationHealth object that represents the health of a deployed applications.