// -> so in the Amazon docs for this REST call there is no userData even though there is in the SOAP docs
String[] imageId = request.getParameterValues( "ImageId" );
if ( null != imageId && 0 < imageId.length )
EC2request.setTemplateId( imageId[0] );
else {
throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - ImageId");
}
String[] minCount = request.getParameterValues( "MinCount" );
if ( minCount == null || minCount.length < 1) {
throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - MinCount");
} else if ( Integer.parseInt(minCount[0]) < 1) {
throw new EC2ServiceException(ClientError.InvalidParameterValue,
"Value of parameter MinCount should be greater than 0");
} else {
EC2request.setMinCount( Integer.parseInt( minCount[0]) );
}
String[] maxCount = request.getParameterValues( "MaxCount" );
if ( maxCount == null || maxCount.length < 1) {
throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - MaxCount");
} else if ( Integer.parseInt(maxCount[0]) < 1) {
throw new EC2ServiceException(ClientError.InvalidParameterValue,
"Value of parameter MaxCount should be greater than 0");
} else {
EC2request.setMaxCount( Integer.parseInt( maxCount[0]) );
}