Update-ServiceFabricPartitionLoad

Updates loads of specified Service Fabric partitions.

Syntax

Update-ServiceFabricPartitionLoad
      [-PartitionMetricLoadDescriptionList] <System.Collections.Generic.List`1[System.Fabric.Description.PartitionMetricLoadDescription]>
      [-ContinuationToken <String>]
      [-TimeoutSec <Int32>]
      [<CommonParameters>]
Update-ServiceFabricPartitionLoad
      [-PartitionMetricLoadDescriptionList] <System.Collections.Generic.List`1[System.Fabric.Description.PartitionMetricLoadDescription]>
      [-GetSinglePage]
      [-ContinuationToken <String>]
      [-MaxResults <Int64>]
      [-TimeoutSec <Int32>]
      [<CommonParameters>]

Description

The Update-ServiceFabricPartitionLoad cmdlet updates the loads of Service Fabric partitions, as specified via PartitionMetricLoadDescriptionList, and then returns the results.

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: Use Update-ServiceFabricParitionLoad to report various loads for a partition

# This demonstrates various ways in which Update-ServiceFabricPartitionLoad can be used to report loads for a partition
# Part 1: reporting primary load for one or more metrics
# Part 2: reporting secondary load for one or more metrics
# Part 3: reporting loads for a given replica on a given node

# We need a guid object to identify the partition
$partitionIdString = '12345678-9012-4242-9876-432109876543'
$partitionId = [GUID]$partitionIdString

# Part 1: report primary load 42 for Metric0 and 43 for Metric1
$primaryLoad0 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric0', 42)
$primaryLoad1 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric1', 43)
$primaryLoads = New-Object 'System.Collections.Generic.List[System.Fabric.Description.MetricLoadDescription]'
$primaryLoads.Add($primaryLoad0)
$primaryLoads.Add($primaryLoad1)

# Part 2: report secondary load 5 for Metric0 and 6 for Metric1
$secondaryLoads = New-Object 'System.Collections.Generic.List[System.Fabric.Description.MetricLoadDescription]'
$secondaryLoad0 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric0', 5)
$secondaryLoad1 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric1', 6)
$secondaryLoads.Add($secondaryLoad0)
$secondaryLoads.Add($secondaryLoad1)

# Part 3a: for the replica on Node0 report a load of 42 for Metric0 and 24 for Metric1
$perNodeSecondaryLoads0 = New-Object 'System.Collections.Generic.List[System.Fabric.Description.MetricLoadDescription]'
$perNodeSecondaryLoad00 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric0', 42)
$perNodeSecondaryLoad01 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric1', 24)
$perNodeSecondaryLoads0.Add($perNodeSecondaryLoad00)
$perNodeSecondaryLoads0.Add($perNodeSecondaryLoad01)
$perNodeLoadsNode0 = New-Object -TypeName System.Fabric.Description.ReplicaMetricLoadDescription("Node0", $perNodeSecondaryLoads0)

# Part 3b: for the replica on Node1 report a load of 5 for Metric0 and 6 for Metric1
$perNodeSecondaryLoads1 = New-Object 'System.Collections.Generic.List[System.Fabric.Description.MetricLoadDescription]'
$perNodeSecondaryLoad10 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric0', 5)
$perNodeSecondaryLoad11 = New-Object -TypeName System.Fabric.Description.MetricLoadDescription('Metric1', 6)
$perNodeSecondaryLoads1.Add($perNodeSecondaryLoad10)
$perNodeSecondaryLoads1.Add($perNodeSecondaryLoad11)
$perNodeLoadsNode1 = New-Object -TypeName System.Fabric.Description.ReplicaMetricLoadDescription("Node1", $perNodeSecondaryLoads1)

# Part 3c: put all node loads in an aggregate list
$perNodeLoads = New-Object 'System.Collections.Generic.List[System.Fabric.Description.ReplicaMetricLoadDescription]'
$perNodeLoads.Add($perNodeLoadsNode0)
$perNodeLoads.Add($perNodeLoadsNode1)

# Generate a description object which can contain all 3 load types (primary, secondary and per node)
# Empty dummy lists can be passed to the constructor if not all 3 types of reporting are used
$loadDescription = New-Object -TypeName System.Fabric.Description.PartitionMetricLoadDescription($partitionId, $primaryLoads, $secondaryLoads, $perNodeLoads)

# Create the final list of descriptions
# In this example we are reporting the load for a single partition
# But in general, more descriptions can be added to partitionMetricLoadDescriptionList
# This way, loads for multiple partitions can be reported through a single Update-ServiceFabricPartitionLoad call
$partitionMetricLoadDescriptionList = New-Object 'System.Collections.Generic.List[System.Fabric.Description.PartitionMetricLoadDescription]'
$partitionMetricLoadDescriptionList.Add($loadDescription)

# Finally, report the loads
Update-ServiceFabricPartitionLoad -PartitionMetricLoadDescriptionList $partitionMetricLoadDescriptionList

See also Reporting load for a partition.

Parameters

-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

-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

-PartitionMetricLoadDescriptionList

List of PartitionMetricLoadDescription objects that specify load updates for specific Service Fabric partitions.

Type:System.Collections.Generic.List`1[System.Fabric.Description.PartitionMetricLoadDescription]
Position:0
Default value:None
Required:True
Accept pipeline input:True
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.Collections.Generic.List`1[[System.Fabric.Description.PartitionMetricLoadDescription, System.Fabric, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Outputs

System.Object