|
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; |
@@ -421,6 +423,16 @@ public List<TemplateOrVolumePostUploadCommand> doInTransaction(TransactionStatus |
421 | 423 | if (zoneIdList.size() > 1) |
422 | 424 | throw new CloudRuntimeException("Operation is not supported for more than one zone id at a time."); |
423 | 425 |
|
| 426 | + // Set Event Details for Template/ISO Upload |
| 427 | + String eventType = template.getFormat().equals(ImageFormat.ISO) ? "Iso" : "Template"; |
| 428 | + String eventResourceId = template.getUuid(); |
| 429 | + CallContext.current().setEventDetails(String.format("%s Id: %s", eventType, eventResourceId)); |
| 430 | + CallContext.current().putContextParameter(eventType.equals("Iso") ? eventType : VirtualMachineTemplate.class, eventResourceId); |
| 431 | + if (template.getFormat().equals(ImageFormat.ISO)) { |
| 432 | + CallContext.current().setEventResourceType(ApiCommandResourceType.Iso); |
| 433 | + CallContext.current().setEventResourceId(template.getId()); |
| 434 | + } |
| 435 | + |
424 | 436 | Long zoneId = zoneIdList.get(0); |
425 | 437 | DataStore imageStore = verifyHeuristicRulesForZone(template, zoneId); |
426 | 438 | List<TemplateOrVolumePostUploadCommand> payloads = new LinkedList<>(); |
|
0 commit comments