@@ -114,6 +114,7 @@ public static void Configure(HypervResourceControllerConfig config)
114114
115115 private static ILog logger = LogManager . GetLogger ( typeof ( HypervResourceController ) ) ;
116116 private static string systemVmIso ;
117+ Dictionary < String , String > contextMap = new Dictionary < String , String > ( ) ;
117118
118119 public static void Initialize ( )
119120 {
@@ -175,7 +176,8 @@ public JContainer SetupCommand([FromBody]dynamic cmd)
175176 {
176177 result = result ,
177178 details = "success - NOP" ,
178- _reconnect = false
179+ _reconnect = false ,
180+ contextMap = contextMap
179181 } ;
180182
181183 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . SetupAnswer ) ;
@@ -220,7 +222,8 @@ public JContainer AttachCommand([FromBody]dynamic cmd)
220222 object ansContent = new
221223 {
222224 result = result ,
223- details = details
225+ details = details ,
226+ contextMap = contextMap
224227 } ;
225228
226229 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . AttachAnswer ) ;
@@ -264,7 +267,8 @@ public JContainer DetachCommand([FromBody]dynamic cmd)
264267 object ansContent = new
265268 {
266269 result = result ,
267- details = details
270+ details = details ,
271+ contextMap = contextMap
268272 } ;
269273
270274 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . DettachAnswer ) ;
@@ -307,7 +311,8 @@ public JContainer RebootCommand([FromBody]dynamic cmd)
307311 object ansContent = new
308312 {
309313 result = result ,
310- details = details
314+ details = details ,
315+ contextMap = contextMap
311316 } ;
312317
313318 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . RebootAnswer ) ;
@@ -369,7 +374,8 @@ public JContainer DestroyCommand([FromBody]dynamic cmd)
369374 object ansContent = new
370375 {
371376 result = result ,
372- details = details
377+ details = details ,
378+ contextMap = contextMap
373379 } ;
374380
375381 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -484,7 +490,8 @@ public JContainer CreateCommand([FromBody]dynamic cmd)
484490 {
485491 result = result ,
486492 details = details ,
487- volume = volume
493+ volume = volume ,
494+ contextMap = contextMap
488495 } ;
489496 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CreateAnswer ) ;
490497 }
@@ -552,7 +559,8 @@ public JContainer PrimaryStorageDownloadCommand([FromBody]dynamic cmd)
552559 result = result ,
553560 details = details ,
554561 templateSize = size ,
555- installPath = newCopyFileName
562+ installPath = newCopyFileName ,
563+ contextMap = contextMap
556564 } ;
557565 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . PrimaryStorageDownloadAnswer ) ;
558566 }
@@ -654,7 +662,8 @@ public JContainer CheckHealthCommand([FromBody]dynamic cmd)
654662 object ansContent = new
655663 {
656664 result = true ,
657- details = "resource is alive"
665+ details = "resource is alive" ,
666+ contextMap = contextMap
658667 } ;
659668 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckHealthAnswer ) ;
660669 }
@@ -672,7 +681,8 @@ public JContainer CheckSshCommand([FromBody]dynamic cmd)
672681 object ansContent = new
673682 {
674683 result = true ,
675- details = "NOP, TODO: implement properly"
684+ details = "NOP, TODO: implement properly" ,
685+ contextMap = contextMap
676686 } ;
677687 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckSshAnswer ) ;
678688 }
@@ -708,7 +718,8 @@ public JContainer CheckVirtualMachineCommand([FromBody]dynamic cmd)
708718 {
709719 result = result ,
710720 details = details ,
711- state = state
721+ state = state ,
722+ contextMap = contextMap
712723 } ;
713724 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckVirtualMachineAnswer ) ;
714725 }
@@ -725,7 +736,8 @@ public JContainer DeleteStoragePoolCommand([FromBody]dynamic cmd)
725736 object ansContent = new
726737 {
727738 result = true ,
728- details = "Current implementation does not delete local path corresponding to storage pool!"
739+ details = "Current implementation does not delete local path corresponding to storage pool!" ,
740+ contextMap = contextMap
729741 } ;
730742 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
731743 }
@@ -747,7 +759,8 @@ public JContainer CreateStoragePoolCommand([FromBody]dynamic cmd)
747759 object ansContent = new
748760 {
749761 result = true ,
750- details = "success - NOP"
762+ details = "success - NOP" ,
763+ contextMap = contextMap
751764 } ;
752765 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
753766 }
@@ -772,7 +785,8 @@ public JContainer ModifyStoragePoolCommand([FromBody]dynamic cmd)
772785 ansContent = new
773786 {
774787 result = result ,
775- details = details
788+ details = details ,
789+ contextMap = contextMap
776790 } ;
777791 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
778792 }
@@ -815,7 +829,8 @@ public JContainer ModifyStoragePoolCommand([FromBody]dynamic cmd)
815829 result = result ,
816830 details = details ,
817831 templateInfo = tInfo ,
818- poolInfo = poolInfo
832+ poolInfo = poolInfo ,
833+ contextMap = contextMap
819834 } ;
820835
821836 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . ModifyStoragePoolAnswer ) ;
@@ -857,7 +872,8 @@ public JContainer CleanupNetworkRulesCmd([FromBody]dynamic cmd)
857872 object ansContent = new
858873 {
859874 result = false ,
860- details = "nothing to cleanup in our current implementation"
875+ details = "nothing to cleanup in our current implementation" ,
876+ contextMap = contextMap
861877 } ;
862878 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
863879 }
@@ -874,7 +890,8 @@ public JContainer CheckNetworkCommand([FromBody]dynamic cmd)
874890 object ansContent = new
875891 {
876892 result = true ,
877- details = ( string ) null
893+ details = ( string ) null ,
894+ contextMap = contextMap
878895 } ;
879896 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CheckNetworkAnswer ) ;
880897 }
@@ -891,7 +908,8 @@ public JContainer ReadyCommand([FromBody]dynamic cmd)
891908 object ansContent = new
892909 {
893910 result = true ,
894- details = ( string ) null
911+ details = ( string ) null ,
912+ contextMap = contextMap
895913 } ;
896914 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . ReadyAnswer ) ;
897915 }
@@ -924,7 +942,8 @@ public JContainer StartCommand([FromBody]dynamic cmd)
924942 {
925943 result = result ,
926944 details = details ,
927- vm = cmd . vm
945+ vm = cmd . vm ,
946+ contextMap = contextMap
928947 } ;
929948 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . StartAnswer ) ;
930949 }
@@ -956,7 +975,8 @@ public JContainer StopCommand([FromBody]dynamic cmd)
956975 {
957976 result = result ,
958977 details = details ,
959- vm = cmd . vm
978+ vm = cmd . vm ,
979+ contextMap = contextMap
960980 } ;
961981 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . StopAnswer ) ;
962982 }
@@ -976,7 +996,8 @@ public JContainer MaintainCommand([FromBody]dynamic cmd)
976996 {
977997 result = true ,
978998 details = "success - NOP for MaintainCommand" ,
979- _reconnect = false
999+ _reconnect = false ,
1000+ contextMap = contextMap
9801001 } ;
9811002
9821003 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . MaintainAnswer ) ;
@@ -997,7 +1018,8 @@ public JContainer PingRoutingCommand([FromBody]dynamic cmd)
9971018 {
9981019 result = true ,
9991020 details = "success - NOP for PingRoutingCommand" ,
1000- _reconnect = false
1021+ _reconnect = false ,
1022+ contextMap = contextMap
10011023 } ;
10021024
10031025 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -1018,7 +1040,8 @@ public JContainer PingCommand([FromBody]dynamic cmd)
10181040 {
10191041 result = true ,
10201042 details = "success - NOP for PingCommand" ,
1021- _reconnect = false
1043+ _reconnect = false ,
1044+ contextMap = contextMap
10221045 } ;
10231046
10241047 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . Answer ) ;
@@ -1064,6 +1087,7 @@ public JContainer GetVmStatsCommand([FromBody]dynamic cmd)
10641087 vmInfos = vmProcessorInfo ,
10651088 result = result ,
10661089 details = details ,
1090+ contextMap = contextMap
10671091 } ;
10681092 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetVmStatsAnswer ) ;
10691093 }
@@ -1225,7 +1249,8 @@ public JContainer CopyCommand(dynamic cmd)
12251249 {
12261250 result = result ,
12271251 details = details ,
1228- newData = cmd . destTO
1252+ newData = cmd . destTO ,
1253+ contextMap = contextMap
12291254 } ;
12301255 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . CopyCmdAnswer ) ;
12311256 }
@@ -1338,7 +1363,8 @@ public JContainer GetStorageStatsCommand([FromBody]dynamic cmd)
13381363 result = result ,
13391364 details = details ,
13401365 capacity = capacity ,
1341- used = used
1366+ used = used ,
1367+ contextMap = contextMap
13421368 } ;
13431369 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetStorageStatsAnswer ) ;
13441370 }
@@ -1399,7 +1425,8 @@ public JContainer GetHostStatsCommand([FromBody]dynamic cmd)
13991425 {
14001426 result = result ,
14011427 hostStats = hostStats ,
1402- details = details
1428+ details = details ,
1429+ contextMap = contextMap
14031430 } ;
14041431 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . GetHostStatsAnswer ) ;
14051432 }
@@ -1430,7 +1457,8 @@ public JContainer PrepareForMigrationCommand([FromBody]dynamic cmd)
14301457 object ansContent = new
14311458 {
14321459 result = result ,
1433- details = details
1460+ details = details ,
1461+ contextMap = contextMap
14341462 } ;
14351463
14361464 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . PrepareForMigrationAnswer ) ;
@@ -1462,7 +1490,8 @@ public JContainer MigrateCommand([FromBody]dynamic cmd)
14621490 object ansContent = new
14631491 {
14641492 result = result ,
1465- details = details
1493+ details = details ,
1494+ contextMap = contextMap
14661495 } ;
14671496
14681497 return ReturnCloudStackTypedJArray ( ansContent , CloudStackTypes . MigrateAnswer ) ;
@@ -1553,7 +1582,8 @@ public JContainer StartupCommand([FromBody]dynamic cmdArray)
15531582 poolInfo = pi ,
15541583 guid = pi . uuid ,
15551584 dataCenter = strtRouteCmd . dataCenter ,
1556- resourceType = StorageResourceType . STORAGE_POOL . ToString ( ) // TODO: check encoding
1585+ resourceType = StorageResourceType . STORAGE_POOL . ToString ( ) , // TODO: check encoding
1586+ contextMap = contextMap
15571587 } ;
15581588 JObject ansObj = Utils . CreateCloudStackObject ( CloudStackTypes . StartupStorageCommand , ansContent ) ;
15591589 cmdArray . Add ( ansObj ) ;
0 commit comments