1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-26 19:29:58 -05:00
vsphere-automation-sdk-python/docs/client/vSphere-Automation-Client-SDK-Python-README.html
2016-10-26 16:08:23 -07:00

300 lines
10 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html><head>
<title>VMware vSphere Automation Python SDK: client README</title>
<meta content="VMware, Inc. All rights reserved." name="copyright"></meta>
<link rel="stylesheet" type="text/css" href="../docs/resources/template.css"></link>
<script src="../docs/resources/version.js" type="text/javascript"></script>
<style type="text/css">
h4 {
padding: 0;
font-size: 12px;
font-weight: bold;
border-top: 1px solid #dedede;
background-color:#E6EDF6;
}
.Parameter {
margin: 0 0 7px 0;
width: 100%;
font-size: 11px;
font-weight: bold;
}
.Code
{
font-size: 11px; font-family:
"Courier New", Courier, monospace;
}
.Console
{
font-size: 11px; font-family:
"Courier New", Courier, monospace;
color: #ffffff;
font-weight: bold;
background: #000000;
}
.Caption {
font-size:11px; line-height:12px; text-transform: uppercase; FONT-WEIGHT: bold; COLOR: #000000; TEXT-DECORATION: none
}
.Exp {
font-size:11px; text-transform: uppercase; FONT-WEIGHT: bold; COLOR: #3366AA;
}
.Large { font-size: 16px; FONT-WEIGHT: bold; }
.TableText {
FONT-SIZE: 11px;
}
.TableHead {
FONT-SIZE: 10px; font-weight: bold;
}
.BoldRedText {
FONT-WEIGHT: bold; COLOR: #CC0000; TEXT-DECORATION: none
}
.BoldBlue {
FONT-WEIGHT: bold; COLOR: #3366AA; TEXT-DECORATION: none
}
.Miniscule {font-size: 9px;
}
.Nav {font-size: 11px; COLOR: #3366AA;
}
.Large { font-size: 16px; FONT-WEIGHT: bold; }
</style>
</head>
<body>
<table cellpadding="0" cellspacing="5" id="main-table">
<tr><td id="main-body" align="left">
<!-- ///*** start of content area ***/// -->
<table width="100%" cellpadding="5">
<tr>
<td><h1>VMware vSphere Automation Python SDK: client README</h1></td>
<td align="right">
<img src="../docs/resources/vmware.gif" alt="VMware logo" width="187" height="72" border="0"></img>
</td>
</tr>
</table>
<p class="Nav">
<img src="../docs/resources/page.gif" alt="Python SDK client samples README" width="13" height="16" border="0"></img> &nbsp;
<a href="samples/vSphere-Automation-Client-SDK-Python-Samples-README.html" title="README for the Python SDK samples...">README for Python SDK samples</a><br />
<img src="../docs/resources/page.gif" alt="vSphere Automation Python SDK README" width="13" height="16" border="0"></img> &nbsp;
<a href="../vSphere-Automation-SDK-Python-README.html" title="vSphere Automation Python SDK README...">vSphere Automation Python SDK README</a><br />
</p>
<hr/>
The following section describes the current directory contents:
<ul>
<li><a href="#packagecontents">Directory structure</a></li>
<li><a href="#apidocs">Python SDK API Docs</a></li>
<li><a href="#lib">SDK libraries</a></li>
<li><a href="#installingsdklibs">Installing SDK and 3rd party libraries</a></li>
<li><a href="#runningsample">Running a sample</a></li>
</ul>
<a name="packagecontents"></a>
<h2>Directory structure</h2>
<p>The vSphere Automation Client SDK for Python provides client bindings, documentation, samples, and WSDL files. The following table shows the client directories and their contents.</p>
<table cellpadding="5" cellspacing="0" border="1" width="100%" class="TableText">
<tr><th width="15%">Directory</th><th width="35%">Description</th><th width="60%">Contents</th></tr>
<tr>
<td>bin</td>
<td>Command scripts for sample execution</td>
<td>run_sample.bat</br>run_sample.sh</td>
</tr>
<tr>
<td>lib</td>
<td>VMware python libraries for accessing vSphere Automation services</td>
<script type="text/javascript">
document.write('<td>')
document.write('vapi_runtime-' + gVersions.vapiversion + '.zip' + '</br>')
document.write('vapi_common_client-' + gVersions.vapiversion + '.zip' + '</br>')
document.write('vapi_client_bindings-' + gVersions.bindingsversion + '.zip' + '</br>')
document.write('</td>')
</script>
</tr>
<tr>
<td>samples</td>
<td>Python samples that demonstrate the use of the vSphere Automation API</td>
<td>See the <a href="samples/vSphere-Automation-Client-SDK-Python-Samples-README.html">Python samples README</a><br />
</td>
</tr>
<tr>
<td>wsdl</td>
<td>Lookup Service WSDL files.</td>
<td>lookup.wsdl<br/>lookupservice.wsdl</td>
</tr>
</table>
<br>
<a name="apidocs"></a>
<h2>Python SDK API Docs</h2>
<p>
<strong>apidocs</strong> directory contains the generated python API reference documentation for vSphere Automation features like Content Library and Tagging.
The README page also includes a hyperlink to pyVmomi API reference documentation for convenience.
Please Refer to <a href="../docs/apidocs/vSphere-Automation-SDK-Python-APIRef-README.html"> vSphere Automation SDK Pythondoc</a> for details.
</p>
<a name="lib"></a>
<h2>SDK libraries</h2>
<p>
For python developers, client libraries are supplied for testing and development purposes.
All the supplied libraries are located under <strong>lib</strong> directory.
</p>
<table border="1" cellpadding="5">
<table cellpadding="5" cellspacing="0" border="1" width="100%" class="TableText">
<tr><th width="40%">Name</th><th width="60%">Description</th></tr>
<script type="text/javascript">
document.write('<tr><td>vapi_runtime-' + gVersions.vapiversion + '</td><td>vAPI runtime responsible for serialization/de-serialization of objects and wire protocol</td></tr>')
document.write('<tr><td>vapi_common_client-' + gVersions.vapiversion + '</td><td>vAPI common client code</td></tr>')
document.write('<tr><td>vapi_client_bindings-' + gVersions.bindingsversion + '</td><td>client stubs for vSphere Automation APIs</td></tr>')
</script>
</table>
<br>
<a name="installingsdklibs"></a>
<h2>Installing SDK and 3rd party libraries</h2>
The supplied python libs can be installed using <strong>pip install</strong>;
For details on how to install python packages using pip please refer to
<a href="http://pip.readthedocs.io/en/latest/user_guide/">pip user guide</a>.
</p>
<h3>vapi_runtime</h3>
<p>
This library is needed for accessing features like Content Library and Tagging.
</p>
<pre>&gt; pip install /path/to/VMware-vSphere-Automation-SDK-Python/client/lib/vapi_runtime-2.5.0.zip</pre>
</br>
<strong>pyOpenSSL</strong> is required by vapi_runtime. Please see the <a href="#pyopenssl">pyOpenSSL installation</a> steps for details.
</p>
<h3>vapi_common_client</h3>
<p>
This library is needed for accessing features like Content Library and Tagging.
</p>
<pre>&gt; pip install /path/to/VMware-vSphere-Automation-SDK-Python/client/lib/vapi_common_client-2.5.0.zip</pre>
</p>
<h3>vapi_client_bindings</h3>
<p>
This library is needed for accessing features like Content Library and Tagging.
</p>
<pre>&gt; pip install /path/to/VMware-vSphere-Automation-SDK-Python/client/lib/vapi_client_bindings-2.5.0.zip</pre>
</p>
<h3>pyVmomi</h3>
<p>
This library is needed for accessing/manipulating vCenter Server managed objects using vSphere APIs;
For more information please refer to <a href="https://github.com/vmware/pyvmomi">vmware pyVmomi</a>
</p>
<pre>&gt; pip install pyvmomi</pre>
</p>
<strong>The following 3rd party python libraries are required to be installed for running the sample.</strong>
<ul>
<li>pyOpenSSL</li>
<li>lxml</li>
<li>suds (suds-jurko for python 3.x)</li>
</ul>
</p>
<a name="pyopenssl"></a>
<h3>pyOpenSSL</h3>
<p>
This requires python <strong>cryptography</strong> package to be installed as a pre-requisite.</br>
Please follow the detailed instruction from <a href="https://cryptography.io/en/latest/installation/">installing cryptography dev documentation</a></br>
VMware strongly recommends using openssl version <strong>1.0.1j</strong> or, higher. SDK and samples are tested against openssl version >= 1.0.1j.</br>
</br>
pyOpenSSL version 0.14 is needed for the SDK (vapi_runtime) and samples. For details on how to install the package please go to
<a href="https://pypi.python.org/pypi/pyOpenSSL/0.14">pypi.python.org/pypi/pyOpenSSL/0.14</a>.
</p>
<h3>lxml</h3>
<p>
Please follow detailed instructions from <a href="http://lxml.de/installation.html">Installing lxml</a>
<pre>&gt; pip install lxml</pre>
</p>
<h4>Notes for the Windows client</h4>
<strong>How to use MinGW's gcc compiler when installing python package using pip?</strong>
<ul>
<li>install MinGW with gcc Compiler option checked</li>
<li>add C:\MinGW\bin to your PATH</li>
<li><span style="line-height: 1.5em;">In </span><strong>PYTHONPATH\Lib\distutils</strong><span style="line-height: 1.5em;">, create a file </span><strong>distutils.cfg</strong><span style="line-height: 1.5em;"> and add these lines:</span></li>
<pre>[build]
compiler=mingw32
</pre>
</ul>
Here's an <strong>alternative</strong> method:
<ul>
<li>Download Libxml-python (Libxml-python are bindings for the libxml2 and libxslt libraries). Windows 64-bit installer for python 2.7 can be found <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">here</a></li>
<li>Run the installer to install libxml2 and libxslt</li>
<li>Download lxml 3.3.1 windows 64-bit installer for python 2.7. <a href="https://pypi.python.org/packages/2.7/l/lxml/lxml-3.3.1.win-amd64-py2.7.exe#md5=6233aa58eebaa857e1f2a6b2ea71a85c">link</a></li>
<li>Run the installer to install lxml</li>
</ul>
<h3>suds(suds-jurko)</h3>
<p>
This library is needed for lookup service queries; For more information please refer to <a href="https://fedorahosted.org/suds/wiki/Documentation">suds Documentation</a>
</p>
<pre>&gt; pip install suds</pre>
Use suds-jurko for python 3.x
<pre>&gt; pip install suds-jurko</pre>
</p>
<a name="runningsample"></a>
<h2>Running a sample</h2>
Please refer to <a href="samples/vSphere-Automation-Client-SDK-Python-Samples-README.html#vcentersample">running a vcenter sample</a> for detailed steps to run a vCenter sample. <br/>
Please refer to <a href="samples/vSphere-Automation-Client-SDK-Python-Samples-README.html#runningsample">running a workflow sample</a> for detailed steps to run a vCenter Single Sign-On, Content Library or Tagging sample.
<ul>
<li><strong>run_sample.sh</strong> is needed for running the samples in UNIX/mac OS X environment</li>
<li><strong>run_sample.bat</strong> is a windows bat file needed for running the samples in windows</li>
</ul>
</p>
<hr />
<table border="0" width="100%">
<tr>
<td>
<p class="Miniscule">Copyright &copy; 2015 VMware, Inc. All rights not expressly granted herein are reserved.</p>
</td>
<td align="right"><p class="Miniscule">Last updated: 23rd January 2015&nbsp;|&nbsp; VMware vSphere Automation Python SDK</p></td>
</tr>
</table>
</td></tr></table>
</body>
</html>