Share via


Get-ServiceFabricApplication

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

Syntax

AllPages (Default)

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

SinglePage

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.

Parameter properties

Type:ApplicationDefinitionKindFilter
Default value:None
Accepted values:Default, ServiceFabricApplicationDescription, Compose, MeshApplicationDescription, 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

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

Parameter properties

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

Parameter sets

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

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:True
Value from remaining arguments: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.

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

-ExcludeApplicationParameters

Specifies whether application parameters will be excluded from the result.

Parameter properties

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

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

Parameter properties

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

Parameter sets

SinglePage
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

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

Parameter sets

SinglePage
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