serializeResponse(response, EC2response);
}
private void createImage( HttpServletRequest request, HttpServletResponse response )
throws ADBException, XMLStreamException, IOException {
EC2CreateImage EC2request = new EC2CreateImage();
String[] instanceId = request.getParameterValues( "InstanceId" );
if ( null != instanceId && 0 < instanceId.length )
EC2request.setInstanceId( instanceId[0] );
else {
throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - InstanceId");
}
String[] name = request.getParameterValues( "Name" );
if ( null != name && 0 < name.length )
EC2request.setName( name[0] );
else {
throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - Name");
}
String[] description = request.getParameterValues( "Description" );
if ( null != description && 0 < description.length ) {
if (description[0].length() > 255)
throw new EC2ServiceException( ClientError.InvalidParameterValue,
"Length of the value of parameter Description should be less than 255");
EC2request.setDescription( description[0] );
}
// -> execute the request
CreateImageResponse EC2response = EC2SoapServiceImpl.toCreateImageResponse( ServiceProvider.getInstance().getEC2Engine().createImage( EC2request ));