pub struct UpdateFleetCapacity { /* private fields */ }
Expand description
Fluent builder constructing a request to UpdateFleetCapacity
.
Updates capacity settings for a fleet. For fleets with multiple locations, use this operation to manage capacity settings in each location individually. Fleet capacity determines the number of game sessions and players that can be hosted based on the fleet configuration. Use this operation to set the following fleet capacity properties:
-
Minimum/maximum size: Set hard limits on fleet capacity. GameLift cannot set the fleet's capacity to a value outside of this range, whether the capacity is changed manually or through automatic scaling.
-
Desired capacity: Manually set the number of Amazon EC2 instances to be maintained in a fleet location. Before changing a fleet's desired capacity, you may want to call
DescribeEC2InstanceLimits
to get the maximum capacity of the fleet's Amazon EC2 instance type. Alternatively, consider using automatic scaling to adjust capacity based on player demand.
This operation can be used in the following ways:
-
To update capacity for a fleet's home Region, or if the fleet has no remote locations, omit the
Location
parameter. The fleet must be inACTIVE
status. -
To update capacity for a fleet's remote location, include the
Location
parameter set to the location to be updated. The location must be inACTIVE
status.
If successful, capacity settings are updated immediately. In response a change in desired capacity, GameLift initiates steps to start new instances or terminate existing instances in the requested fleet location. This continues until the location's active instance count matches the new desired instance count. You can track a fleet's current capacity by calling DescribeFleetCapacity
or DescribeFleetLocationCapacity
. If the requested desired instance count is higher than the instance type's limit, the LimitExceeded
exception occurs.
Learn more
Related actions
CreateFleetLocations
| UpdateFleetAttributes
| UpdateFleetCapacity
| UpdateFleetPortSettings
| UpdateRuntimeConfiguration
| StopFleetActions
| StartFleetActions
| PutScalingPolicy
| DeleteFleet
| DeleteFleetLocations
| DeleteScalingPolicy
| All APIs by task
Implementations
sourceimpl UpdateFleetCapacity
impl UpdateFleetCapacity
sourcepub async fn send(
self
) -> Result<UpdateFleetCapacityOutput, SdkError<UpdateFleetCapacityError>>
pub async fn send(
self
) -> Result<UpdateFleetCapacityOutput, SdkError<UpdateFleetCapacityError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn fleet_id(self, input: impl Into<String>) -> Self
pub fn fleet_id(self, input: impl Into<String>) -> Self
A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
sourcepub fn set_fleet_id(self, input: Option<String>) -> Self
pub fn set_fleet_id(self, input: Option<String>) -> Self
A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
sourcepub fn desired_instances(self, input: i32) -> Self
pub fn desired_instances(self, input: i32) -> Self
The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall between the minimum and maximum size limits.
sourcepub fn set_desired_instances(self, input: Option<i32>) -> Self
pub fn set_desired_instances(self, input: Option<i32>) -> Self
The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall between the minimum and maximum size limits.
sourcepub fn min_size(self, input: i32) -> Self
pub fn min_size(self, input: i32) -> Self
The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 0.
sourcepub fn set_min_size(self, input: Option<i32>) -> Self
pub fn set_min_size(self, input: Option<i32>) -> Self
The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 0.
sourcepub fn max_size(self, input: i32) -> Self
pub fn max_size(self, input: i32) -> Self
The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 1.
sourcepub fn set_max_size(self, input: Option<i32>) -> Self
pub fn set_max_size(self, input: Option<i32>) -> Self
The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 1.
sourcepub fn location(self, input: impl Into<String>) -> Self
pub fn location(self, input: impl Into<String>) -> Self
The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region code such as us-west-2
.
sourcepub fn set_location(self, input: Option<String>) -> Self
pub fn set_location(self, input: Option<String>) -> Self
The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region code such as us-west-2
.
Trait Implementations
sourceimpl Clone for UpdateFleetCapacity
impl Clone for UpdateFleetCapacity
sourcefn clone(&self) -> UpdateFleetCapacity
fn clone(&self) -> UpdateFleetCapacity
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for UpdateFleetCapacity
impl Send for UpdateFleetCapacity
impl Sync for UpdateFleetCapacity
impl Unpin for UpdateFleetCapacity
impl !UnwindSafe for UpdateFleetCapacity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more