Share via


Get-ServiceFabricDeployedServicePackageHealth

Gets the health of a Service Fabric service package.

Syntax

Default (Default)

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.

Parameter properties

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

-ConsiderWarningAsError

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

Parameter properties

Type:Boolean
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

-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.

Parameter properties

Type:HealthStateFilter
Default value:None
Accepted values:Default, None, Ok, Warning, Error, 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

-EventsHealthStateFilter

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

Parameter properties

Type:Int64
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

-NodeName

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

Parameter properties

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

Parameter sets

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

-ServiceManifestName

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

Parameter properties

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

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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].

Parameter properties

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

-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.Uri

System.String

Outputs

System.Object