DescribeImagesResponse EC2response = EC2SoapServiceImpl.toDescribeImagesResponse(engine.describeImages(EC2request));
serializeResponse(response, EC2response);
}
private void describeImageAttribute(HttpServletRequest request, HttpServletResponse response) throws ADBException, XMLStreamException, IOException {
EC2DescribeImageAttribute ec2request = new EC2DescribeImageAttribute();
String[] imageId = request.getParameterValues("ImageId");
if (imageId != null && imageId.length > 0)
ec2request.setImageId(imageId[0]);
else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - ImageId");
}
String[] attribute = request.getParameterValues("Attribute");
if (attribute != null && attribute.length > 0) {
if (attribute[0].equalsIgnoreCase("description"))
ec2request.setAttribute(ImageAttribute.description);
else if (attribute[0].equalsIgnoreCase("launchPermission"))
ec2request.setAttribute(ImageAttribute.launchPermission);
else {
throw new EC2ServiceException(ClientError.InvalidParameterValue, "Only values supported for paramter Attribute are - Description/LaunchPermission");
}
} else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - Attribute");