Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

CancelSpotInstanceRequests

Description

Cancels one or more Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information about Spot Instances, see Spot Instances in the Amazon Elastic Compute Cloud User Guide.

Important

Canceling a Spot Instance request does not terminate running Spot Instances associated with the request.

Request Parameters

SpotInstanceRequestId.n

One or more Spot Instance request IDs.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a CancelSpotInstanceRequestsResponse element.

requestId

The ID of the request.

Type: xsd:string

spotInstanceRequestSet

A list of Spot Instance requests. Each request is wrapped in an item element.

Type: CancelSpotInstanceRequestsResponseSetItemType

Examples

Example Request

This example cancels a Spot Instance request.

https://ec2.amazonaws.com/?Action=CancelSpotInstanceRequests
&SpotInstanceRequestId.1=sir-1a2b3c4d
&AUTHPARAMS

Example Response

<CancelSpotInstanceRequestsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
  <spotInstanceRequestSet>
    <item>
      <spotInstanceRequestId>sir-1a2b3c4d</spotInstanceRequestId>
      <state>cancelled</state>
    </item>
  </spotInstanceRequestSet></CancelSpotInstanceRequestsResponse>