Skip to content

delete_scaling_policy

delete_scaling_policy(
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    name: Optional[NonZeroAndMaxString] = None,
    fleet_id: Optional[FleetIdOrArn] = None,
) -> None

This API works with the following fleet types: EC2, Container

Deletes a fleet scaling policy. Once deleted, the policy is no longer in force and Amazon GameLift Servers removes all record of it. To delete a scaling policy, specify both the scaling policy name and the fleet ID it is associated with.

To temporarily suspend scaling policies, use StopFleetActions. This operation suspends all policies for the fleet.

Parameters:

  • name (Optional[NonZeroAndMaxString], default: None ) –

    A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.

  • fleet_id (Optional[FleetIdOrArn], default: None ) –

    A unique identifier for the fleet to be deleted. You can use either the fleet ID or ARN value.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • NotFoundException –

    The requested resource was not found. The resource was either not created yet or deleted.

  • UnauthorizedException –

    The client failed authentication. Clients should not retry such requests.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_gamelift/_services/game_lift.py
def delete_scaling_policy(
    self,
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    name: Optional[
        "capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
    ] = None,
    fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
) -> None:
    """<p> <b>This API works with the following fleet types:</b> EC2, Container</p> <p>Deletes a fleet scaling policy. Once deleted, the policy is no longer in force and Amazon GameLift Servers removes all record of it. To delete a scaling policy, specify both the scaling policy name and the fleet ID it is associated with.</p> <p>To temporarily suspend scaling policies, use <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StopFleetActions.html">StopFleetActions</a>. This operation suspends all policies for the fleet.</p>

    Args:
        name: <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.</p>
        fleet_id: <p>A unique identifier for the fleet to be deleted. You can use either the fleet ID or ARN value.</p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
        capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_gamelift.types.delete_scaling_policy_input.DeleteScalingPolicyInput]",
    ) -> OperationResponse[None]:
        import capo_gamelift._operations.game_lift.delete_scaling_policy

        output, http_response = (
            capo_gamelift._operations.game_lift.delete_scaling_policy.delete_scaling_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteScalingPolicy")
    )
    input_: capo_gamelift.types.delete_scaling_policy_input.DeleteScalingPolicyInput = {}
    if name is not None:
        input_["name"] = name
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output