Menu
Amazon GameLift Service
API Reference (API Version 2015-10-01)

UpdateFleetCapacity

Updates capacity settings for a fleet. Use this action to specify the number of EC2 instances (hosts) that you want this fleet to contain. Before calling this action, you may want to call DescribeEC2InstanceLimits to get the maximum capacity based on the fleet's EC2 instance type.

If you're using autoscaling (see PutScalingPolicy), you may want to specify a minimum and/or maximum capacity. If you don't provide these, autoscaling can set capacity anywhere between zero and the service limits.

To update fleet capacity, specify the fleet ID and the number of instances you want the fleet to host. If successful, Amazon GameLift starts or terminates instances so that the fleet's active instance count matches the desired instance count. You can view a fleet's current capacity information by calling DescribeFleetCapacity. If the desired instance count is higher than the instance type's limit, the "Limit Exceeded" exception occurs.

Fleet-related operations include:

Request Syntax

{
   "DesiredInstances": number,
   "FleetId": "string",
   "MaxSize": number,
   "MinSize": number
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

FleetId

Unique identifier for a fleet to update capacity for.

Type: String

Pattern: ^fleet-\S+

Required: Yes

DesiredInstances

Number of EC2 instances you want this fleet to host.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

MaxSize

Maximum value allowed for the fleet's instance count. Default if not set is 1.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

MinSize

Minimum value allowed for the fleet's instance count. Default if not set is 0.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

Response Syntax

{
   "FleetId": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FleetId

Unique identifier for a fleet that was updated.

Type: String

Pattern: ^fleet-\S+

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

HTTP Status Code: 400

InternalServiceException

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

HTTP Status Code: 500

InvalidFleetStatusException

The requested operation would cause a conflict with the current state of a resource associated with the request and/or the fleet. Resolve the conflict before retrying.

HTTP Status Code: 400

InvalidRequestException

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

HTTP Status Code: 400

LimitExceededException

The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.

HTTP Status Code: 400

NotFoundException

A service resource associated with the request could not be found. Clients should not retry such requests.

HTTP Status Code: 400

UnauthorizedException

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

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: