Ticket #120: pool-add-action.vm

File pool-add-action.vm, 1.7 kB (added by ibaldin, 8 years ago)

pool-add-action.vm

Line 
1#parse("/secure/common/top.vm")
2
3<div class="title">Create Resource Pool</div>
4<div class="titleSpacer"/>
5
6
7#set($name=$params.getString("name"))
8#set($desc=$params.getString("desc"))
9#set($props=$params.getString("props"))
10#set($controllerInstance = $params.getString("controllerInstance"))
11#set($controllerInstanceProperties = $params.getString("controllerInstanceProperties"))
12
13#set($handlerInstance = $params.getString("handlerInstance"))
14#set($handlerInstanceProperties = $params.getString("handlerInstanceProperties"))
15
16#if ($actor && $name && $controllerInstance && $handlerInstance)
17        #set ($p=$root.newProperties($props))
18       
19        Test property $p.getProperty("test.property")
20       
21        ##set ($pool = $root.newSlice())
22        ##$pool.setName($name) 
23        ##$pool.setDescription($desc)
24
25        ##set ($pname="poolResourceProperties")
26        ##parse("/secure/common/properties-action.vm")
27        ##$pool.setResourceProperties($pvalue)
28       
29        ## attach the properties
30        ##set($p=$root.newProperties())
31        ##$!{p.setProperty("memory", "${memory}")}
32        ##$!{p.setProperty("cpu.model", "${cpu}")}
33        ##$!{p.setProperty("cpu", "100")}       
34        ##set($props=$root.convertToMng($p))   
35        ##$pool.setResourceProperties($props)
36       
37        ## generate a resource type
38        ##$pool.setResourceType($root.newGuid().toString())
39        ## obtain the control descriptor
40        ##set($cont=$root.getPluginCreate($controllerInstance, $controllerInstanceProperties)) 
41        ## obtain the handler descriptor
42        ##set($handler=$root.getPluginCreate($handlerInstance, $handlerInstanceProperties))     
43        ##set ($result=$actorProxy.addResourcePool($pool, $cont, $handler, $identity.getAuth()))
44        ##printResult($result.getStatus() "Error creating resource pool" "pool-view.vm?actor=$actor.getName()&pool=$list.get($result.getResult(),0).getID()")
45#else
46        #printMessage("Invalid arguments")
47#end