(
        self,
        new_target_capacity: float,
        dry_run: bool = False,
        force: bool = False,
        prune: bool = True,
        no_scale_down: bool = False,
    )
return new_target_capacity
Change the desired :attr:`target_capacity` of the resource groups belonging to this pool.

        Capacity changes are roughly evenly distributed across the resource groups to ensure that
        nodes are diversified in the cluster

        :param new_target_capacity: the desired target capacity for the cluster and pool
        :param dry_run: boolean indicating whether the cluster should actually be modified
        :param force: boolean indicating whether to override the scaling limits
        :returns: the (set) new target capacity

        .. note:: It may take some time (up to a few minutes) for changes in the target capacity to be reflected in
           :attr:`fulfilled_capacity`.  Once the capacity has equilibrated, the fulfilled capacity and the target
           capacity may not exactly match, but the fulfilled capacity will never be under the target (for example, if
           there is no combination of nodes that evenly sum to the desired target capacity, the final fulfilled
           capacity will be slightly above the target capacity)
Change the desired :attr:`target_capacity` of the resource groups belonging to this pool.
Change the desired : attr : target_capacity of the resource groups belonging to this pool .
def modify_target_capacity(
        self,
        new_target_capacity: float,
        dry_run: bool = False,
        force: bool = False,
        prune: bool = True,
        no_scale_down: bool = False,
    ) -> float:
        """ Change the desired :attr:`target_capacity` of the resource groups belonging to this pool.

        Capacity changes are roughly evenly distributed across the resource groups to ensure that
        nodes are diversified in the cluster

        :param new_target_capacity: the desired target capacity for the cluster and pool
        :param dry_run: boolean indicating whether the cluster should actually be modified
        :param force: boolean indicating whether to override the scaling limits
        :returns: the (set) new target capacity

        .. note:: It may take some time (up to a few minutes) for changes in the target capacity to be reflected in
           :attr:`fulfilled_capacity`.  Once the capacity has equilibrated, the fulfilled capacity and the target
           capacity may not exactly match, but the fulfilled capacity will never be under the target (for example, if
           there is no combination of nodes that evenly sum to the desired target capacity, the final fulfilled
           capacity will be slightly above the target capacity)
        """
        if dry_run:
            logger.warning('Running in "dry-run" mode; cluster state will not be modified')
        if not self.resource_groups:
            raise PoolManagerError("No resource groups available")

        orig_target_capacity = self.target_capacity
        new_target_capacity = self._constrain_target_capacity(new_target_capacity, force, no_scale_down)

        res_group_targets = self._compute_new_resource_group_targets(new_target_capacity)
        for group_id, target in res_group_targets.items():
            if self.resource_groups[group_id].target_capacity == target:
                continue

            try:
                self.resource_groups[group_id].modify_target_capacity(
                    target, dry_run=dry_run,
                )
            except ResourceGroupError:
                logger.critical(traceback.format_exc())
                rge_counter = get_monitoring_client().create_counter(
                    SFX_RESOURCE_GROUP_MODIFICATION_FAILED_NAME, {"cluster": self.cluster, "pool": self.pool},
                )
                rge_counter.count()
                continue

        if prune:
            self.prune_excess_fulfilled_capacity(new_target_capacity, res_group_targets, dry_run)
        logger.info(f"Target capacity for {self.pool} changed from {orig_target_capacity} to {new_target_capacity}")
        return new_target_capacity
def modify_target_capacity ( self , new_target_capacity : float , dry_run : bool = False , force : bool = False , prune : bool = True , no_scale_down : bool = False , ) -> float : if dry_run : logger . warning ( 'Running in "dry-run" mode; cluster state will not be modified' ) if not self . resource_groups : raise PoolManagerError ( "No resource groups available" ) orig_target_capacity = self . target_capacity new_target_capacity = self . _constrain_target_capacity ( new_target_capacity , force , no_scale_down ) res_group_targets = self . _compute_new_resource_group_targets ( new_target_capacity ) for group_id , target in res_group_targets . items ( ) : if self . resource_groups [ group_id ] . target_capacity == target : continue try : self . resource_groups [ group_id ] . modify_target_capacity ( target , dry_run = dry_run , ) except ResourceGroupError : logger . critical ( traceback . format_exc ( ) ) rge_counter = get_monitoring_client ( ) . create_counter ( SFX_RESOURCE_GROUP_MODIFICATION_FAILED_NAME , { "cluster" : self . cluster , "pool" : self . pool } , ) rge_counter . count ( ) continue if prune : self . prune_excess_fulfilled_capacity ( new_target_capacity , res_group_targets , dry_run ) logger . info ( f"Target capacity for {self.pool} changed from {orig_target_capacity} to {new_target_capacity}" ) return new_target_capacity