Java 类com.amazonaws.services.ec2.model.CancelSpotInstanceRequestsResult 实例源码

项目:scale.cloudpool    文件:FakeSpotClient.java   
@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;
}
项目:scale.cloudpool    文件:CancelSpotInstanceRequests.java   
@Override
public CancelSpotInstanceRequestsResult call() throws AmazonClientException {
    CancelSpotInstanceRequestsRequest request = new CancelSpotInstanceRequestsRequest()
            .withSpotInstanceRequestIds(this.spotRequestIds);
    CancelSpotInstanceRequestsResult result = getClient().getApi().cancelSpotInstanceRequests(request);
    awaitCancellation(this.spotRequestIds);
    return result;
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public CancelSpotInstanceRequestsResult cancelSpotInstanceRequests(CancelSpotInstanceRequestsRequest cancelSpotInstanceRequestsRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:scale.cloudpool    文件:AwsSpotClient.java   
@Override
public CancelSpotInstanceRequestsResult cancelSpotRequests(List<String> spotInstanceRequestIds) {
    return new CancelSpotInstanceRequests(awsCredentials(), region(), clientConfig(), spotInstanceRequestIds)
            .call();
}
项目:scale.cloudpool    文件:SpotClient.java   
/**
 * 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;