* Mapping this to the destroyVirtualMachine cloud API concept.
* This makes sense since when considering the rebootInstances function. In reboot
* any terminated instances are left alone. We will do the same with destroyed instances.
*/
public TerminateInstancesResponse terminateInstances(TerminateInstances terminateInstances) {
EC2StopInstances request = new EC2StopInstances();
TerminateInstancesType sit = terminateInstances.getTerminateInstances();
// -> toEC2StopInstances
InstanceIdSetType iist = sit.getInstancesSet();
InstanceIdType[] items = iist.getItem();
if (null != items) { // -> should not be empty
for( int i=0; i < items.length; i++ ) request.addInstanceId( items[i].getInstanceId());
}
request.setDestroyInstances( true );
return toTermInstancesResponse( engine.stopInstances( request ));
}