This API works with the following fleet types: EC2, Container
Suspends certain types of activity in a fleet location. Currently, this operation is used to stop auto-scaling activity. For multi-location fleets, fleet actions are managed separately for each location.
Stopping fleet actions has several potential purposes. It allows you to temporarily stop auto-scaling activity but retain your scaling policies for use in the future. For multi-location fleets, you can set up fleet-wide auto-scaling, and then opt out of it for certain locations.
This operation can be used in the following ways:
-
To stop actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to suspend.
-
To stop actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to suspend.
If successful, Amazon GameLift Servers no longer initiates scaling events except in response to manual changes using UpdateFleetCapacity. To restart fleet actions again, call StartFleetActions.
Learn more
Setting up Amazon GameLift Servers Fleets
Parameters:
-
fleet_id
(Optional[FleetIdOrArn], default:
None
)
–
A unique identifier for the fleet to stop actions on. You can use either the fleet ID or ARN value.
-
actions
(Optional[FleetActionList], default:
None
)
–
List of actions to suspend on the fleet.
-
location
(Optional[LocationStringModel], default:
None
)
–
The fleet location to stop fleet actions for. Specify a location in the form of an Amazon Web Services Region code, such as us-west-2.
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 stop_fleet_actions(
self,
*,
config_overrides: Optional[GameLiftClientConfig] = None,
fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
actions: Optional[
"capo_gamelift.types.fleet_action_list.FleetActionList"
] = None,
location: Optional[
"capo_gamelift.types.location_string_model.LocationStringModel"
] = None,
) -> "capo_gamelift.types.stop_fleet_actions_output.StopFleetActionsOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2, Container</p> <p>Suspends certain types of activity in a fleet location. Currently, this operation is used to stop auto-scaling activity. For multi-location fleets, fleet actions are managed separately for each location. </p> <p>Stopping fleet actions has several potential purposes. It allows you to temporarily stop auto-scaling activity but retain your scaling policies for use in the future. For multi-location fleets, you can set up fleet-wide auto-scaling, and then opt out of it for certain locations. </p> <p>This operation can be used in the following ways: </p> <ul> <li> <p>To stop actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to suspend. </p> </li> <li> <p>To stop actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to suspend. </p> </li> </ul> <p>If successful, Amazon GameLift Servers no longer initiates scaling events except in response to manual changes using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateFleetCapacity.html">UpdateFleetCapacity</a>. To restart fleet actions again, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartFleetActions.html">StartFleetActions</a>.</p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers Fleets</a> </p>
Args:
fleet_id: <p>A unique identifier for the fleet to stop actions on. You can use either the fleet ID or ARN value.</p>
actions: <p>List of actions to suspend on the fleet. </p>
location: <p>The fleet location to stop fleet actions for. Specify a location in the form of an Amazon Web Services Region code, such as <code>us-west-2</code>.</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.stop_fleet_actions_input.StopFleetActionsInput]",
) -> OperationResponse[
"capo_gamelift.types.stop_fleet_actions_output.StopFleetActionsOutput"
]:
import capo_gamelift._operations.game_lift.stop_fleet_actions
output, http_response = (
capo_gamelift._operations.game_lift.stop_fleet_actions.stop_fleet_actions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopFleetActions")
)
input_: capo_gamelift.types.stop_fleet_actions_input.StopFleetActionsInput = {}
if fleet_id is not None:
input_["fleet_id"] = fleet_id
if actions is not None:
input_["actions"] = actions
if location is not None:
input_["location"] = location
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|