første xml update
[virt-orchestrator.git] / vFLOWER / content / Workflows / Library / vCenter / Guest operations / Files / List path in guest.workflow.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="C28080808080808080808080808080808180808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
3     <display-name>List path in guest</display-name>
4
5     <description>List path in a guest VM. Output parameter result is list of files and/or directories or throws if path does not exists.</description>
6
7     <position x="100.0" y="50.0"/>
8
9     <input>
10         <param name="vmUsername" type="string">
11             <description>Username for the virtual machine</description>
12         </param>
13         <param name="vmPassword" type="SecureString">
14             <description>Password for the virtual machine</description>
15         </param>
16         <param name="vm" type="VC:VirtualMachine">
17             <description>Virtual machine</description>
18         </param>
19         <param name="path" type="string">
20             <description>Path in virtual machine to check</description>
21         </param>
22         <param name="resultLimit" type="number">
23             <description>Result list maximum entries.</description>
24         </param>
25     </input>
26
27     <output>
28         <param name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType">
29             <description>Array of file info objects (path, type, size).</description>
30         </param>
31     </output>
32
33     <workflow-item name="item0" type="end" end-mode="0">
34         <position x="384.5" y="45.40909090909091"/>
35     </workflow-item>
36
37     <workflow-item name="item1" out-name="item0" type="task">
38         <display-name>Scriptable task</display-name>
39
40         <script encoded="false">
41 var host = vm.sdkConnection;
42
43 var guestOperationsManager = host.guestOperationsManager;
44 var guestAuth = new VcNamePasswordAuthentication();
45 guestAuth.username = vmUsername;
46 guestAuth.password = vmPassword;
47
48 var guestListFileInfo = guestOperationsManager.fileManager.listFilesInGuest(vm , guestAuth ,
49                                                                                                                                                  path , 0 , resultLimit , ".*");
50 result = new Array();
51 for (var f in guestListFileInfo.files) {
52         var file = guestListFileInfo.files[f];
53         var jsObj = { path: file.path, type: file.type, size: file.size};
54         result.push(jsObj);
55 }
56         </script>
57
58         <in-binding>
59             <bind name="vmUsername" type="string" export-name="vmUsername"/>
60             <bind name="vmPassword" type="SecureString" export-name="vmPassword"/>
61             <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
62             <bind name="path" type="string" export-name="path"/>
63             <bind name="resultLimit" type="number" export-name="resultLimit"/>
64         </in-binding>
65
66         <out-binding>
67             <bind name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType" export-name="result"/>
68         </out-binding>
69
70         <position x="204.5" y="55.40909090909091"/>
71     </workflow-item>
72
73     <presentation>
74         <p-param name="vmUsername">
75             <desc>Username for the virtual machine</desc>
76         </p-param>
77         <p-param name="vmPassword">
78             <desc>Password for the virtual machine</desc>
79         </p-param>
80         <p-param name="vm">
81             <desc>Virtual machine</desc>
82             <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
83         </p-param>
84         <p-param name="path">
85             <desc>Path in virtual machine to check</desc>
86             <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
87         </p-param>
88         <p-param name="resultLimit">
89             <desc>Result list maximum entries.</desc>
90             <p-qual kind="static" name="defaultValue" type="number">10.0</p-qual>
91         </p-param>
92     </presentation>
93 </workflow>