@@ -142,6 +142,7 @@ public static void Configure(HypervResourceControllerConfig config)
142142
143143 private static ILog logger = LogManager . GetLogger ( typeof ( HypervResourceController ) ) ;
144144 private static string systemVmIso ;
145+ Dictionary < String , String > contextMap = new Dictionary < String , String > ( ) ;
145146
146147 public static void Initialize ( )
147148 {
@@ -203,7 +204,8 @@ public JContainer SetupCommand([FromBody]dynamic cmd)
203204 {
204205 result = result ,
205206 details = "success - NOP" ,
206- _reconnect = false
207+ _reconnect = false ,
208+ contextMap = contextMap
207209 } ;
208210
209211 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . SetupAnswer ) ;
@@ -248,7 +250,8 @@ public JContainer AttachCommand([FromBody]dynamic cmd)
248250 object ansContent = new
249251 {
250252 result = result ,
251- details = details
253+ details = details ,
254+ contextMap = contextMap
252255 } ;
253256
254257 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . AttachAnswer ) ;
@@ -292,7 +295,8 @@ public JContainer DetachCommand([FromBody]dynamic cmd)
292295 object ansContent = new
293296 {
294297 result = result ,
295- details = details
298+ details = details ,
299+ contextMap = contextMap
296300 } ;
297301
298302 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . DettachAnswer ) ;
@@ -335,7 +339,8 @@ public JContainer RebootCommand([FromBody]dynamic cmd)
335339 object ansContent = new
336340 {
337341 result = result ,
338- details = details
342+ details = details ,
343+ contextMap = contextMap
339344 } ;
340345
341346 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . RebootAnswer ) ;
@@ -397,7 +402,8 @@ public JContainer DestroyCommand([FromBody]dynamic cmd)
397402 object ansContent = new
398403 {
399404 result = result ,
400- details = details
405+ details = details ,
406+ contextMap = contextMap
401407 } ;
402408
403409 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -512,7 +518,8 @@ public JContainer CreateCommand([FromBody]dynamic cmd)
512518 {
513519 result = result ,
514520 details = details ,
515- volume = volume
521+ volume = volume ,
522+ contextMap = contextMap
516523 } ;
517524 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CreateAnswer ) ;
518525 }
@@ -580,7 +587,8 @@ public JContainer PrimaryStorageDownloadCommand([FromBody]dynamic cmd)
580587 result = result ,
581588 details = details ,
582589 templateSize = size ,
583- installPath = newCopyFileName
590+ installPath = newCopyFileName ,
591+ contextMap = contextMap
584592 } ;
585593 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . PrimaryStorageDownloadAnswer ) ;
586594 }
@@ -682,7 +690,8 @@ public JContainer CheckHealthCommand([FromBody]dynamic cmd)
682690 object ansContent = new
683691 {
684692 result = true ,
685- details = "resource is alive"
693+ details = "resource is alive" ,
694+ contextMap = contextMap
686695 } ;
687696 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckHealthAnswer ) ;
688697 }
@@ -700,7 +709,8 @@ public JContainer CheckSshCommand([FromBody]dynamic cmd)
700709 object ansContent = new
701710 {
702711 result = true ,
703- details = "NOP, TODO: implement properly"
712+ details = "NOP, TODO: implement properly" ,
713+ contextMap = contextMap
704714 } ;
705715 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckSshAnswer ) ;
706716 }
@@ -736,7 +746,8 @@ public JContainer CheckVirtualMachineCommand([FromBody]dynamic cmd)
736746 {
737747 result = result ,
738748 details = details ,
739- state = state
749+ state = state ,
750+ contextMap = contextMap
740751 } ;
741752 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckVirtualMachineAnswer ) ;
742753 }
@@ -753,7 +764,8 @@ public JContainer DeleteStoragePoolCommand([FromBody]dynamic cmd)
753764 object ansContent = new
754765 {
755766 result = true ,
756- details = "Current implementation does not delete local path corresponding to storage pool!"
767+ details = "Current implementation does not delete local path corresponding to storage pool!" ,
768+ contextMap = contextMap
757769 } ;
758770 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
759771 }
@@ -775,7 +787,8 @@ public JContainer CreateStoragePoolCommand([FromBody]dynamic cmd)
775787 object ansContent = new
776788 {
777789 result = true ,
778- details = "success - NOP"
790+ details = "success - NOP" ,
791+ contextMap = contextMap
779792 } ;
780793 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
781794 }
@@ -800,7 +813,8 @@ public JContainer ModifyStoragePoolCommand([FromBody]dynamic cmd)
800813 ansContent = new
801814 {
802815 result = result ,
803- details = details
816+ details = details ,
817+ contextMap = contextMap
804818 } ;
805819 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
806820 }
@@ -843,7 +857,8 @@ public JContainer ModifyStoragePoolCommand([FromBody]dynamic cmd)
843857 result = result ,
844858 details = details ,
845859 templateInfo = tInfo ,
846- poolInfo = poolInfo
860+ poolInfo = poolInfo ,
861+ contextMap = contextMap
847862 } ;
848863
849864 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . ModifyStoragePoolAnswer ) ;
@@ -885,7 +900,8 @@ public JContainer CleanupNetworkRulesCmd([FromBody]dynamic cmd)
885900 object ansContent = new
886901 {
887902 result = false ,
888- details = "nothing to cleanup in our current implementation"
903+ details = "nothing to cleanup in our current implementation" ,
904+ contextMap = contextMap
889905 } ;
890906 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
891907 }
@@ -902,7 +918,8 @@ public JContainer CheckNetworkCommand([FromBody]dynamic cmd)
902918 object ansContent = new
903919 {
904920 result = true ,
905- details = ( string ) null
921+ details = ( string ) null ,
922+ contextMap = contextMap
906923 } ;
907924 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckNetworkAnswer ) ;
908925 }
@@ -919,7 +936,8 @@ public JContainer ReadyCommand([FromBody]dynamic cmd)
919936 object ansContent = new
920937 {
921938 result = true ,
922- details = ( string ) null
939+ details = ( string ) null ,
940+ contextMap = contextMap
923941 } ;
924942 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . ReadyAnswer ) ;
925943 }
@@ -952,7 +970,8 @@ public JContainer StartCommand([FromBody]dynamic cmd)
952970 {
953971 result = result ,
954972 details = details ,
955- vm = cmd . vm
973+ vm = cmd . vm ,
974+ contextMap = contextMap
956975 } ;
957976 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . StartAnswer ) ;
958977 }
@@ -984,7 +1003,8 @@ public JContainer StopCommand([FromBody]dynamic cmd)
9841003 {
9851004 result = result ,
9861005 details = details ,
987- vm = cmd . vm
1006+ vm = cmd . vm ,
1007+ contextMap = contextMap
9881008 } ;
9891009 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . StopAnswer ) ;
9901010 }
@@ -1004,7 +1024,8 @@ public JContainer MaintainCommand([FromBody]dynamic cmd)
10041024 {
10051025 result = true ,
10061026 details = "success - NOP for MaintainCommand" ,
1007- _reconnect = false
1027+ _reconnect = false ,
1028+ contextMap = contextMap
10081029 } ;
10091030
10101031 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . MaintainAnswer ) ;
@@ -1025,7 +1046,8 @@ public JContainer PingRoutingCommand([FromBody]dynamic cmd)
10251046 {
10261047 result = true ,
10271048 details = "success - NOP for PingRoutingCommand" ,
1028- _reconnect = false
1049+ _reconnect = false ,
1050+ contextMap = contextMap
10291051 } ;
10301052
10311053 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -1046,7 +1068,8 @@ public JContainer PingCommand([FromBody]dynamic cmd)
10461068 {
10471069 result = true ,
10481070 details = "success - NOP for PingCommand" ,
1049- _reconnect = false
1071+ _reconnect = false ,
1072+ contextMap = contextMap
10501073 } ;
10511074
10521075 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -1092,6 +1115,7 @@ public JContainer GetVmStatsCommand([FromBody]dynamic cmd)
10921115 vmInfos = vmProcessorInfo ,
10931116 result = result ,
10941117 details = details ,
1118+ contextMap = contextMap
10951119 } ;
10961120 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetVmStatsAnswer ) ;
10971121 }
@@ -1261,7 +1285,8 @@ public JContainer CopyCommand(dynamic cmd)
12611285 {
12621286 result = result ,
12631287 details = details ,
1264- newData = cmd . destTO
1288+ newData = cmd . destTO ,
1289+ contextMap = contextMap
12651290 } ;
12661291 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CopyCmdAnswer ) ;
12671292 }
@@ -1374,7 +1399,8 @@ public JContainer GetStorageStatsCommand([FromBody]dynamic cmd)
13741399 result = result ,
13751400 details = details ,
13761401 capacity = capacity ,
1377- used = used
1402+ used = used ,
1403+ contextMap = contextMap
13781404 } ;
13791405 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetStorageStatsAnswer ) ;
13801406 }
@@ -1435,7 +1461,8 @@ public JContainer GetHostStatsCommand([FromBody]dynamic cmd)
14351461 {
14361462 result = result ,
14371463 hostStats = hostStats ,
1438- details = details
1464+ details = details ,
1465+ contextMap = contextMap
14391466 } ;
14401467 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetHostStatsAnswer ) ;
14411468 }
@@ -1466,7 +1493,8 @@ public JContainer PrepareForMigrationCommand([FromBody]dynamic cmd)
14661493 object ansContent = new
14671494 {
14681495 result = result ,
1469- details = details
1496+ details = details ,
1497+ contextMap = contextMap
14701498 } ;
14711499
14721500 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . PrepareForMigrationAnswer ) ;
@@ -1498,7 +1526,8 @@ public JContainer MigrateCommand([FromBody]dynamic cmd)
14981526 object ansContent = new
14991527 {
15001528 result = result ,
1501- details = details
1529+ details = details ,
1530+ contextMap = contextMap
15021531 } ;
15031532
15041533 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . MigrateAnswer ) ;
@@ -1589,7 +1618,8 @@ public JContainer StartupCommand([FromBody]dynamic cmdArray)
15891618 poolInfo = pi ,
15901619 guid = pi . uuid ,
15911620 dataCenter = strtRouteCmd . dataCenter ,
1592- resourceType = StorageResourceType . STORAGE_POOL . ToString ( ) // TODO: check encoding
1621+ resourceType = StorageResourceType . STORAGE_POOL . ToString ( ) , // TODO: check encoding
1622+ contextMap = contextMap
15931623 } ;
15941624 JObject ansObj = Utils . CreateCloudStackObject ( CloudStackTypes . StartupStorageCommand , ansContent ) ;
15951625 cmdArray . Add ( ansObj ) ;
0 commit comments