første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.datastore / getValidDatastoreForNetwork.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="getValidDatastoreForNetwork" result-type="Array/VC:Datastore" api-version="3.1.0" id="0e0dc068-af83-41db-bb50-4b779c3aafe3" version="0.2.0" allowed-operations="fv">
3     <description>Get all valid datastores for a network.</description>
4
5     <param n="network" t="VC:Network"/>
6
7     <script encoded="false">
8 var hosts = network.host;
9 var datastores =  new Properties();
10 for(var i in hosts){
11         var datastores2 = hosts[i].datastore;
12         for(j in datastores2) {
13                 datastores.put(datastores2[j].name, datastores2[j]);
14         }
15 }
16
17 var result = new Array();
18 for(var i in datastores.keys){
19         result.push(datastores.get(datastores.keys[i]));
20 }
21 return result;
22     </script>
23 </dunes-script-module>