File tree 5 files changed +92
-22
lines changed
5 files changed +92
-22
lines changed Original file line number Diff line number Diff line change 1
1
docs /_build /
2
2
env /
3
3
* .pyc
4
+ dist /
Original file line number Diff line number Diff line change 19
19
#
20
20
import os
21
21
import sys
22
+ import alabaster
22
23
sys .path .insert (0 , os .path .abspath ('..' ))
23
24
from vix import __version__
24
25
32
33
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33
34
# ones.
34
35
extensions = [
36
+ 'alabaster' ,
35
37
'sphinx.ext.autodoc' ,
36
38
]
37
39
53
55
54
56
# General information about the project.
55
57
project = 'vix'
56
- copyright = '2016 , Naim A.'
58
+ copyright = '2017 , Naim A.'
57
59
author = 'Naim A.'
58
60
59
61
# The version info for the project you're documenting, acts as replacement for
142
144
'github_repo' : 'vix' ,
143
145
'description' : 'The unofficial python binding for VIX' ,
144
146
'analytics_id' : 'UA-11289087-19' ,
147
+ 'sidebar_collapse' : False ,
148
+ 'show_related' : True ,
149
+ 'fixed_sidebar' : True ,
145
150
}
146
151
147
152
# Add any paths that contain custom themes here, relative to this directory.
148
153
# html_theme_path = []
154
+ html_theme_path = [alabaster .get_path ()]
149
155
150
156
# The name for this set of Sphinx documents.
151
157
# "<project> v<release> documentation" by default.
191
197
192
198
# Custom sidebar templates, maps document names to template names.
193
199
#
194
- # html_sidebars = {}
200
+ html_sidebars = {
201
+ '**' : [
202
+ 'about.html' ,
203
+ 'navigation.html' ,
204
+ 'relations.html' ,
205
+ 'searchbox.html' ,
206
+ 'donate.html' ,
207
+ ]
208
+ }
195
209
196
210
# Additional templates that should be rendered to pages, maps page names to
197
211
# template names.
Original file line number Diff line number Diff line change 3
3
You can adapt this file completely to your liking, but it should at least
4
4
contain the root `toctree` directive.
5
5
6
- VIX python binding
6
+ .. toctree ::
7
+ :maxdepth: 2
8
+ :hidden:
9
+
10
+ tutorials
11
+ vix
12
+
13
+ VIX Python binding
7
14
==================
8
15
9
16
This is an unofficial binding of VMware's VIX API.
10
17
11
18
The VIX project is hosted on GitHub: https://github.com/naim94a/vix.
12
19
Feel free to submit pull requests and issues.
13
20
14
- Example:
21
+ About
22
+ -----
23
+ VIX is a C library created by VMWare, the aim of this project is to wrap it in python.
24
+ This project allow Object-Oriented access to various VMWare products.
25
+
26
+
27
+ Installing
28
+ ----------
29
+
30
+ .. code-block :: shell
31
+
32
+ pip install vix
33
+
34
+
35
+ Example usage
36
+ -------------
15
37
16
38
.. code-block :: python
17
39
:caption: snapshot- demo.py
@@ -34,19 +56,3 @@ Example:
34
56
35
57
except VixError as ex:
36
58
print (" Operatation failed: {0} " .format(ex))
37
-
38
- API:
39
-
40
- .. toctree ::
41
- :maxdepth: 4
42
-
43
- vix
44
-
45
-
46
- Indices and tables
47
- ==================
48
-
49
- * :ref: `genindex `
50
- * :ref: `modindex `
51
- * :ref: `search `
52
-
Original file line number Diff line number Diff line change
1
+ Tutorials
2
+ =========
3
+
4
+ Capturing screens
5
+ -----------------
6
+ Every wanted to take a screenshot of whats going on in a running VM?
7
+ Well, you are in luck! VIX supports taking screenshots, this will require you to know a guest's username/password.
8
+
9
+ The VIX python binding can return a screenshot in PNG format. You can choose between having the file written to a file, or getting the PNG buffer.
10
+
11
+ This example will demonstrate how to take screenshots from a VM every 10 seconds.
12
+
13
+ .. code-block :: python
14
+ :caption: screenshots.py
15
+
16
+ import time
17
+ from vix import VixHost
18
+
19
+ host = VixHost()
20
+ vm = host.open_vm(' ~/my vm.vmx' )
21
+
22
+ # Must login to do some things...
23
+ vm.login(' root' , ' toor' )
24
+ while True :
25
+ vm.capture_screen_image(' ~/IMG_{name} _{timestamp:.0f } .png' .format(name = vm.name, timestamp = time.time()))
26
+ time.sleep(10.0 )
27
+
28
+
29
+ Cloning Machines
30
+ ----------------
31
+ Cloning machines are usually a more useful action then capturing screenshots. It is a pretty simple task to...
32
+
33
+ .. code-block :: python
34
+ :caption: snapshot.py
35
+
36
+ from vix import VixHost
37
+
38
+ host = VixHost()
39
+ vm = host.open_vm(' ~/template.vmx' )
40
+
41
+ # Assuming that template.vmx is currently on a powered off snapshot.
42
+ snapshot = vm.snapshot_get_current()
43
+
44
+ # This clone will be based of 'template.vmx' at the specified snapshot.
45
+ # Linked snapshots take less space...
46
+ cloned = vm.clone(' ~/cloned.vmx' , snapshot = snapshot, linked = True )
47
+
48
+ # Let fire up our cloned machine!
49
+ cloned.power_on()
Original file line number Diff line number Diff line change 1
- vix package
2
- ===========
1
+ VIX Reference
2
+ =============
3
3
4
4
VixHost class
5
5
-------------
You can’t perform that action at this time.
0 commit comments