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

DeleteFleet

Deletes everything related to a fleet. Before deleting a fleet, you must set the fleet's desired capacity to zero. See UpdateFleetCapacity.

This action removes the fleet's resources and the fleet record. Once a fleet is deleted, you can no longer use that fleet.

Fleet-related operations include:

Request Syntax

{
   "FleetId": "string"
}

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 be deleted.

Type: String

Pattern: ^fleet-\S+

Required: Yes

Response Elements

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

Errors

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

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

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

Example

Delete a fleet that is no longer in use

This example attempts to delete a fleet that has been scaled down to zero instances. If the fleet capacity is not zero, the request fails with an HTTP 400 error.

HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization header field.

Sample Request

POST / HTTP/1.1
Host: gamelift.us-west-2.amazonaws.com;
Accept-Encoding: identity
Content-Length: 57
User-Agent: aws-cli/1.11.36 Python/2.7.9 Windows/7 botocore/1.4.93
Content-Type: application/x-amz-json-1.0
Authorization: AWS4-HMAC-SHA256  Credential=AKIAIOSFODNN7EXAMPLE/20170406/us-west-2/gamelift/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
X-Amz-Date: 20170406T004805Z
X-Amz-Target: GameLift.DeleteFleet 

{
    "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa"
}

Sample Response

If delete is successful: 

HTTP/1.1 200 OK
x-amzn-RequestId: b34f8665-EXAMPLE
Date: Thu, 06 Apr 2017 00:48:07 GMT

If delete is not successful:

Status: 400 Bad Request   RequestId: 99764159-4a57-11e7-af99-e5821c0e52da   Time: 177ms
{"__type": "com.amazonaws.gameliftapi.v20151001#InvalidRequestException", 
 "Message": "Unable to terminate fleet-8e5a52a6-3261-4217-9a21-938b247c3db6: Max instance count must be 0."}

See Also

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