for (EC2TagTypeId resourceType : resourceTypeSet) {
String cloudStackResourceType = mapToCloudStackResourceType(resourceType.getResourceType());
List<String> resourceIdList = new ArrayList<String>();
for ( String resourceId : resourceType.getResourceIds())
resourceIdList.add(resourceId);
CloudStackInfoResponse resp = new CloudStackInfoResponse();
if (operation.equalsIgnoreCase("create"))
resp = getApi().createTags(cloudStackResourceType, resourceIdList, resourceTagList);
else if(operation.equalsIgnoreCase("delete"))
resp = getApi().deleteTags(cloudStackResourceType, resourceIdList, resourceTagList);
else
throw new EC2ServiceException( ServerError.InternalError, "Unknown operation." );
if (resp.getSuccess() == false)
return false;
}
return true;
} catch (Exception e){
logger.error( "EC2 Create/Delete Tags - ", e);