@Override public CancelSpotInstanceRequestsResult cancelSpotRequests(List<String> spotInstanceRequestIds) throws AmazonClientException { CancelSpotInstanceRequestsResult result = new CancelSpotInstanceRequestsResult(); for (String spotInstanceRequestId : spotInstanceRequestIds) { getSpotInstanceRequest(spotInstanceRequestId).setState(SpotInstanceState.Cancelled); result.withCancelledSpotInstanceRequests( new CancelledSpotInstanceRequest().withSpotInstanceRequestId(spotInstanceRequestId) .withState(CancelSpotInstanceRequestState.Cancelled)); } return result; }
@Override public CancelSpotInstanceRequestsResult call() throws AmazonClientException { CancelSpotInstanceRequestsRequest request = new CancelSpotInstanceRequestsRequest() .withSpotInstanceRequestIds(this.spotRequestIds); CancelSpotInstanceRequestsResult result = getClient().getApi().cancelSpotInstanceRequests(request); awaitCancellation(this.spotRequestIds); return result; }
@Override public CancelSpotInstanceRequestsResult cancelSpotInstanceRequests(CancelSpotInstanceRequestsRequest cancelSpotInstanceRequestsRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public CancelSpotInstanceRequestsResult cancelSpotRequests(List<String> spotInstanceRequestIds) { return new CancelSpotInstanceRequests(awsCredentials(), region(), clientConfig(), spotInstanceRequestIds) .call(); }
/** * Cancels a collection of {@link SpotInstanceRequest}s. * * @param spotInstanceRequestIds * The identifiers of all {@link SpotInstanceRequest}s to cancel. * @return The result of the cancellation request. * @throws AmazonClientException */ CancelSpotInstanceRequestsResult cancelSpotRequests(List<String> spotInstanceRequestIds) throws AmazonClientException;