|
35 | 35 | import org.apache.cloudstack.agent.directdownload.CheckUrlCommand; |
36 | 36 | import org.apache.cloudstack.annotation.AnnotationService; |
37 | 37 | import org.apache.cloudstack.annotation.dao.AnnotationDao; |
| 38 | +import org.apache.cloudstack.api.ApiCommandResourceType; |
38 | 39 | import org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd; |
39 | 40 | import org.apache.cloudstack.api.command.user.iso.GetUploadParamsForIsoCmd; |
40 | 41 | import org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd; |
41 | 42 | import org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd; |
42 | 43 | import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd; |
43 | 44 | import org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd; |
| 45 | +import org.apache.cloudstack.context.CallContext; |
44 | 46 | import org.apache.cloudstack.direct.download.DirectDownloadManager; |
45 | 47 | import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; |
46 | 48 | import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
@@ -359,6 +361,16 @@ public List<TemplateOrVolumePostUploadCommand> doInTransaction(TransactionStatus |
359 | 361 | throw new CloudRuntimeException("Unable to persist the template " + profile.getTemplate()); |
360 | 362 | } |
361 | 363 |
|
| 364 | + // Set Event Details for Template/ISO Upload |
| 365 | + String eventType = template.getFormat().equals(ImageFormat.ISO) ? "Iso" : "Template"; |
| 366 | + String eventResourceId = template.getUuid(); |
| 367 | + CallContext.current().setEventDetails(String.format("%s Id: %s", eventType, eventResourceId)); |
| 368 | + CallContext.current().putContextParameter(eventType.equals("Iso") ? eventType : VirtualMachineTemplate.class, eventResourceId); |
| 369 | + if (template.getFormat().equals(ImageFormat.ISO)) { |
| 370 | + CallContext.current().setEventResourceType(ApiCommandResourceType.Iso); |
| 371 | + CallContext.current().setEventResourceId(template.getId()); |
| 372 | + } |
| 373 | + |
362 | 374 | if (profile.getZoneIdList() != null && profile.getZoneIdList().size() > 1) |
363 | 375 | throw new CloudRuntimeException("Operation is not supported for more than one zone id at a time"); |
364 | 376 |
|
|
0 commit comments