Get-ServiceFabricApplication

Gets the application(s) on the Service Fabric cluster.

Syntax

Get-ServiceFabricApplication
   [[-ApplicationName] <Uri>]
   [-ApplicationTypeName <String>]
   [-ExcludeApplicationParameters]
   [-ContinuationToken <String>]
   [-ApplicationDefinitionKindFilter <ApplicationDefinitionKindFilter>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]
Get-ServiceFabricApplication
   [[-ApplicationName] <Uri>]
   [-ApplicationTypeName <String>]
   [-ExcludeApplicationParameters]
   [-GetSinglePage]
   [-ContinuationToken <String>]
   [-MaxResults <Int64>]
   [-ApplicationDefinitionKindFilter <ApplicationDefinitionKindFilter>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricApplication cmdlet gets the application(s) on the Service Fabric cluster. By default, there are no restrictions on the number of query results that can be returned by this query, regardless of the max message size configuration; while this is a paged query, unlike the REST or C# equivalent calls, the default behavior of this query is to loop through all returned pages transparently. The GetSinglePage option configures this query to return a single page.

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 all applications

PS C:\> Get-ServiceFabricApplication

ApplicationName           : fabric:/samples/CalculatorApp
ApplicationTypeName       : CalculatorApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

ApplicationName           : fabric:/samples/CalculatorAppWithAppParameters
ApplicationTypeName       : CalculatorApp
ApplicationTypeVersion    : 2.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : { "ServiceInstanceCount" = "4" }

ApplicationName           : fabric:/samples/PQueueApp1
ApplicationTypeName       : PersistentQueueApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

ApplicationName           : fabric:/VQueueApp1
ApplicationTypeName       : Compose_0
ApplicationTypeVersion    : v0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : Compose
ApplicationParameters     : {}

This command gets all the applications in the cluster.

Example 2: Get application by name

PS C:\> Get-ServiceFabricApplication -ApplicationName fabric:/samples/PQueueApp1

ApplicationName           : fabric:/samples/PQueueApp1
ApplicationTypeName       : PersistentQueueApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

This command gets the specific application with the name fabric:/samples/PQueueApp1.

Example 3: Get application by type name

PS C:\>Get-ServiceFabricApplication -ApplicationTypeName PersistentQueueApp

ApplicationName           : fabric:/samples/PQueueApp1
ApplicationTypeName       : PersistentQueueApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

This command gets the Service Fabric application(s) whose type name is PersistentQueueApp.

Example 4: Get application by definition kind

PS C:\>Get-ServiceFabricApplication -ApplicationDefinitionKindFilter Compose

ApplicationName           : fabric:/VQueueApp1
ApplicationTypeName       : Compose_0
ApplicationTypeVersion    : v0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : Compose
ApplicationParameters     : {}

This command gets the Service Fabric application(s) which are defined by Service Fabric application description.

Example 5: Get application with max results

PS C:\>Get-ServiceFabricApplication -MaxResults 2 -GetSinglePage -Verbose

ApplicationName           : fabric:/samples/CalculatorApp
ApplicationTypeName       : CalculatorApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

ApplicationName           : fabric:/samples/CalculatorAppWithAppParameters
ApplicationTypeName       : CalculatorApp
ApplicationTypeVersion    : 2.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : "ServiceInstanceCount" = "4"
                            

VERBOSE: Continuation Token: fabric:/samples/CalculatorAppWithAppParameters

This command gets all the Service Fabric application(s) in the cluster which fit onto a page. While there are more applications in the cluster, only two results are returned as configured by the MaxResults parameter. Because there are results which do not fit onto the page, a continuation token value is returned, indicating the presence of subsequent pages.

Example 6: Get application with continuation token

PS C:\>Get-ServiceFabricApplication -ContinuationToken fabric:/samples/CalculatorAppWithAppParameters -GetSinglePage -Verbose

ApplicationName           : fabric:/samples/PQueueApp1
ApplicationTypeName       : PersistentQueueApp
ApplicationTypeVersion    : 1.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

ApplicationName           : fabric:/VQueueApp1
ApplicationTypeName       : Compose_0
ApplicationTypeVersion    : v0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : Compose
ApplicationParameters     : {}

VERBOSE: Continuation Token:

This command gets the Service Fabric application(s) which respect the provided continuation token which fit into a single page. The continuation token provided to this query is the same one returned from the example above. The "Verbose" option shows no continuation token, symbolizing that no more pages are available.

Example 7: Get application by name while excluding application parameters

PS C:\>Get-ServiceFabricApplication -ApplicationName fabric:/samples/CalculatorAppWithAppParameters -ExcludeApplicationParameters

ApplicationName           : fabric:/samples/CalculatorAppWithAppParameters
ApplicationTypeName       : CalculatorApp
ApplicationTypeVersion    : 2.0
ApplicationStatus         : Ready
HealthState               : Ok
ApplicationDefinitionKind : ServiceFabricApplicationDescription
ApplicationParameters     : {}

This command gets the Service Fabric application which matches the provided application name. As seen from example 5, this application has application parameters, but is excluded from the returned result(s) because of the "ExcludeApplicationParameters" flag

Parameters

-ApplicationDefinitionKindFilter

Specifies the filter for ApplicationDefinitionKindFilter based on how the application is defined. The value can be obtained from members or bitwise operations on members of ApplicationDefinitionKindFilter. Only applications that match the filter are returned. At most one of ApplicationName, ApplicationTypeName, or ApplicationDefinitionKindFilter can be specified. If no filter is specified, all applications are returned.

Type:ApplicationDefinitionKindFilter
Accepted values:Default, ServiceFabricApplicationDescription, Compose, MeshApplicationDescription, All
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ApplicationName

Specifies the Uniform Resource Identifier (URI) of a Service Fabric application. The cmdlet gets the application that has the specified URI. At most one of ApplicationName, ApplicationTypeName, or ApplicationDefinitionKindFilter can be specified. If no filter is specified, all applications are returned.

Type:Uri
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationTypeName

Specifies the application type name used to filter the applications to query for. At most one of ApplicationName, ApplicationTypeName, or ApplicationDefinitionKindFilter can be specified. If no filter is specified, all applications are returned.

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

-ContinuationToken

Specifies the continuation token which can be used to retrieve the next page of query results.

If too many results respect the provided filters, they may not fit into one message. Paging is used to account for this by splitting the collection of returned results into separate pages. The continuation token is used to know where the previous page left off, carrying significance only to the query itself. This value should be generated from running this query, and can be passed into the next query request in order to get subsequent pages. A non-null continuation token value is returned as part of the result only if there is a subsequent page. If this value is provided without the -GetSinglePage option, then the query will return all pages starting from the continuation token value.

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

-ExcludeApplicationParameters

Specifies whether application parameters will be excluded from the result.

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

-GetSinglePage

Specifies whether the query will return one page of query results with a continuation token value, or all pages combined into one list of results. If this option is selected, then it is the responsibility of the caller of the query to check for subsequent pages.

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

-MaxResults

Specifies the max number of result items that can be returned per page. This defines the upper bound for the number of results returned, not a minimum. For example, if the page fits at most 1000 returned items according to max message size restrictions defined in the configuration, and the MaxResults value is set to 2000, then only 1000 results are returned, even if 2000 result items match the query description. This value requires selection of the GetSinglePage flag; it will be ignored otherwise.

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