- add sources.
[platform/framework/web/crosswalk.git] / src / tools / telemetry / docs / telemetry.core.chrome.cros_interface.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html><head><title>Python: module telemetry.core.chrome.cros_interface</title>
4 </head><body bgcolor="#f0f0f8">
5
6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7 <tr bgcolor="#7799ee">
8 <td valign=bottom>&nbsp;<br>
9 <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.chrome.html"><font color="#ffffff">chrome</font></a>.cros_interface</strong></big></big></font></td
10 ><td align=right valign=bottom
11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/chrome/cros_interface.py">telemetry/core/chrome/cros_interface.py</a></font></td></tr></table>
12     <p><tt>A&nbsp;wrapper&nbsp;around&nbsp;ssh&nbsp;for&nbsp;common&nbsp;operations&nbsp;on&nbsp;a&nbsp;CrOS-based&nbsp;device</tt></p>
13 <p>
14 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
15 <tr bgcolor="#aa55cc">
16 <td colspan=3 valign=bottom>&nbsp;<br>
17 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
18     
19 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
20 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
21 <a href="os.html">os</a><br>
22 </td><td width="25%" valign=top><a href="re.html">re</a><br>
23 <a href="subprocess.html">subprocess</a><br>
24 </td><td width="25%" valign=top><a href="sys.html">sys</a><br>
25 <a href="tempfile.html">tempfile</a><br>
26 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
27 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
28 <tr bgcolor="#ee77aa">
29 <td colspan=3 valign=bottom>&nbsp;<br>
30 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
31     
32 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
33 <td width="100%"><dl>
34 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
35 </font></dt><dd>
36 <dl>
37 <dt><font face="helvetica, arial"><a href="telemetry.core.chrome.cros_interface.html#CrOSInterface">CrOSInterface</a>
38 </font></dt></dl>
39 </dd>
40 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
41 </font></dt><dd>
42 <dl>
43 <dt><font face="helvetica, arial"><a href="telemetry.core.chrome.cros_interface.html#LoginException">LoginException</a>
44 </font></dt><dd>
45 <dl>
46 <dt><font face="helvetica, arial"><a href="telemetry.core.chrome.cros_interface.html#KeylessLoginRequiredException">KeylessLoginRequiredException</a>
47 </font></dt></dl>
48 </dd>
49 </dl>
50 </dd>
51 </dl>
52  <p>
53 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
54 <tr bgcolor="#ffc8d8">
55 <td colspan=3 valign=bottom>&nbsp;<br>
56 <font color="#000000" face="helvetica, arial"><a name="CrOSInterface">class <strong>CrOSInterface</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
57     
58 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
59 <td width="100%">Methods defined here:<br>
60 <dl><dt><a name="CrOSInterface-FileExistsOnDevice"><strong>FileExistsOnDevice</strong></a>(self, file_name, quiet<font color="#909090">=False</font>)</dt></dl>
61
62 <dl><dt><a name="CrOSInterface-FilesystemMountedAt"><strong>FilesystemMountedAt</strong></a>(self, path)</dt><dd><tt>Returns&nbsp;the&nbsp;filesystem&nbsp;mounted&nbsp;at&nbsp;|path|</tt></dd></dl>
63
64 <dl><dt><a name="CrOSInterface-FormSSHCommandLine"><strong>FormSSHCommandLine</strong></a>(self, args, extra_ssh_args<font color="#909090">=None</font>)</dt></dl>
65
66 <dl><dt><a name="CrOSInterface-GetFileContents"><strong>GetFileContents</strong></a>(self, filename)</dt></dl>
67
68 <dl><dt><a name="CrOSInterface-GetRemotePort"><strong>GetRemotePort</strong></a>(self)</dt></dl>
69
70 <dl><dt><a name="CrOSInterface-IsHTTPServerRunningOnPort"><strong>IsHTTPServerRunningOnPort</strong></a>(self, port)</dt></dl>
71
72 <dl><dt><a name="CrOSInterface-IsServiceRunning"><strong>IsServiceRunning</strong></a>(self, service_name)</dt></dl>
73
74 <dl><dt><a name="CrOSInterface-KillAllMatching"><strong>KillAllMatching</strong></a>(self, predicate)</dt></dl>
75
76 <dl><dt><a name="CrOSInterface-ListProcesses"><strong>ListProcesses</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;tuple&nbsp;(pid,&nbsp;cmd,&nbsp;ppid)&nbsp;of&nbsp;all&nbsp;processes&nbsp;on&nbsp;the&nbsp;device.</tt></dd></dl>
77
78 <dl><dt><a name="CrOSInterface-PushContents"><strong>PushContents</strong></a>(self, text, remote_filename)</dt></dl>
79
80 <dl><dt><a name="CrOSInterface-PushFile"><strong>PushFile</strong></a>(self, filename, remote_filename)</dt></dl>
81
82 <dl><dt><a name="CrOSInterface-RmRF"><strong>RmRF</strong></a>(self, filename)</dt></dl>
83
84 <dl><dt><a name="CrOSInterface-RunCmdOnDevice"><strong>RunCmdOnDevice</strong></a>(self, args, cwd<font color="#909090">=None</font>, quiet<font color="#909090">=False</font>)</dt></dl>
85
86 <dl><dt><a name="CrOSInterface-TryLogin"><strong>TryLogin</strong></a>(self)</dt></dl>
87
88 <dl><dt><a name="CrOSInterface-__init__"><strong>__init__</strong></a>(self, hostname<font color="#909090">=None</font>, ssh_identity<font color="#909090">=None</font>)</dt><dd><tt>#&nbsp;pylint:&nbsp;disable=R0923</tt></dd></dl>
89
90 <hr>
91 Data descriptors defined here:<br>
92 <dl><dt><strong>__dict__</strong></dt>
93 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
94 </dl>
95 <dl><dt><strong>__weakref__</strong></dt>
96 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
97 </dl>
98 <dl><dt><strong>hostname</strong></dt>
99 </dl>
100 <dl><dt><strong>local</strong></dt>
101 </dl>
102 </td></tr></table> <p>
103 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
104 <tr bgcolor="#ffc8d8">
105 <td colspan=3 valign=bottom>&nbsp;<br>
106 <font color="#000000" face="helvetica, arial"><a name="KeylessLoginRequiredException">class <strong>KeylessLoginRequiredException</strong></a>(<a href="telemetry.core.chrome.cros_interface.html#LoginException">LoginException</a>)</font></td></tr>
107     
108 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
109 <td width="100%"><dl><dt>Method resolution order:</dt>
110 <dd><a href="telemetry.core.chrome.cros_interface.html#KeylessLoginRequiredException">KeylessLoginRequiredException</a></dd>
111 <dd><a href="telemetry.core.chrome.cros_interface.html#LoginException">LoginException</a></dd>
112 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
113 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
114 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
115 </dl>
116 <hr>
117 Data descriptors inherited from <a href="telemetry.core.chrome.cros_interface.html#LoginException">LoginException</a>:<br>
118 <dl><dt><strong>__weakref__</strong></dt>
119 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
120 </dl>
121 <hr>
122 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
123 <dl><dt><a name="KeylessLoginRequiredException-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
124
125 <hr>
126 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
127 <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#KeylessLoginRequiredException-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
128
129 <hr>
130 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
131 <dl><dt><a name="KeylessLoginRequiredException-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
132
133 <dl><dt><a name="KeylessLoginRequiredException-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
134
135 <dl><dt><a name="KeylessLoginRequiredException-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
136
137 <dl><dt><a name="KeylessLoginRequiredException-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
138 &nbsp;<br>
139 Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
140
141 <dl><dt><a name="KeylessLoginRequiredException-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
142
143 <dl><dt><a name="KeylessLoginRequiredException-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
144
145 <dl><dt><a name="KeylessLoginRequiredException-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
146
147 <dl><dt><a name="KeylessLoginRequiredException-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
148
149 <dl><dt><a name="KeylessLoginRequiredException-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#KeylessLoginRequiredException-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
150
151 <dl><dt><a name="KeylessLoginRequiredException-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
152
153 <hr>
154 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
155 <dl><dt><strong>__dict__</strong></dt>
156 </dl>
157 <dl><dt><strong>args</strong></dt>
158 </dl>
159 <dl><dt><strong>message</strong></dt>
160 </dl>
161 </td></tr></table> <p>
162 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
163 <tr bgcolor="#ffc8d8">
164 <td colspan=3 valign=bottom>&nbsp;<br>
165 <font color="#000000" face="helvetica, arial"><a name="LoginException">class <strong>LoginException</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
166     
167 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
168 <td width="100%"><dl><dt>Method resolution order:</dt>
169 <dd><a href="telemetry.core.chrome.cros_interface.html#LoginException">LoginException</a></dd>
170 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
171 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
172 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
173 </dl>
174 <hr>
175 Data descriptors defined here:<br>
176 <dl><dt><strong>__weakref__</strong></dt>
177 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
178 </dl>
179 <hr>
180 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
181 <dl><dt><a name="LoginException-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
182
183 <hr>
184 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
185 <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#LoginException-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
186
187 <hr>
188 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
189 <dl><dt><a name="LoginException-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
190
191 <dl><dt><a name="LoginException-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
192
193 <dl><dt><a name="LoginException-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
194
195 <dl><dt><a name="LoginException-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
196 &nbsp;<br>
197 Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
198
199 <dl><dt><a name="LoginException-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
200
201 <dl><dt><a name="LoginException-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
202
203 <dl><dt><a name="LoginException-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
204
205 <dl><dt><a name="LoginException-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
206
207 <dl><dt><a name="LoginException-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#LoginException-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
208
209 <dl><dt><a name="LoginException-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
210
211 <hr>
212 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
213 <dl><dt><strong>__dict__</strong></dt>
214 </dl>
215 <dl><dt><strong>args</strong></dt>
216 </dl>
217 <dl><dt><strong>message</strong></dt>
218 </dl>
219 </td></tr></table></td></tr></table><p>
220 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
221 <tr bgcolor="#eeaa77">
222 <td colspan=3 valign=bottom>&nbsp;<br>
223 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
224     
225 <tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
226 <td width="100%"><dl><dt><a name="-GetAllCmdOutput"><strong>GetAllCmdOutput</strong></a>(args, cwd<font color="#909090">=None</font>, quiet<font color="#909090">=False</font>)</dt><dd><tt>Open&nbsp;a&nbsp;subprocess&nbsp;to&nbsp;execute&nbsp;a&nbsp;program&nbsp;and&nbsp;returns&nbsp;its&nbsp;output.<br>
227 &nbsp;<br>
228 Args:<br>
229 &nbsp;&nbsp;args:&nbsp;A&nbsp;string&nbsp;or&nbsp;a&nbsp;sequence&nbsp;of&nbsp;program&nbsp;arguments.&nbsp;The&nbsp;program&nbsp;to&nbsp;execute&nbsp;is<br>
230 &nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;string&nbsp;or&nbsp;the&nbsp;first&nbsp;item&nbsp;in&nbsp;the&nbsp;args&nbsp;sequence.<br>
231 &nbsp;&nbsp;cwd:&nbsp;If&nbsp;not&nbsp;None,&nbsp;the&nbsp;subprocess's&nbsp;current&nbsp;directory&nbsp;will&nbsp;be&nbsp;changed&nbsp;to<br>
232 &nbsp;&nbsp;&nbsp;&nbsp;|cwd|&nbsp;before&nbsp;it's&nbsp;executed.<br>
233 &nbsp;<br>
234 Returns:<br>
235 &nbsp;&nbsp;Captures&nbsp;and&nbsp;returns&nbsp;the&nbsp;command's&nbsp;stdout.<br>
236 &nbsp;&nbsp;Prints&nbsp;the&nbsp;command's&nbsp;stderr&nbsp;to&nbsp;logger&nbsp;(which&nbsp;defaults&nbsp;to&nbsp;stdout).</tt></dd></dl>
237  <dl><dt><a name="-HasSSH"><strong>HasSSH</strong></a>()</dt></dl>
238  <dl><dt><a name="-IsRunningOnCrosDevice"><strong>IsRunningOnCrosDevice</strong></a>()</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;we're&nbsp;on&nbsp;a&nbsp;ChromeOS&nbsp;device.</tt></dd></dl>
239  <dl><dt><a name="-RunCmd"><strong>RunCmd</strong></a>(args, cwd<font color="#909090">=None</font>, quiet<font color="#909090">=False</font>)</dt><dd><tt>Opens&nbsp;a&nbsp;subprocess&nbsp;to&nbsp;execute&nbsp;a&nbsp;program&nbsp;and&nbsp;returns&nbsp;its&nbsp;return&nbsp;value.<br>
240 &nbsp;<br>
241 Args:<br>
242 &nbsp;&nbsp;args:&nbsp;A&nbsp;string&nbsp;or&nbsp;a&nbsp;sequence&nbsp;of&nbsp;program&nbsp;arguments.&nbsp;The&nbsp;program&nbsp;to&nbsp;execute&nbsp;is<br>
243 &nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;string&nbsp;or&nbsp;the&nbsp;first&nbsp;item&nbsp;in&nbsp;the&nbsp;args&nbsp;sequence.<br>
244 &nbsp;&nbsp;cwd:&nbsp;If&nbsp;not&nbsp;None,&nbsp;the&nbsp;subprocess's&nbsp;current&nbsp;directory&nbsp;will&nbsp;be&nbsp;changed&nbsp;to<br>
245 &nbsp;&nbsp;&nbsp;&nbsp;|cwd|&nbsp;before&nbsp;it's&nbsp;executed.<br>
246 &nbsp;<br>
247 Returns:<br>
248 &nbsp;&nbsp;Return&nbsp;code&nbsp;from&nbsp;the&nbsp;command&nbsp;execution.</tt></dd></dl>
249 </td></tr></table>
250 </body></html>