mirror of
https://github.com/vmware/vsphere-automation-sdk-python.git
synced 2024-11-26 19:29:58 -05:00
3867 lines
439 KiB
HTML
3867 lines
439 KiB
HTML
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>com.vmware.vcenter_client — vSphere Automation SDK for Python 6.5.0 documentation</title>
|
|
|
|
<link rel="stylesheet" href="../../../_static/vapitheme.css" type="text/css" />
|
|
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '../../../',
|
|
VERSION: '6.5.0',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
|
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
|
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
|
<link rel="top" title="vSphere Automation SDK for Python 6.5.0 documentation" href="../../../index.html" />
|
|
<link rel="up" title="Module code" href="../../index.html" />
|
|
</head>
|
|
<body>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../../genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="../../../py-modindex.html" title="Python Module Index"
|
|
>modules</a> |</li>
|
|
<li><a href="../../../index.html">vSphere Automation SDK for Python 6.5.0 documentation</a> »</li>
|
|
<li><a href="../../index.html" accesskey="U">Module code</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<h1>Source code for com.vmware.vcenter_client</h1><div class="highlight"><pre>
|
|
<span class="c"># -*- coding: utf-8 -*-</span>
|
|
<span class="c">#---------------------------------------------------------------------------</span>
|
|
<span class="c"># Copyright 2016 VMware, Inc. All rights reserved.</span>
|
|
|
|
<span class="c"># AUTO GENERATED FILE -- DO NOT MODIFY!</span>
|
|
<span class="c">#</span>
|
|
<span class="c"># vAPI stub file for package com.vmware.vcenter.</span>
|
|
<span class="c">#---------------------------------------------------------------------------</span>
|
|
|
|
<span class="sd">"""</span>
|
|
<span class="sd">The ``com.vmware.vcenter_client`` module provides classes for managing VMware</span>
|
|
<span class="sd">vSphere environments. The module is available starting in vSphere 6.5.</span>
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
<span class="n">__author__</span> <span class="o">=</span> <span class="s">'VMware, Inc.'</span>
|
|
<span class="n">__docformat__</span> <span class="o">=</span> <span class="s">'restructuredtext en'</span>
|
|
|
|
<span class="kn">import</span> <span class="nn">sys</span>
|
|
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings</span> <span class="kn">import</span> <span class="nb">type</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.converter</span> <span class="kn">import</span> <span class="n">TypeConverter</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.enum</span> <span class="kn">import</span> <span class="n">Enum</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.error</span> <span class="kn">import</span> <span class="n">VapiError</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.struct</span> <span class="kn">import</span> <span class="n">VapiStruct</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.stub</span> <span class="kn">import</span> <span class="n">VapiInterface</span><span class="p">,</span> <span class="n">ApiInterfaceStub</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.bindings.common</span> <span class="kn">import</span> <span class="n">raise_core_exception</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.data.validator</span> <span class="kn">import</span> <span class="n">UnionValidator</span><span class="p">,</span> <span class="n">HasFieldsOfValidator</span>
|
|
<span class="kn">from</span> <span class="nn">vmware.vapi.exception</span> <span class="kn">import</span> <span class="n">CoreException</span>
|
|
<span class="kn">import</span> <span class="nn">com.vmware.vapi.std.errors_client</span>
|
|
<span class="kn">import</span> <span class="nn">com.vmware.vcenter.vm_client</span>
|
|
<span class="kn">import</span> <span class="nn">com.vmware.vcenter.vm.hardware_client</span>
|
|
<span class="kn">import</span> <span class="nn">com.vmware.vcenter.vm.hardware.boot_client</span>
|
|
<span class="kn">import</span> <span class="nn">com.vmware.vcenter.vm.hardware.adapter_client</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Cluster"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster">[docs]</a><span class="k">class</span> <span class="nc">Cluster</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Cluster`` class provides methods to manage clusters in the vCenter</span>
|
|
<span class="sd"> Server.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"ClusterComputeResource"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter Cluster</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_ClusterStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Cluster.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Cluster.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing clusters (see :func:`Cluster.list`). If multiple</span>
|
|
<span class="sd"> attributes are specified, only clusters matching all of the attributes</span>
|
|
<span class="sd"> match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">clusters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type clusters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param clusters: Identifiers of clusters that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will contain identifiers for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> If None or empty, clusters with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that clusters must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Cluster.Info.name`).</span>
|
|
<span class="sd"> If None or empty, clusters with any name match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the cluster for the cluster to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, clusters in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the cluster for the cluster to match</span>
|
|
<span class="sd"> the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, clusters in any datacenter match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">clusters</span> <span class="o">=</span> <span class="n">clusters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.cluster.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'clusters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Cluster.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Cluster.Summary`` class contains commonly used information about a</span>
|
|
<span class="sd"> cluster in vCenter Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">cluster</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">ha_enabled</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">drs_enabled</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type cluster: :class:`str`</span>
|
|
<span class="sd"> :param cluster: Identifier of the cluster.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will be an identifier for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the cluster.</span>
|
|
<span class="sd"> :type ha_enabled: :class:`bool`</span>
|
|
<span class="sd"> :param ha_enabled: Flag indicating whether the vSphere HA feature is enabled for the</span>
|
|
<span class="sd"> cluster.</span>
|
|
<span class="sd"> :type drs_enabled: :class:`bool`</span>
|
|
<span class="sd"> :param drs_enabled: Flag indicating whether the vSphere DRS service is enabled for the</span>
|
|
<span class="sd"> cluster.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</span> <span class="o">=</span> <span class="n">cluster</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">ha_enabled</span> <span class="o">=</span> <span class="n">ha_enabled</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">drs_enabled</span> <span class="o">=</span> <span class="n">drs_enabled</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.cluster.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'cluster'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'ClusterComputeResource'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'ha_enabled'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">(),</span>
|
|
<span class="s">'drs_enabled'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">(),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Cluster.Info"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster.Info">[docs]</a> <span class="k">class</span> <span class="nc">Info</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Cluster.Info`` class contains information about a cluster in vCenter</span>
|
|
<span class="sd"> Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">resource_pool</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: The name of the cluster</span>
|
|
<span class="sd"> :type resource_pool: :class:`str`</span>
|
|
<span class="sd"> :param resource_pool: Identifier of the root resource pool of the cluster</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``ResourcePool``.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pool</span> <span class="o">=</span> <span class="n">resource_pool</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Info</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.cluster.info'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'resource_pool'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'ResourcePool'</span><span class="p">),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Info</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Cluster.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) clusters in vCenter matching the :class:`Cluster.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Cluster.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching clusters for which information should be</span>
|
|
<span class="sd"> returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a</span>
|
|
<span class="sd"> :class:`Cluster.FilterSpec` with all attributes None which means</span>
|
|
<span class="sd"> all clusters match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Cluster.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the clusters matching the</span>
|
|
<span class="sd"> :class:`Cluster.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 clusters match the :class:`Cluster.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Cluster.get"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Cluster.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">cluster</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Retrieves information about the cluster corresponding to ``cluster``.</span>
|
|
|
|
<span class="sd"> :type cluster: :class:`str`</span>
|
|
<span class="sd"> :param cluster: Identifier of the cluster.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``.</span>
|
|
<span class="sd"> :rtype: :class:`Cluster.Info`</span>
|
|
<span class="sd"> :return: The :class:`Cluster.Info` instances that corresponds to the</span>
|
|
<span class="sd"> ``cluster``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no cluster associated with ``cluster`` in the system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the session id is missing from the request or the corresponding</span>
|
|
<span class="sd"> session object cannot be found.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't not have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'get'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'cluster'</span><span class="p">:</span> <span class="n">cluster</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="Datacenter"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter">[docs]</a><span class="k">class</span> <span class="nc">Datacenter</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datacenter`` class provides methods to manage datacenters in the</span>
|
|
<span class="sd"> vCenter Server.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"Datacenter"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter Datacenter</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_DatacenterStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Datacenter.CreateSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.CreateSpec">[docs]</a> <span class="k">class</span> <span class="nc">CreateSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datacenter.CreateSpec`` class defines the information used to create</span>
|
|
<span class="sd"> a datacenter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: The name of the datacenter to be created.</span>
|
|
<span class="sd"> :type folder: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folder: Datacenter folder in which the new datacenter should be created.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> This attribute is currently required. In the future, if this</span>
|
|
<span class="sd"> attribute is None, the system will attempt to choose a suitable</span>
|
|
<span class="sd"> folder for the datacenter; if a folder cannot be chosen, the</span>
|
|
<span class="sd"> datacenter creation operation will fail.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folder</span> <span class="o">=</span> <span class="n">folder</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">CreateSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datacenter.create_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">CreateSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datacenter.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datacenter.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing datacenters (see :func:`Datacenter.list`). If multiple</span>
|
|
<span class="sd"> attributes are specified, only datacenters matching all of the attributes</span>
|
|
<span class="sd"> match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Identifiers of datacenters that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, datacenters with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that datacenters must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Datacenter.Info.name`).</span>
|
|
<span class="sd"> If None or empty, datacenters with any name match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the datacenters for the datacenter to</span>
|
|
<span class="sd"> match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, datacenters in any folder match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datacenter.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datacenter.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datacenter.Summary`` class contains commonly used information about a</span>
|
|
<span class="sd"> datacenter in vCenter Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datacenter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type datacenter: :class:`str`</span>
|
|
<span class="sd"> :param datacenter: Identifier of the datacenter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``Datacenter``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the datacenter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenter</span> <span class="o">=</span> <span class="n">datacenter</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datacenter.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datacenter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datacenter'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datacenter.Info"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.Info">[docs]</a> <span class="k">class</span> <span class="nc">Info</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datacenter.Info`` class contains information about a datacenter in</span>
|
|
<span class="sd"> vCenter Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datastore_folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">host_folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">network_folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">vm_folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: The name of the datacenter.</span>
|
|
<span class="sd"> :type datastore_folder: :class:`str`</span>
|
|
<span class="sd"> :param datastore_folder: The root datastore folder associated with the datacenter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> :type host_folder: :class:`str`</span>
|
|
<span class="sd"> :param host_folder: The root host and cluster folder associated with the datacenter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> :type network_folder: :class:`str`</span>
|
|
<span class="sd"> :param network_folder: The root network folder associated with the datacenter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> :type vm_folder: :class:`str`</span>
|
|
<span class="sd"> :param vm_folder: The root virtual machine folder associated with the datacenter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datastore_folder</span> <span class="o">=</span> <span class="n">datastore_folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">host_folder</span> <span class="o">=</span> <span class="n">host_folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">network_folder</span> <span class="o">=</span> <span class="n">network_folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">vm_folder</span> <span class="o">=</span> <span class="n">vm_folder</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Info</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datacenter.info'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'datastore_folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Folder'</span><span class="p">),</span>
|
|
<span class="s">'host_folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Folder'</span><span class="p">),</span>
|
|
<span class="s">'network_folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Folder'</span><span class="p">),</span>
|
|
<span class="s">'vm_folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Folder'</span><span class="p">),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Info</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Datacenter.create"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.create">[docs]</a> <span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Create a new datacenter in the vCenter inventory</span>
|
|
|
|
<span class="sd"> :type spec: :class:`Datacenter.CreateSpec`</span>
|
|
<span class="sd"> :param spec: Specification for the new datacenter to be created.</span>
|
|
<span class="sd"> :rtype: :class:`str`</span>
|
|
<span class="sd"> :return: The identifier of the newly created datacenter</span>
|
|
<span class="sd"> The return value will be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` </span>
|
|
<span class="sd"> if the datacenter with the same name is already present.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the datacenter name is empty or invalid as per the underlying</span>
|
|
<span class="sd"> implementation.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the folder is not specified and the system cannot choose a</span>
|
|
<span class="sd"> suitable one.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if the datacenter folder cannot be found.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'create'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Datacenter.delete"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.delete">[docs]</a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datacenter</span><span class="p">,</span>
|
|
<span class="n">force</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Delete an empty datacenter from the vCenter Server</span>
|
|
|
|
<span class="sd"> :type datacenter: :class:`str`</span>
|
|
<span class="sd"> :param datacenter: Identifier of the datacenter to be deleted.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``.</span>
|
|
<span class="sd"> :type force: :class:`bool` or ``None``</span>
|
|
<span class="sd"> :param force: If true, delete the datacenter even if it is not empty.</span>
|
|
<span class="sd"> If None a :class:`com.vmware.vapi.std.errors_client.ResourceInUse`</span>
|
|
<span class="sd"> exception will be reported if the datacenter is not empty. This is</span>
|
|
<span class="sd"> the equivalent of passing the value false.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no datacenter associated with ``datacenter`` in the</span>
|
|
<span class="sd"> system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse` </span>
|
|
<span class="sd"> if the datacenter associated with ``datacenter`` is not empty.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'delete'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'datacenter'</span><span class="p">:</span> <span class="n">datacenter</span><span class="p">,</span>
|
|
<span class="s">'force'</span><span class="p">:</span> <span class="n">force</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Datacenter.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) datacenters in vCenter matching the</span>
|
|
<span class="sd"> :class:`Datacenter.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Datacenter.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching datacenters for which information should</span>
|
|
<span class="sd"> be returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a</span>
|
|
<span class="sd"> :class:`Datacenter.FilterSpec` with all attributes None which means</span>
|
|
<span class="sd"> all datacenters match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Datacenter.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the datacenters matching the</span>
|
|
<span class="sd"> :class:`Datacenter.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 datacenters match the</span>
|
|
<span class="sd"> :class:`Datacenter.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Datacenter.get"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datacenter.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datacenter</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Retrieves information about the datacenter corresponding to</span>
|
|
<span class="sd"> ``datacenter``.</span>
|
|
|
|
<span class="sd"> :type datacenter: :class:`str`</span>
|
|
<span class="sd"> :param datacenter: Identifier of the datacenter.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``.</span>
|
|
<span class="sd"> :rtype: :class:`Datacenter.Info`</span>
|
|
<span class="sd"> :return: The :class:`Datacenter.Info` instances that corresponds to the</span>
|
|
<span class="sd"> ``datacenter``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no datacenter associated with ``datacenter`` in the</span>
|
|
<span class="sd"> system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'get'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'datacenter'</span><span class="p">:</span> <span class="n">datacenter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="Datastore"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore">[docs]</a><span class="k">class</span> <span class="nc">Datastore</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The Datastore class provides methods for manipulating a datastore.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"Datastore"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter datastore</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_DatastoreStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Datastore.Type"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.Type">[docs]</a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datastore.Type`` class defines the supported types of vCenter</span>
|
|
<span class="sd"> datastores.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VMFS</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> VMware File System (ESX Server only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">NFS</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Network file system v3 (linux & esx servers only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">NFS41</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Network file system v4.1 (linux & esx servers only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">CIFS</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Common Internet File System.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">VSAN</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Virtual SAN (ESX Server only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">VFFS</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Flash Read Cache (ESX Server only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">VVOL</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> vSphere Virtual Volume (ESX Server only).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`Type` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'VMFS'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'NFS'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'NFS41'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'CIFS'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'VSAN'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'VFFS'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'VVOL'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datastore.type'</span><span class="p">,</span>
|
|
<span class="n">Type</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datastore.Info"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.Info">[docs]</a> <span class="k">class</span> <span class="nc">Info</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datastore.Info`` class contains information about a datastore.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">accessible</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">free_space</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">multiple_host_access</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">thin_provisioning_supported</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the datastore.</span>
|
|
<span class="sd"> :type type: :class:`Datastore.Type`</span>
|
|
<span class="sd"> :param type: Type (VMFS, NFS, NFS41, CIFS, VSAN, VFFS, VVOL) of the datastore.</span>
|
|
<span class="sd"> :type accessible: :class:`bool`</span>
|
|
<span class="sd"> :param accessible: Whether or not this datastore is accessible.</span>
|
|
<span class="sd"> :type free_space: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param free_space: Available space of this datastore, in bytes. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> The server periodically updates this value.</span>
|
|
<span class="sd"> This attribute will be None if the available space of this</span>
|
|
<span class="sd"> datastore is not known.</span>
|
|
<span class="sd"> :type multiple_host_access: :class:`bool`</span>
|
|
<span class="sd"> :param multiple_host_access: Whether or not ore than one host in the datacenter has been</span>
|
|
<span class="sd"> configured with access to the datastore.</span>
|
|
<span class="sd"> :type thin_provisioning_supported: :class:`bool`</span>
|
|
<span class="sd"> :param thin_provisioning_supported: Whether or not the datastore supports thin provisioning on a per</span>
|
|
<span class="sd"> file basis. When thin provisioning is used, backing storage is</span>
|
|
<span class="sd"> lazily allocated.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">accessible</span> <span class="o">=</span> <span class="n">accessible</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">free_space</span> <span class="o">=</span> <span class="n">free_space</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">multiple_host_access</span> <span class="o">=</span> <span class="n">multiple_host_access</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">thin_provisioning_supported</span> <span class="o">=</span> <span class="n">thin_provisioning_supported</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Info</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datastore.info'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.Type'</span><span class="p">),</span>
|
|
<span class="s">'accessible'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">(),</span>
|
|
<span class="s">'free_space'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="s">'multiple_host_access'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">(),</span>
|
|
<span class="s">'thin_provisioning_supported'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">(),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Info</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datastore.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datastore.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing datastores (see :func:`Datastore.list`). If multiple</span>
|
|
<span class="sd"> attributes are specified, only datastores matching all of the attributes</span>
|
|
<span class="sd"> match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datastores</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">types</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type datastores: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datastores: Identifiers of datastores that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datastore``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datastore``.</span>
|
|
<span class="sd"> If None or empty, datastores with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that datastores must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Datastore.Info.name`).</span>
|
|
<span class="sd"> If None or empty, datastores with any name match the filter.</span>
|
|
<span class="sd"> :type types: :class:`set` of :class:`Datastore.Type` or ``None``</span>
|
|
<span class="sd"> :param types: Types that datastores must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Datastore.Summary.type`).</span>
|
|
<span class="sd"> If None or empty, datastores with any type match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the datastore for the datastore to match</span>
|
|
<span class="sd"> the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, datastores in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the datastore for the datastore to</span>
|
|
<span class="sd"> match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, datastores in any datacenter match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datastores</span> <span class="o">=</span> <span class="n">datastores</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">types</span> <span class="o">=</span> <span class="n">types</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datastore.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datastores'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'types'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.Type'</span><span class="p">))),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Datastore.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Datastore.Summary`` class contains commonly used information about a</span>
|
|
<span class="sd"> datastore.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datastore</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">free_space</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">capacity</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type datastore: :class:`str`</span>
|
|
<span class="sd"> :param datastore: Identifier of the datastore.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datastore``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``Datastore``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the datastore.</span>
|
|
<span class="sd"> :type type: :class:`Datastore.Type`</span>
|
|
<span class="sd"> :param type: Type (VMFS, NFS, NFS41, CIFS, VSAN, VFFS, VVOL) of the datatore.</span>
|
|
<span class="sd"> :type free_space: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param free_space: Available space of this datastore, in bytes. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> The server periodically updates this value.</span>
|
|
<span class="sd"> This attribute will be None if the available space of this</span>
|
|
<span class="sd"> datastore is not known.</span>
|
|
<span class="sd"> :type capacity: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param capacity: Capacity of this datastore, in bytes. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> The server periodically updates this value.</span>
|
|
<span class="sd"> This attribute will be None if the capacity of this datastore is</span>
|
|
<span class="sd"> not known.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datastore</span> <span class="o">=</span> <span class="n">datastore</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">free_space</span> <span class="o">=</span> <span class="n">free_space</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">capacity</span> <span class="o">=</span> <span class="n">capacity</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.datastore.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datastore'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datastore'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.Type'</span><span class="p">),</span>
|
|
<span class="s">'free_space'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="s">'capacity'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Datastore.get"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">datastore</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Retrieves information about the datastore indicated by ``datastore``.</span>
|
|
|
|
<span class="sd"> :type datastore: :class:`str`</span>
|
|
<span class="sd"> :param datastore: Identifier of the datastore for which information should be</span>
|
|
<span class="sd"> retrieved.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datastore``.</span>
|
|
<span class="sd"> :rtype: :class:`Datastore.Info`</span>
|
|
<span class="sd"> :return: information about the datastore.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if the datastore indicated by ``datastore`` does not exist.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'get'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'datastore'</span><span class="p">:</span> <span class="n">datastore</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Datastore.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Datastore.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) datastores in vCenter matching the</span>
|
|
<span class="sd"> :class:`Datastore.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Datastore.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching datastores for which information should</span>
|
|
<span class="sd"> be returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a</span>
|
|
<span class="sd"> :class:`Datastore.FilterSpec` with all attributes None which means</span>
|
|
<span class="sd"> all datastores match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Datastore.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the datastores matching the</span>
|
|
<span class="sd"> :class:`Datastore.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`Datastore.FilterSpec.types` attribute contains a</span>
|
|
<span class="sd"> value that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`Datastore.FilterSpec.types` attribute contains a</span>
|
|
<span class="sd"> value that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 datastores match the</span>
|
|
<span class="sd"> :class:`Datastore.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="Folder"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Folder">[docs]</a><span class="k">class</span> <span class="nc">Folder</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The Folder class provides methods for manipulating a vCenter Server folder.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"Folder"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter folder</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_FolderStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Folder.Type"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Folder.Type">[docs]</a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Folder.Type`` class defines the type of a vCenter Server folder. The</span>
|
|
<span class="sd"> type of a folder determines what what kinds of children can be contained in</span>
|
|
<span class="sd"> the folder.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">DATACENTER</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A folder that can contain datacenters.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">DATASTORE</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A folder that can contain datastores.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">HOST</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A folder that can contain compute resources (hosts and clusters).</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">NETWORK</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A folder that can contain networkds.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">VIRTUAL_MACHINE</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A folder that can contain virtual machines.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`Type` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'DATACENTER'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'DATASTORE'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'HOST'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'NETWORK'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'VIRTUAL_MACHINE'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.folder.type'</span><span class="p">,</span>
|
|
<span class="n">Type</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Folder.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Folder.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Folder.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing folders (see :func:`Folder.list`). If multiple</span>
|
|
<span class="sd"> attributes are specified, only folders matching all of the attributes match</span>
|
|
<span class="sd"> the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">parent_folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Identifiers of folders that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, folders with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that folders must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Folder.Summary.name`).</span>
|
|
<span class="sd"> If None or empty, folders with any name match the filter.</span>
|
|
<span class="sd"> :type type: :class:`Folder.Type` or ``None``</span>
|
|
<span class="sd"> :param type: Type that folders must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Folder.Summary.type`).</span>
|
|
<span class="sd"> If None, folders with any type match the filter.</span>
|
|
<span class="sd"> :type parent_folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param parent_folders: Folders that must contain the folder for the folder to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, folder in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the folder for the folder to match</span>
|
|
<span class="sd"> the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, folder in any datacenter match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">parent_folders</span> <span class="o">=</span> <span class="n">parent_folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.folder.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Folder.Type'</span><span class="p">)),</span>
|
|
<span class="s">'parent_folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Folder.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Folder.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Folder.Summary`` class contains commonly used information about a</span>
|
|
<span class="sd"> folder.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type folder: :class:`str`</span>
|
|
<span class="sd"> :param folder: Identifier of the folder.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the vCenter Server folder.</span>
|
|
<span class="sd"> :type type: :class:`Folder.Type`</span>
|
|
<span class="sd"> :param type: Type (DATACENTER, DATASTORE, HOST, NETWORK, VIRTUAL_MACHINE) of the</span>
|
|
<span class="sd"> vCenter Server folder.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folder</span> <span class="o">=</span> <span class="n">folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.folder.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Folder'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Folder.Type'</span><span class="p">),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Folder.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Folder.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) folders in vCenter matching the :class:`Folder.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Folder.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching folders for which information should be</span>
|
|
<span class="sd"> returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a :class:`Folder.FilterSpec`</span>
|
|
<span class="sd"> with all attributes None which means all folders match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Folder.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the folders matching the</span>
|
|
<span class="sd"> :class:`Folder.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`Folder.FilterSpec.type` attribute contains a value</span>
|
|
<span class="sd"> that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 folders match the :class:`Folder.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="Host"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host">[docs]</a><span class="k">class</span> <span class="nc">Host</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host`` class provides methods to manage hosts in the vCenter Server.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"HostSystem"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter Host.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_HostStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Host.ConnectionState"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.ConnectionState">[docs]</a> <span class="k">class</span> <span class="nc">ConnectionState</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.ConnectionState`` class defines the connection status of a host.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">CONNECTED</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Host is connected to the vCenter Server</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">DISCONNECTED</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Host is disconnected from the vCenter Server</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">NOT_RESPONDING</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> VirtualCenter is not receiving heartbeats from the server. The state</span>
|
|
<span class="sd"> automatically changes to connected once heartbeats are received again.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`ConnectionState` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">ConnectionState</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">ConnectionState</span><span class="p">(</span><span class="s">'CONNECTED'</span><span class="p">),</span>
|
|
<span class="n">ConnectionState</span><span class="p">(</span><span class="s">'DISCONNECTED'</span><span class="p">),</span>
|
|
<span class="n">ConnectionState</span><span class="p">(</span><span class="s">'NOT_RESPONDING'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">ConnectionState</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.connection_state'</span><span class="p">,</span>
|
|
<span class="n">ConnectionState</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Host.PowerState"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.PowerState">[docs]</a> <span class="k">class</span> <span class="nc">PowerState</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.PowerState`` class defines the power states of a host.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">POWERED_ON</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The host is powered on. A host that is entering standby mode is also in</span>
|
|
<span class="sd"> this state.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">POWERED_OFF</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The host was specifically powered off by the user through vCenter server.</span>
|
|
<span class="sd"> This state is not a cetain state, because after vCenter server issues the</span>
|
|
<span class="sd"> command to power off the host, the host might crash, or kill all the</span>
|
|
<span class="sd"> processes but fail to power off.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">STANDBY</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The host was specifically put in standby mode, either explicitly by the</span>
|
|
<span class="sd"> user, or automatically by DPM. This state is not a cetain state, because</span>
|
|
<span class="sd"> after VirtualCenter issues the command to put the host in standby state,</span>
|
|
<span class="sd"> the host might crash, or kill all the processes but fail to enter standby</span>
|
|
<span class="sd"> mode. A host that is exiting standby mode is also in this state.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`PowerState` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">PowerState</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">PowerState</span><span class="p">(</span><span class="s">'POWERED_ON'</span><span class="p">),</span>
|
|
<span class="n">PowerState</span><span class="p">(</span><span class="s">'POWERED_OFF'</span><span class="p">),</span>
|
|
<span class="n">PowerState</span><span class="p">(</span><span class="s">'STANDBY'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">PowerState</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.power_state'</span><span class="p">,</span>
|
|
<span class="n">PowerState</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Host.CreateSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.CreateSpec">[docs]</a> <span class="k">class</span> <span class="nc">CreateSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.CreateSpec`` class defines the information used to create a</span>
|
|
<span class="sd"> host.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="n">_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="n">UnionValidator</span><span class="p">(</span>
|
|
<span class="s">'thumbprint_verification'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'THUMBPRINT'</span> <span class="p">:</span> <span class="p">[(</span><span class="s">'thumbprint'</span><span class="p">,</span> <span class="bp">True</span><span class="p">)],</span>
|
|
<span class="s">'NONE'</span> <span class="p">:</span> <span class="p">[],</span>
|
|
<span class="p">}</span>
|
|
<span class="p">),</span>
|
|
<span class="p">]</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">hostname</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">port</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">user_name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">password</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">thumbprint_verification</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">thumbprint</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">force_add</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type hostname: :class:`str`</span>
|
|
<span class="sd"> :param hostname: The IP address or DNS resolvable name of the host.</span>
|
|
<span class="sd"> :type port: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param port: The port of the host.</span>
|
|
<span class="sd"> If None, port 443 will be used.</span>
|
|
<span class="sd"> :type user_name: :class:`str`</span>
|
|
<span class="sd"> :param user_name: The administrator account on the host.</span>
|
|
<span class="sd"> :type password: :class:`str`</span>
|
|
<span class="sd"> :param password: The password for the administrator account on the host.</span>
|
|
<span class="sd"> :type folder: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folder: Host and cluster folder in which the new standalone host should be</span>
|
|
<span class="sd"> created.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> This attribute is currently required. In the future, if this</span>
|
|
<span class="sd"> attribute is None, the system will attempt to choose a suitable</span>
|
|
<span class="sd"> folder for the host; if a folder cannot be chosen, the host</span>
|
|
<span class="sd"> creation operation will fail.</span>
|
|
<span class="sd"> :type thumbprint_verification: :class:`Host.CreateSpec.ThumbprintVerification`</span>
|
|
<span class="sd"> :param thumbprint_verification: Type of host's SSL certificate verification to be done.</span>
|
|
<span class="sd"> :type thumbprint: :class:`str`</span>
|
|
<span class="sd"> :param thumbprint: The thumbprint of the SSL certificate, which the host is expected</span>
|
|
<span class="sd"> to have. The thumbprint is always computed using the SHA1 hash and</span>
|
|
<span class="sd"> is the string representation of that hash in the format:</span>
|
|
<span class="sd"> xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx where,</span>
|
|
<span class="sd"> 'x' represents a hexadecimal digit.</span>
|
|
<span class="sd"> This attribute is optional and it is only relevant when the value</span>
|
|
<span class="sd"> of ``thumbprintVerification`` is</span>
|
|
<span class="sd"> :attr:`Host.CreateSpec.ThumbprintVerification.THUMBPRINT`.</span>
|
|
<span class="sd"> :type force_add: :class:`bool` or ``None``</span>
|
|
<span class="sd"> :param force_add: Whether host should be added to the vCenter Server even if it is</span>
|
|
<span class="sd"> being managed by another vCenter Server. The original vCenterServer</span>
|
|
<span class="sd"> loses connection to the host.</span>
|
|
<span class="sd"> If None, forceAdd is default to false.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hostname</span> <span class="o">=</span> <span class="n">hostname</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">port</span> <span class="o">=</span> <span class="n">port</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">user_name</span> <span class="o">=</span> <span class="n">user_name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">password</span> <span class="o">=</span> <span class="n">password</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folder</span> <span class="o">=</span> <span class="n">folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">thumbprint_verification</span> <span class="o">=</span> <span class="n">thumbprint_verification</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">thumbprint</span> <span class="o">=</span> <span class="n">thumbprint</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">force_add</span> <span class="o">=</span> <span class="n">force_add</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Host.CreateSpec.ThumbprintVerification"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.CreateSpec.ThumbprintVerification">[docs]</a> <span class="k">class</span> <span class="nc">ThumbprintVerification</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.CreateSpec.ThumbprintVerification`` class defines the thumbprint</span>
|
|
<span class="sd"> verification schemes for a host's SSL certificate.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">NONE</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Accept the host's thumbprint without verifying it.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">THUMBPRINT</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Host's SSL certificate verified by checking its thumbprint against the</span>
|
|
<span class="sd"> specified thumbprint.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`ThumbprintVerification` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">ThumbprintVerification</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">ThumbprintVerification</span><span class="p">(</span><span class="s">'NONE'</span><span class="p">),</span>
|
|
<span class="n">ThumbprintVerification</span><span class="p">(</span><span class="s">'THUMBPRINT'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">ThumbprintVerification</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.create_spec.thumbprint_verification'</span><span class="p">,</span>
|
|
<span class="n">ThumbprintVerification</span><span class="p">))</span>
|
|
</div>
|
|
<span class="n">CreateSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.create_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'hostname'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'port'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="s">'user_name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'password'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">SecretType</span><span class="p">(),</span>
|
|
<span class="s">'folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="s">'thumbprint_verification'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.CreateSpec.ThumbprintVerification'</span><span class="p">),</span>
|
|
<span class="s">'thumbprint'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">()),</span>
|
|
<span class="s">'force_add'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">CreateSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Host.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing hosts (see :func:`Host.list`). If multiple attributes</span>
|
|
<span class="sd"> are specified, only hosts matching all of the attributes match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">hosts</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">standalone</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">clusters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">connection_states</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type hosts: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param hosts: Identifiers of hosts that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``HostSystem``.</span>
|
|
<span class="sd"> If None or empty, hosts with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that hosts must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Host.Summary.name`).</span>
|
|
<span class="sd"> If None or empty, hosts with any name match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the hosts for the hosts to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, hosts in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the hosts for the hosts to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, hosts in any datacenter match the filter.</span>
|
|
<span class="sd"> :type standalone: :class:`bool` or ``None``</span>
|
|
<span class="sd"> :param standalone: If true, only hosts that are not part of a cluster can match the</span>
|
|
<span class="sd"> filter, and if false, only hosts that are are part of a cluster can</span>
|
|
<span class="sd"> match the filter.</span>
|
|
<span class="sd"> If None Hosts can match filter independent of whether they are part</span>
|
|
<span class="sd"> of a cluster or not. If this field is true and</span>
|
|
<span class="sd"> :attr:`Host.FilterSpec.clusters` os not empty, no hosts will match</span>
|
|
<span class="sd"> the filter.</span>
|
|
<span class="sd"> :type clusters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param clusters: Clusters that must contain the hosts for the hosts to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will contain identifiers for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> If None or empty, hosts in any cluster and hosts that are not in a</span>
|
|
<span class="sd"> cluster match the filter. If this attribute is not empty and</span>
|
|
<span class="sd"> :attr:`Host.FilterSpec.standalone` is true, no hosts will match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type connection_states: :class:`set` of :class:`Host.ConnectionState` or ``None``</span>
|
|
<span class="sd"> :param connection_states: Connection states that a host must be in to match the filter (see</span>
|
|
<span class="sd"> :attr:`Host.Summary.connection_state`.</span>
|
|
<span class="sd"> If None or empty, hosts in any connection state match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hosts</span> <span class="o">=</span> <span class="n">hosts</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">standalone</span> <span class="o">=</span> <span class="n">standalone</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">clusters</span> <span class="o">=</span> <span class="n">clusters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">connection_states</span> <span class="o">=</span> <span class="n">connection_states</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'hosts'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'standalone'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">()),</span>
|
|
<span class="s">'clusters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'connection_states'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.ConnectionState'</span><span class="p">))),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Host.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Host.Summary`` class contains commonly used information about a host</span>
|
|
<span class="sd"> in vCenter Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="n">_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="n">UnionValidator</span><span class="p">(</span>
|
|
<span class="s">'connection_state'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'CONNECTED'</span> <span class="p">:</span> <span class="p">[(</span><span class="s">'power_state'</span><span class="p">,</span> <span class="bp">True</span><span class="p">)],</span>
|
|
<span class="s">'DISCONNECTED'</span> <span class="p">:</span> <span class="p">[],</span>
|
|
<span class="s">'NOT_RESPONDING'</span> <span class="p">:</span> <span class="p">[],</span>
|
|
<span class="p">}</span>
|
|
<span class="p">),</span>
|
|
<span class="p">]</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">host</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">connection_state</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">power_state</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type host: :class:`str`</span>
|
|
<span class="sd"> :param host: Identifier of the host.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``HostSystem``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the host.</span>
|
|
<span class="sd"> :type connection_state: :class:`Host.ConnectionState`</span>
|
|
<span class="sd"> :param connection_state: Connection status of the host</span>
|
|
<span class="sd"> :type power_state: :class:`Host.PowerState`</span>
|
|
<span class="sd"> :param power_state: Power state of the host</span>
|
|
<span class="sd"> This attribute is optional and it is only relevant when the value</span>
|
|
<span class="sd"> of ``connectionState`` is :attr:`Host.ConnectionState.CONNECTED`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">host</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">connection_state</span> <span class="o">=</span> <span class="n">connection_state</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">power_state</span> <span class="o">=</span> <span class="n">power_state</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.host.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'HostSystem'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'connection_state'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.ConnectionState'</span><span class="p">),</span>
|
|
<span class="s">'power_state'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.PowerState'</span><span class="p">)),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Host.create"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.create">[docs]</a> <span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Add a new standalone host in the vCenter inventory. The newly connected</span>
|
|
<span class="sd"> host will be in connected state. The vCenter Server will verify the SSL</span>
|
|
<span class="sd"> certificate before adding the host to its inventory. In the case where</span>
|
|
<span class="sd"> the SSL certificate cannot be verified because the Certificate</span>
|
|
<span class="sd"> Authority is not recognized or the certificate is self signed, the</span>
|
|
<span class="sd"> vCenter Server will fall back to thumbprint verification mode as</span>
|
|
<span class="sd"> defined by :class:`Host.CreateSpec.ThumbprintVerification`.</span>
|
|
|
|
<span class="sd"> :type spec: :class:`Host.CreateSpec`</span>
|
|
<span class="sd"> :param spec: Specification for the new host to be created.</span>
|
|
<span class="sd"> :rtype: :class:`str`</span>
|
|
<span class="sd"> :return: The newly created identifier of the host in vCenter.</span>
|
|
<span class="sd"> The return value will be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` </span>
|
|
<span class="sd"> if the host with the same name is already present.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if installation of VirtualCenter agent on a host fails.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the host name is invalid.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the host folder is invalid.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the SSL thumbprint specified is invalid.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidElementType` </span>
|
|
<span class="sd"> if the host folder id does not support vSphere compute resource as</span>
|
|
<span class="sd"> its children type.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse` </span>
|
|
<span class="sd"> if the host is already being managed by another vCenter Server</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if there are not enough licenses to add the host.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user name or password for the administration account on the</span>
|
|
<span class="sd"> host are invalid.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` </span>
|
|
<span class="sd"> if the software version on the host is not supported.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'create'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Host.delete"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.delete">[docs]</a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">host</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Remove a standalone host from the vCenter Server.</span>
|
|
|
|
<span class="sd"> :type host: :class:`str`</span>
|
|
<span class="sd"> :param host: Identifier of the host to be deleted.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no host associated with ``host`` in the system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse` </span>
|
|
<span class="sd"> if the host associated with ``host`` is in a vCenter cluster</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'delete'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="n">host</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Host.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) hosts in vCenter matching the :class:`Host.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Host.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching hosts for which information should be</span>
|
|
<span class="sd"> returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a :class:`Host.FilterSpec`</span>
|
|
<span class="sd"> with all attributes None which means all hosts match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Host.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the hosts matching the</span>
|
|
<span class="sd"> :class:`Host.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`Host.FilterSpec.connection_states` attribute contains</span>
|
|
<span class="sd"> a value that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 hosts match the :class:`Host.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Host.connect"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.connect">[docs]</a> <span class="k">def</span> <span class="nf">connect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">host</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Connect to the host corresponding to ``host`` previously added to the</span>
|
|
<span class="sd"> vCenter server.</span>
|
|
|
|
<span class="sd"> :type host: :class:`str`</span>
|
|
<span class="sd"> :param host: Identifier of the host to be reconnected.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyInDesiredState` </span>
|
|
<span class="sd"> if the host associated with ``host`` is already connected.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no host associated with ``host`` in the system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'connect'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="n">host</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="Host.disconnect"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Host.disconnect">[docs]</a> <span class="k">def</span> <span class="nf">disconnect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">host</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Disconnect the host corresponding to ``host`` from the vCenter server</span>
|
|
|
|
<span class="sd"> :type host: :class:`str`</span>
|
|
<span class="sd"> :param host: Identifier of the host to be disconnected.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyInDesiredState` </span>
|
|
<span class="sd"> if the host associated with ``host`` is already disconnected.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if there is no host associated with ``host`` in the system.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'disconnect'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="n">host</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="Network"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Network">[docs]</a><span class="k">class</span> <span class="nc">Network</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The Network class provides methods for manipulating a vCenter Server</span>
|
|
<span class="sd"> network.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"Network"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter network</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_NetworkStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="Network.Type"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Network.Type">[docs]</a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Network.Type`` class defines the type of a vCenter Server network.</span>
|
|
<span class="sd"> The type of a network can be used to determine what features it supports</span>
|
|
<span class="sd"> and which APIs can be used to find more information about the network or</span>
|
|
<span class="sd"> change its configuration.</span>
|
|
|
|
<span class="sd"> .. note::</span>
|
|
<span class="sd"> This class represents an enumerated type in the interface language</span>
|
|
<span class="sd"> definition. The class contains class attributes which represent the</span>
|
|
<span class="sd"> values in the current version of the enumerated type. Newer versions of</span>
|
|
<span class="sd"> the enumerated type may contain new values. To use new values of the</span>
|
|
<span class="sd"> enumerated type in communication with a server that supports the newer</span>
|
|
<span class="sd"> version of the API, you instantiate this class. See :ref:`enumerated</span>
|
|
<span class="sd"> type description page <enumeration_description>`.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">STANDARD_PORTGROUP</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> XXX: ESX based (created and managed on ESX)</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">DISTRIBUTED_PORTGROUP</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> XXX: vCenter based (create and managed through vCenter)</span>
|
|
|
|
<span class="sd"> """</span>
|
|
<span class="n">OPAQUE_NETWORK</span> <span class="o">=</span> <span class="bp">None</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> A network for whose configuration is managed outside of vSphere. The</span>
|
|
<span class="sd"> identifer and name of the network is made available through vSphere so that</span>
|
|
<span class="sd"> host and virtual machine virtual ethernet devices can connect to them.</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type string: :class:`str`</span>
|
|
<span class="sd"> :param string: String value for the :class:`Type` instance.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">Enum</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_values</span><span class="p">([</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'STANDARD_PORTGROUP'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'DISTRIBUTED_PORTGROUP'</span><span class="p">),</span>
|
|
<span class="n">Type</span><span class="p">(</span><span class="s">'OPAQUE_NETWORK'</span><span class="p">),</span>
|
|
<span class="p">])</span>
|
|
<span class="n">Type</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">EnumType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.network.type'</span><span class="p">,</span>
|
|
<span class="n">Type</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Network.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Network.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Network.FilterSpec`` class contains attributes used to filter the</span>
|
|
<span class="sd"> results when listing networks (see :func:`Network.list`). If multiple</span>
|
|
<span class="sd"> attributes are specified, only networks matching all of the attributes</span>
|
|
<span class="sd"> match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">networks</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">types</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type networks: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param networks: Identifiers of networks that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Network``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Network``.</span>
|
|
<span class="sd"> If None or empty, networks with any identifier match the filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that networks must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Network.Summary.name`).</span>
|
|
<span class="sd"> If None or empty, networks with any name match the filter.</span>
|
|
<span class="sd"> :type types: :class:`set` of :class:`Network.Type` or ``None``</span>
|
|
<span class="sd"> :param types: Types that networks must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`Network.Summary.type`).</span>
|
|
<span class="sd"> If None, networks with any type match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the network for the network to match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, networks in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the network for the network to match</span>
|
|
<span class="sd"> the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, networks in any datacenter match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">networks</span> <span class="o">=</span> <span class="n">networks</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">types</span> <span class="o">=</span> <span class="n">types</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.network.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'networks'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'types'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Network.Type'</span><span class="p">))),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="Network.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Network.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``Network.Summary`` class contains commonly used information about a</span>
|
|
<span class="sd"> network.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">network</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type network: :class:`str`</span>
|
|
<span class="sd"> :param network: Identifier of the network.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Network``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Network``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the network.</span>
|
|
<span class="sd"> :type type: :class:`Network.Type`</span>
|
|
<span class="sd"> :param type: Type (STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, OPAQUE_NETWORK) of</span>
|
|
<span class="sd"> the vCenter Server network.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">network</span> <span class="o">=</span> <span class="n">network</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.network.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'network'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Network'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Network.Type'</span><span class="p">),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Network.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.Network.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) networks in vCenter matching the :class:`Network.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`Network.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching networks for which information should be</span>
|
|
<span class="sd"> returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a</span>
|
|
<span class="sd"> :class:`Network.FilterSpec` with all attributes None which means</span>
|
|
<span class="sd"> all networks match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`Network.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the networks matching the</span>
|
|
<span class="sd"> :class:`Network.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`Network.FilterSpec.types` attribute contains a value</span>
|
|
<span class="sd"> that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 networks match the :class:`Network.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="ResourcePool"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool">[docs]</a><span class="k">class</span> <span class="nc">ResourcePool</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ResourcePool class provides methods for manipulating a vCenter Server</span>
|
|
<span class="sd"> resource pool. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> This class does not include virtual appliances in the inventory of resource</span>
|
|
<span class="sd"> pools even though part of the behavior of a virtual appliance is to act</span>
|
|
<span class="sd"> like a resource pool.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">RESOURCE_TYPE</span> <span class="o">=</span> <span class="s">"ResourcePool"</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The resource type for the vCenter resource pool</span>
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_ResourcePoolStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="ResourcePool.Info"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool.Info">[docs]</a> <span class="k">class</span> <span class="nc">Info</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``ResourcePool.Info`` class contains information about a resource pool.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">resource_pools</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the vCenter Server resource pool.</span>
|
|
<span class="sd"> :type resource_pools: :class:`set` of :class:`str`</span>
|
|
<span class="sd"> :param resource_pools: Identifiers of the child resource pools contained in this resource</span>
|
|
<span class="sd"> pool.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``ResourcePool``.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pools</span> <span class="o">=</span> <span class="n">resource_pools</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Info</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.resource_pool.info'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'resource_pools'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Info</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="ResourcePool.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``ResourcePool.FilterSpec`` class contains attributes used to filter</span>
|
|
<span class="sd"> the results when listing resource pools (see :func:`ResourcePool.list`). If</span>
|
|
<span class="sd"> multiple attributes are specified, only resource pools matching all of the</span>
|
|
<span class="sd"> attributes match the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">resource_pools</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">parent_resource_pools</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">hosts</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">clusters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type resource_pools: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param resource_pools: Identifiers of resource pools that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``ResourcePool``.</span>
|
|
<span class="sd"> If None or empty, resource pools with any identifier match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that resource pools must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`ResourcePool.Info.name`).</span>
|
|
<span class="sd"> If None or empty, resource pools with any name match the filter.</span>
|
|
<span class="sd"> :type parent_resource_pools: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param parent_resource_pools: Resource pools that must contain the resource pool for the resource</span>
|
|
<span class="sd"> pool to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``ResourcePool``.</span>
|
|
<span class="sd"> If None or empty, resource pools in any resource pool match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the resource pool for the resource</span>
|
|
<span class="sd"> pool to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, resource pools in any datacenter match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type hosts: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param hosts: Hosts that must contain the resource pool for the resource pool to</span>
|
|
<span class="sd"> match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``HostSystem``.</span>
|
|
<span class="sd"> If None or empty, resource pools in any host match the filter.</span>
|
|
<span class="sd"> :type clusters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param clusters: Clusters that must contain the resource pool for the resource pool</span>
|
|
<span class="sd"> to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will contain identifiers for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> If None or empty, resource pools in any cluster match the filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pools</span> <span class="o">=</span> <span class="n">resource_pools</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">parent_resource_pools</span> <span class="o">=</span> <span class="n">parent_resource_pools</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hosts</span> <span class="o">=</span> <span class="n">hosts</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">clusters</span> <span class="o">=</span> <span class="n">clusters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.resource_pool.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'resource_pools'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'parent_resource_pools'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'hosts'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'clusters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="ResourcePool.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``ResourcePool.Summary`` class contains commonly used information about</span>
|
|
<span class="sd"> a resource pool in vCenter Server.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">resource_pool</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type resource_pool: :class:`str`</span>
|
|
<span class="sd"> :param resource_pool: Identifier of the resource pool.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``ResourcePool``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the resource pool.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pool</span> <span class="o">=</span> <span class="n">resource_pool</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.resource_pool.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'resource_pool'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'ResourcePool'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ResourcePool.get"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">resource_pool</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Retrieves information about the resource pool indicated by</span>
|
|
<span class="sd"> ``resource_pool``.</span>
|
|
|
|
<span class="sd"> :type resource_pool: :class:`str`</span>
|
|
<span class="sd"> :param resource_pool: Identifier of the resource pool for which information should be</span>
|
|
<span class="sd"> retrieved.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``.</span>
|
|
<span class="sd"> :rtype: :class:`ResourcePool.Info`</span>
|
|
<span class="sd"> :return: information about the resource pool.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if the resource pool indicated by ``resource_pool`` does not exist.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'get'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'resource_pool'</span><span class="p">:</span> <span class="n">resource_pool</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="ResourcePool.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.ResourcePool.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) resource pools in vCenter matching the</span>
|
|
<span class="sd"> :class:`ResourcePool.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`ResourcePool.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching resource pools for which information</span>
|
|
<span class="sd"> should be returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a</span>
|
|
<span class="sd"> :class:`ResourcePool.FilterSpec` with all attributes None which</span>
|
|
<span class="sd"> means all resource pools match the filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`ResourcePool.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the resource pools matching the</span>
|
|
<span class="sd"> :class:`ResourcePool.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 resource pools match the</span>
|
|
<span class="sd"> :class:`ResourcePool.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<div class="viewcode-block" id="VM"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM">[docs]</a><span class="k">class</span> <span class="nc">VM</span><span class="p">(</span><span class="n">VapiInterface</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``VM`` class provides methods for managing the lifecycle of a virtual</span>
|
|
<span class="sd"> machine.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`</span>
|
|
<span class="sd"> :param config: Configuration to be used for creating the stub.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="n">VapiInterface</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">_VMStub</span><span class="p">)</span>
|
|
|
|
<div class="viewcode-block" id="VM.PlacementSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.PlacementSpec">[docs]</a> <span class="k">class</span> <span class="nc">PlacementSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``VM.PlacementSpec`` class contains information used to place a virtual</span>
|
|
<span class="sd"> machine onto resources within the vCenter inventory.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">folder</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">resource_pool</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">host</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cluster</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datastore</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type folder: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folder: Virtual machine folder into which the virtual machine should be</span>
|
|
<span class="sd"> placed.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> When methods return a value of this class as a return value, the</span>
|
|
<span class="sd"> attribute will be an identifier for the resource type: ``Folder``.</span>
|
|
<span class="sd"> This attribute is currently required. In the future, if this</span>
|
|
<span class="sd"> attribute is None, the system will attempt to choose a suitable</span>
|
|
<span class="sd"> folder for the virtual machine; if a folder cannot be chosen, the</span>
|
|
<span class="sd"> virtual machine creation operation will fail.</span>
|
|
<span class="sd"> :type resource_pool: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param resource_pool: Resource pool into which the virtual machine should be placed.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``ResourcePool``.</span>
|
|
<span class="sd"> This attribute is currently required if both ``host`` and</span>
|
|
<span class="sd"> ``cluster`` are None. In the future, if this attribute is None, the</span>
|
|
<span class="sd"> system will attempt to choose a suitable resource pool for the</span>
|
|
<span class="sd"> virtual machine; if a resource pool cannot be chosen, the virtual</span>
|
|
<span class="sd"> machine creation operation will fail.</span>
|
|
<span class="sd"> :type host: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param host: Host onto which the virtual machine should be placed. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> If ``host`` and ``resourcePool`` are both specified,</span>
|
|
<span class="sd"> ``resourcePool`` must belong to ``host``. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> If ``host`` and ``cluster`` are both specified, ``host`` must be a</span>
|
|
<span class="sd"> member of ``cluster``.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``HostSystem``.</span>
|
|
<span class="sd"> This attribute may be None if ``resourcePool`` or ``cluster`` is</span>
|
|
<span class="sd"> specified. If None, the system will attempt to choose a suitable</span>
|
|
<span class="sd"> host for the virtual machine; if a host cannot be chosen, the</span>
|
|
<span class="sd"> virtual machine creation operation will fail.</span>
|
|
<span class="sd"> :type cluster: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param cluster: Cluster onto which the virtual machine should be placed. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> If ``cluster`` and ``resourcePool`` are both specified,</span>
|
|
<span class="sd"> ``resourcePool`` must belong to ``cluster``. </span>
|
|
<span class="sd"> </span>
|
|
<span class="sd"> If ``cluster`` and ``host`` are both specified, ``host`` must be a</span>
|
|
<span class="sd"> member of ``cluster``.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will be an identifier for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> If ``resourcePool`` or ``host`` is specified, it is recommended</span>
|
|
<span class="sd"> that this attribute be None.</span>
|
|
<span class="sd"> :type datastore: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datastore: Datastore on which the virtual machine's configuration state should</span>
|
|
<span class="sd"> be stored. This datastore will also be used for any virtual disks</span>
|
|
<span class="sd"> that are created as part of the virtual machine creation operation.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``Datastore``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``Datastore``.</span>
|
|
<span class="sd"> This attribute is currently required. In the future, if this</span>
|
|
<span class="sd"> attribute is None, the system will attempt to choose suitable</span>
|
|
<span class="sd"> storage for the virtual machine; if storage cannot be chosen, the</span>
|
|
<span class="sd"> virtual machine creation operation will fail.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folder</span> <span class="o">=</span> <span class="n">folder</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pool</span> <span class="o">=</span> <span class="n">resource_pool</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">host</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</span> <span class="o">=</span> <span class="n">cluster</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datastore</span> <span class="o">=</span> <span class="n">datastore</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">PlacementSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.VM.placement_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'folder'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="s">'resource_pool'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="s">'cluster'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="s">'datastore'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">PlacementSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="VM.CreateSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.CreateSpec">[docs]</a> <span class="k">class</span> <span class="nc">CreateSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Document-based creation spec.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">guest_os</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">placement</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">hardware_version</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">boot</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">boot_devices</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cpu</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">memory</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">disks</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">nics</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cdroms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">floppies</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">parallel_ports</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">serial_ports</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">sata_adapters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">scsi_adapters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type guest_os: :class:`com.vmware.vcenter.vm_client.GuestOS`</span>
|
|
<span class="sd"> :param guest_os: Guest OS.</span>
|
|
<span class="sd"> :type name: :class:`str` or ``None``</span>
|
|
<span class="sd"> :param name: Virtual machine name.</span>
|
|
<span class="sd"> If None, a default name will be generated by the server.</span>
|
|
<span class="sd"> :type placement: :class:`VM.PlacementSpec` or ``None``</span>
|
|
<span class="sd"> :param placement: Virtual machine placement information.</span>
|
|
<span class="sd"> This attribute is currently required. In the future, if this</span>
|
|
<span class="sd"> attribute is None, the system will attempt to choose suitable</span>
|
|
<span class="sd"> resources on which to place the virtual machine.</span>
|
|
<span class="sd"> :type hardware_version: :class:`com.vmware.vcenter.vm_client.Hardware.Version` or ``None``</span>
|
|
<span class="sd"> :param hardware_version: Virtual hardware version.</span>
|
|
<span class="sd"> If None, defaults to the most recent version supported by the</span>
|
|
<span class="sd"> server.</span>
|
|
<span class="sd"> :type boot: :class:`com.vmware.vcenter.vm.hardware_client.Boot.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param boot: Boot configuration.</span>
|
|
<span class="sd"> If None, guest-specific default values will be used.</span>
|
|
<span class="sd"> :type boot_devices: :class:`list` of :class:`com.vmware.vcenter.vm.hardware.boot_client.Device.EntryCreateSpec` or ``None``</span>
|
|
<span class="sd"> :param boot_devices: Boot device configuration.</span>
|
|
<span class="sd"> If None, a server-specific boot sequence will be used.</span>
|
|
<span class="sd"> :type cpu: :class:`com.vmware.vcenter.vm.hardware_client.Cpu.UpdateSpec` or ``None``</span>
|
|
<span class="sd"> :param cpu: CPU configuration.</span>
|
|
<span class="sd"> If None, guest-specific default values will be used.</span>
|
|
<span class="sd"> :type memory: :class:`com.vmware.vcenter.vm.hardware_client.Memory.UpdateSpec` or ``None``</span>
|
|
<span class="sd"> :param memory: Memory configuration.</span>
|
|
<span class="sd"> If None, guest-specific default values will be used.</span>
|
|
<span class="sd"> :type disks: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Disk.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param disks: List of disks.</span>
|
|
<span class="sd"> If None, a single blank virtual disk of a guest-specific size will</span>
|
|
<span class="sd"> be created on the same storage as the virtual machine</span>
|
|
<span class="sd"> configuration, and will use a guest-specific host bus adapter type.</span>
|
|
<span class="sd"> If the guest-specific size is 0, no virtual disk will be created.</span>
|
|
<span class="sd"> :type nics: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Ethernet.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param nics: List of Ethernet adapters.</span>
|
|
<span class="sd"> If None, no Ethernet adapters will be created.</span>
|
|
<span class="sd"> :type cdroms: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Cdrom.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param cdroms: List of CD-ROMs.</span>
|
|
<span class="sd"> If None, no CD-ROM devices will be created.</span>
|
|
<span class="sd"> :type floppies: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Floppy.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param floppies: List of floppy drives.</span>
|
|
<span class="sd"> If None, no floppy drives will be created.</span>
|
|
<span class="sd"> :type parallel_ports: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Parallel.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param parallel_ports: List of parallel ports.</span>
|
|
<span class="sd"> If None, no parallel ports will be created.</span>
|
|
<span class="sd"> :type serial_ports: :class:`list` of :class:`com.vmware.vcenter.vm.hardware_client.Serial.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param serial_ports: List of serial ports.</span>
|
|
<span class="sd"> If None, no serial ports will be created.</span>
|
|
<span class="sd"> :type sata_adapters: :class:`list` of :class:`com.vmware.vcenter.vm.hardware.adapter_client.Sata.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param sata_adapters: List of SATA adapters.</span>
|
|
<span class="sd"> If None, any adapters necessary to connect the virtual machine's</span>
|
|
<span class="sd"> storage devices will be created; this includes any devices that</span>
|
|
<span class="sd"> explicitly specify a SATA host bus adapter, as well as any devices</span>
|
|
<span class="sd"> that do not specify a host bus adapter if the guest's preferred</span>
|
|
<span class="sd"> adapter type is SATA.</span>
|
|
<span class="sd"> :type scsi_adapters: :class:`list` of :class:`com.vmware.vcenter.vm.hardware.adapter_client.Scsi.CreateSpec` or ``None``</span>
|
|
<span class="sd"> :param scsi_adapters: List of SCSI adapters.</span>
|
|
<span class="sd"> If None, any adapters necessary to connect the virtual machine's</span>
|
|
<span class="sd"> storage devices will be created; this includes any devices that</span>
|
|
<span class="sd"> explicitly specify a SCSI host bus adapter, as well as any devices</span>
|
|
<span class="sd"> that do not specify a host bus adapter if the guest's preferred</span>
|
|
<span class="sd"> adapter type is SCSI. The type of the SCSI adapter will be a</span>
|
|
<span class="sd"> guest-specific default type.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">guest_os</span> <span class="o">=</span> <span class="n">guest_os</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">placement</span> <span class="o">=</span> <span class="n">placement</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hardware_version</span> <span class="o">=</span> <span class="n">hardware_version</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">boot</span> <span class="o">=</span> <span class="n">boot</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">boot_devices</span> <span class="o">=</span> <span class="n">boot_devices</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cpu</span> <span class="o">=</span> <span class="n">cpu</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">memory</span> <span class="o">=</span> <span class="n">memory</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">disks</span> <span class="o">=</span> <span class="n">disks</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">nics</span> <span class="o">=</span> <span class="n">nics</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cdroms</span> <span class="o">=</span> <span class="n">cdroms</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">floppies</span> <span class="o">=</span> <span class="n">floppies</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">parallel_ports</span> <span class="o">=</span> <span class="n">parallel_ports</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">serial_ports</span> <span class="o">=</span> <span class="n">serial_ports</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">sata_adapters</span> <span class="o">=</span> <span class="n">sata_adapters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">scsi_adapters</span> <span class="o">=</span> <span class="n">scsi_adapters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'guest_OS'</span><span class="p">:</span> <span class="s">'guest_os'</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<span class="n">CreateSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.VM.create_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'guest_OS'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'GuestOS'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">()),</span>
|
|
<span class="s">'placement'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'VM.PlacementSpec'</span><span class="p">)),</span>
|
|
<span class="s">'hardware_version'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'Hardware.Version'</span><span class="p">)),</span>
|
|
<span class="s">'boot'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Boot.CreateSpec'</span><span class="p">)),</span>
|
|
<span class="s">'boot_devices'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">boot_client</span><span class="p">,</span> <span class="s">'Device.EntryCreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'cpu'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Cpu.UpdateSpec'</span><span class="p">)),</span>
|
|
<span class="s">'memory'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Memory.UpdateSpec'</span><span class="p">)),</span>
|
|
<span class="s">'disks'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Disk.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'nics'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Ethernet.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'cdroms'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Cdrom.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'floppies'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Floppy.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'parallel_ports'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Parallel.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'serial_ports'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Serial.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'sata_adapters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">adapter_client</span><span class="p">,</span> <span class="s">'Sata.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="s">'scsi_adapters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">adapter_client</span><span class="p">,</span> <span class="s">'Scsi.CreateSpec'</span><span class="p">))),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">CreateSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="VM.Info"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.Info">[docs]</a> <span class="k">class</span> <span class="nc">Info</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Document-based info.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">guest_os</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">power_state</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">hardware</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">boot</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">boot_devices</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cpu</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">memory</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">disks</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">nics</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cdroms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">floppies</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">parallel_ports</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">serial_ports</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">sata_adapters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">scsi_adapters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type guest_os: :class:`com.vmware.vcenter.vm_client.GuestOS`</span>
|
|
<span class="sd"> :param guest_os: Guest OS.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Virtual machine name.</span>
|
|
<span class="sd"> :type power_state: :class:`com.vmware.vcenter.vm_client.Power.State`</span>
|
|
<span class="sd"> :param power_state: Power state of the virtual machine.</span>
|
|
<span class="sd"> :type hardware: :class:`com.vmware.vcenter.vm_client.Hardware.Info`</span>
|
|
<span class="sd"> :param hardware: Virtual hardware version information.</span>
|
|
<span class="sd"> :type boot: :class:`com.vmware.vcenter.vm.hardware_client.Boot.Info`</span>
|
|
<span class="sd"> :param boot: Boot configuration.</span>
|
|
<span class="sd"> :type boot_devices: :class:`list` of :class:`com.vmware.vcenter.vm.hardware.boot_client.Device.Entry`</span>
|
|
<span class="sd"> :param boot_devices: Boot device configuration. If the :class:`list` has no entries, a</span>
|
|
<span class="sd"> server-specific default boot sequence is used.</span>
|
|
<span class="sd"> :type cpu: :class:`com.vmware.vcenter.vm.hardware_client.Cpu.Info`</span>
|
|
<span class="sd"> :param cpu: CPU configuration.</span>
|
|
<span class="sd"> :type memory: :class:`com.vmware.vcenter.vm.hardware_client.Memory.Info`</span>
|
|
<span class="sd"> :param memory: Memory configuration.</span>
|
|
<span class="sd"> :type disks: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Disk.Info`</span>
|
|
<span class="sd"> :param disks: List of disks.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Disk``. When methods return</span>
|
|
<span class="sd"> a value of this class as a return value, the key in the attribute</span>
|
|
<span class="sd"> :class:`dict` will be an identifier for the resource type:</span>
|
|
<span class="sd"> ``com.vmware.vcenter.vm.hardware.Disk``.</span>
|
|
<span class="sd"> :type nics: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Ethernet.Info`</span>
|
|
<span class="sd"> :param nics: List of Ethernet adapters.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Ethernet``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Ethernet``.</span>
|
|
<span class="sd"> :type cdroms: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Cdrom.Info`</span>
|
|
<span class="sd"> :param cdroms: List of CD-ROMs.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Cdrom``. When methods return</span>
|
|
<span class="sd"> a value of this class as a return value, the key in the attribute</span>
|
|
<span class="sd"> :class:`dict` will be an identifier for the resource type:</span>
|
|
<span class="sd"> ``com.vmware.vcenter.vm.hardware.Cdrom``.</span>
|
|
<span class="sd"> :type floppies: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Floppy.Info`</span>
|
|
<span class="sd"> :param floppies: List of floppy drives.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Floppy``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.Floppy``.</span>
|
|
<span class="sd"> :type parallel_ports: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Parallel.Info`</span>
|
|
<span class="sd"> :param parallel_ports: List of parallel ports.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.ParallelPort``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.ParallelPort``.</span>
|
|
<span class="sd"> :type serial_ports: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware_client.Serial.Info`</span>
|
|
<span class="sd"> :param serial_ports: List of serial ports.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.SerialPort``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.SerialPort``.</span>
|
|
<span class="sd"> :type sata_adapters: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware.adapter_client.Sata.Info`</span>
|
|
<span class="sd"> :param sata_adapters: List of SATA adapters.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.SataAdapter``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.SataAdapter``.</span>
|
|
<span class="sd"> :type scsi_adapters: :class:`dict` of :class:`str` and :class:`com.vmware.vcenter.vm.hardware.adapter_client.Scsi.Info`</span>
|
|
<span class="sd"> :param scsi_adapters: List of SCSI adapters.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the key in</span>
|
|
<span class="sd"> the attribute :class:`dict` must be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.ScsiAdapter``. When methods</span>
|
|
<span class="sd"> return a value of this class as a return value, the key in the</span>
|
|
<span class="sd"> attribute :class:`dict` will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``com.vmware.vcenter.vm.hardware.ScsiAdapter``.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">guest_os</span> <span class="o">=</span> <span class="n">guest_os</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">power_state</span> <span class="o">=</span> <span class="n">power_state</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hardware</span> <span class="o">=</span> <span class="n">hardware</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">boot</span> <span class="o">=</span> <span class="n">boot</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">boot_devices</span> <span class="o">=</span> <span class="n">boot_devices</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cpu</span> <span class="o">=</span> <span class="n">cpu</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">memory</span> <span class="o">=</span> <span class="n">memory</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">disks</span> <span class="o">=</span> <span class="n">disks</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">nics</span> <span class="o">=</span> <span class="n">nics</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cdroms</span> <span class="o">=</span> <span class="n">cdroms</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">floppies</span> <span class="o">=</span> <span class="n">floppies</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">parallel_ports</span> <span class="o">=</span> <span class="n">parallel_ports</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">serial_ports</span> <span class="o">=</span> <span class="n">serial_ports</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">sata_adapters</span> <span class="o">=</span> <span class="n">sata_adapters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">scsi_adapters</span> <span class="o">=</span> <span class="n">scsi_adapters</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'guest_OS'</span><span class="p">:</span> <span class="s">'guest_os'</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<span class="n">Info</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.VM.info'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'guest_OS'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'GuestOS'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'power_state'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'Power.State'</span><span class="p">),</span>
|
|
<span class="s">'hardware'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'Hardware.Info'</span><span class="p">),</span>
|
|
<span class="s">'boot'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Boot.Info'</span><span class="p">),</span>
|
|
<span class="s">'boot_devices'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">boot_client</span><span class="p">,</span> <span class="s">'Device.Entry'</span><span class="p">)),</span>
|
|
<span class="s">'cpu'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Cpu.Info'</span><span class="p">),</span>
|
|
<span class="s">'memory'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Memory.Info'</span><span class="p">),</span>
|
|
<span class="s">'disks'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Disk.Info'</span><span class="p">)),</span>
|
|
<span class="s">'nics'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Ethernet.Info'</span><span class="p">)),</span>
|
|
<span class="s">'cdroms'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Cdrom.Info'</span><span class="p">)),</span>
|
|
<span class="s">'floppies'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Floppy.Info'</span><span class="p">)),</span>
|
|
<span class="s">'parallel_ports'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Parallel.Info'</span><span class="p">)),</span>
|
|
<span class="s">'serial_ports'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware_client</span><span class="p">,</span> <span class="s">'Serial.Info'</span><span class="p">)),</span>
|
|
<span class="s">'sata_adapters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">adapter_client</span><span class="p">,</span> <span class="s">'Sata.Info'</span><span class="p">)),</span>
|
|
<span class="s">'scsi_adapters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">MapType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(),</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm</span><span class="o">.</span><span class="n">hardware</span><span class="o">.</span><span class="n">adapter_client</span><span class="p">,</span> <span class="s">'Scsi.Info'</span><span class="p">)),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Info</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="VM.FilterSpec"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.FilterSpec">[docs]</a> <span class="k">class</span> <span class="nc">FilterSpec</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``VM.FilterSpec`` class contains attributes used to filter the results</span>
|
|
<span class="sd"> when listing virtual machines (see :func:`VM.list`). If multiple attributes</span>
|
|
<span class="sd"> are specified, only virtual machines matching all of the attributes match</span>
|
|
<span class="sd"> the filter.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">vms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">names</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">folders</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">datacenters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">hosts</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">clusters</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">resource_pools</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">power_states</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type vms: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param vms: Identifiers of virtual machines that can match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``VirtualMachine``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``VirtualMachine``.</span>
|
|
<span class="sd"> If None or empty, virtual machines with any identifier match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type names: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param names: Names that virtual machines must have to match the filter (see</span>
|
|
<span class="sd"> :attr:`VM.Info.name`).</span>
|
|
<span class="sd"> If None or empty, virtual machines with any name match the filter.</span>
|
|
<span class="sd"> :type folders: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param folders: Folders that must contain the virtual machine for the virtual</span>
|
|
<span class="sd"> machine to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Folder``. When methods return a value of this class as a return</span>
|
|
<span class="sd"> value, the attribute will contain identifiers for the resource</span>
|
|
<span class="sd"> type: ``Folder``.</span>
|
|
<span class="sd"> If None or empty, virtual machines in any folder match the filter.</span>
|
|
<span class="sd"> :type datacenters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param datacenters: Datacenters that must contain the virtual machine for the virtual</span>
|
|
<span class="sd"> machine to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``Datacenter``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``Datacenter``.</span>
|
|
<span class="sd"> If None or empty, virtual machines in any datacenter match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type hosts: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param hosts: Hosts that must contain the virtual machine for the virtual machine</span>
|
|
<span class="sd"> to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``HostSystem``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``HostSystem``.</span>
|
|
<span class="sd"> If None or empty, virtual machines on any host match the filter.</span>
|
|
<span class="sd"> :type clusters: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param clusters: Clusters that must contain the virtual machine for the virtual</span>
|
|
<span class="sd"> machine to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ClusterComputeResource``. When methods return a value of this</span>
|
|
<span class="sd"> class as a return value, the attribute will contain identifiers for</span>
|
|
<span class="sd"> the resource type: ``ClusterComputeResource``.</span>
|
|
<span class="sd"> If None or empty, virtual machines in any cluster match the filter.</span>
|
|
<span class="sd"> :type resource_pools: :class:`set` of :class:`str` or ``None``</span>
|
|
<span class="sd"> :param resource_pools: Resource pools that must contain the virtual machine for the</span>
|
|
<span class="sd"> virtual machine to match the filter.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must contain identifiers for the resource type:</span>
|
|
<span class="sd"> ``ResourcePool``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will contain identifiers for the</span>
|
|
<span class="sd"> resource type: ``ResourcePool``.</span>
|
|
<span class="sd"> If None or empty, virtual machines in any resource pool match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :type power_states: :class:`set` of :class:`com.vmware.vcenter.vm_client.Power.State` or ``None``</span>
|
|
<span class="sd"> :param power_states: Power states that a virtual machine must be in to match the filter</span>
|
|
<span class="sd"> (see :attr:`com.vmware.vcenter.vm_client.Power.Info.state`.</span>
|
|
<span class="sd"> If None or empty, virtual machines in any power state match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">vms</span> <span class="o">=</span> <span class="n">vms</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="n">names</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">folders</span> <span class="o">=</span> <span class="n">folders</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">datacenters</span> <span class="o">=</span> <span class="n">datacenters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">hosts</span> <span class="o">=</span> <span class="n">hosts</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">clusters</span> <span class="o">=</span> <span class="n">clusters</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">resource_pools</span> <span class="o">=</span> <span class="n">resource_pools</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">power_states</span> <span class="o">=</span> <span class="n">power_states</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
|
</div>
|
|
<span class="n">FilterSpec</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.VM.filter_spec'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'vms'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'names'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">())),</span>
|
|
<span class="s">'folders'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'datacenters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'hosts'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'clusters'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'resource_pools'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">())),</span>
|
|
<span class="s">'power_states'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">SetType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'Power.State'</span><span class="p">))),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">FilterSpec</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
<div class="viewcode-block" id="VM.Summary"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.Summary">[docs]</a> <span class="k">class</span> <span class="nc">Summary</span><span class="p">(</span><span class="n">VapiStruct</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> The ``VM.Summary`` class contains commonly used information about a virtual</span>
|
|
<span class="sd"> machine.</span>
|
|
|
|
<span class="sd"> .. tip::</span>
|
|
<span class="sd"> The arguments are used to initialize data attributes with the same</span>
|
|
<span class="sd"> names.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">vm</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">power_state</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">cpu_count</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="n">memory_size_mib</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> :type vm: :class:`str`</span>
|
|
<span class="sd"> :param vm: Identifier of the virtual machine.</span>
|
|
<span class="sd"> When clients pass a value of this class as a parameter, the</span>
|
|
<span class="sd"> attribute must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``VirtualMachine``. When methods return a value of this class as a</span>
|
|
<span class="sd"> return value, the attribute will be an identifier for the resource</span>
|
|
<span class="sd"> type: ``VirtualMachine``.</span>
|
|
<span class="sd"> :type name: :class:`str`</span>
|
|
<span class="sd"> :param name: Name of the Virtual machine.</span>
|
|
<span class="sd"> :type power_state: :class:`com.vmware.vcenter.vm_client.Power.State`</span>
|
|
<span class="sd"> :param power_state: Power state of the virtual machine.</span>
|
|
<span class="sd"> :type cpu_count: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param cpu_count: Number of CPU cores.</span>
|
|
<span class="sd"> This attribute will be None if the virtual machine configuration is</span>
|
|
<span class="sd"> not available. For example, the configuration information would be</span>
|
|
<span class="sd"> unavailable if the server is unable to access the virtual machine</span>
|
|
<span class="sd"> files on disk, and is often also unavailable during the intial</span>
|
|
<span class="sd"> phases of virtual machine creation.</span>
|
|
<span class="sd"> :type memory_size_mib: :class:`long` or ``None``</span>
|
|
<span class="sd"> :param memory_size_mib: Memory size in mebibytes.</span>
|
|
<span class="sd"> This attribute will be None if the virtual machine configuration is</span>
|
|
<span class="sd"> not available. For example, the configuration information would be</span>
|
|
<span class="sd"> unavailable if the server is unable to access the virtual machine</span>
|
|
<span class="sd"> files on disk, and is often also unavailable during the intial</span>
|
|
<span class="sd"> phases of virtual machine creation.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">vm</span> <span class="o">=</span> <span class="n">vm</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">power_state</span> <span class="o">=</span> <span class="n">power_state</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">cpu_count</span> <span class="o">=</span> <span class="n">cpu_count</span>
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">memory_size_mib</span> <span class="o">=</span> <span class="n">memory_size_mib</span>
|
|
<span class="n">VapiStruct</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'memory_size_MiB'</span><span class="p">:</span> <span class="s">'memory_size_mib'</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<span class="n">Summary</span><span class="o">.</span><span class="n">_set_binding_type</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span>
|
|
<span class="s">'com.vmware.vcenter.VM.summary'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'vm'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'VirtualMachine'</span><span class="p">),</span>
|
|
<span class="s">'name'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">StringType</span><span class="p">(),</span>
|
|
<span class="s">'power_state'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vcenter</span><span class="o">.</span><span class="n">vm_client</span><span class="p">,</span> <span class="s">'Power.State'</span><span class="p">),</span>
|
|
<span class="s">'cpu_count'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="s">'memory_size_MiB'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">IntegerType</span><span class="p">()),</span>
|
|
<span class="p">},</span>
|
|
<span class="n">Summary</span><span class="p">,</span>
|
|
<span class="bp">False</span><span class="p">,</span>
|
|
<span class="bp">None</span><span class="p">))</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="VM.create"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.create">[docs]</a> <span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Creates a virtual machine.</span>
|
|
|
|
<span class="sd"> :type spec: :class:`VM.CreateSpec`</span>
|
|
<span class="sd"> :param spec: Virtual machine specification.</span>
|
|
<span class="sd"> :rtype: :class:`str`</span>
|
|
<span class="sd"> :return: ID of newly-created virtual machine.</span>
|
|
<span class="sd"> The return value will be an identifier for the resource type:</span>
|
|
<span class="sd"> ``VirtualMachine``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` </span>
|
|
<span class="sd"> if a virtual machine with the specified name already exists.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if any of the specified parameters are invalid.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if any of the resources specified in spec could not be found</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` </span>
|
|
<span class="sd"> if a specified resource (eg. host) is not accessible.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse` </span>
|
|
<span class="sd"> if any of the specified storage addresses (eg. IDE, SATA, SCSI)</span>
|
|
<span class="sd"> result in a storage address conflict.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if any of the resources needed to create the virtual machine could</span>
|
|
<span class="sd"> not be allocated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` </span>
|
|
<span class="sd"> if ``guestOS`` is not supported for the requested virtual hardware</span>
|
|
<span class="sd"> version and spec includes None attributes that default to</span>
|
|
<span class="sd"> guest-specific values.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'create'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="n">spec</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="VM.get"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">vm</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about a virtual machine.</span>
|
|
|
|
<span class="sd"> :type vm: :class:`str`</span>
|
|
<span class="sd"> :param vm: Virtual machine identifier.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``VirtualMachine``.</span>
|
|
<span class="sd"> :rtype: :class:`VM.Info`</span>
|
|
<span class="sd"> :return: Information about the specified virtual machine.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if the virtual machine is not found.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` </span>
|
|
<span class="sd"> if the virtual machine's configuration state cannot be accessed.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'get'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'vm'</span><span class="p">:</span> <span class="n">vm</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="VM.delete"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.delete">[docs]</a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="n">vm</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Deletes a virtual machine.</span>
|
|
|
|
<span class="sd"> :type vm: :class:`str`</span>
|
|
<span class="sd"> :param vm: Virtual machine identifier.</span>
|
|
<span class="sd"> The parameter must be an identifier for the resource type:</span>
|
|
<span class="sd"> ``VirtualMachine``.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Error` </span>
|
|
<span class="sd"> if the system reports an error while responding to the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` </span>
|
|
<span class="sd"> if the virtual machine is not found.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` </span>
|
|
<span class="sd"> if the virtual machine is busy performing another operation.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` </span>
|
|
<span class="sd"> if the virtual machine's configuration state cannot be accessed.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'delete'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'vm'</span><span class="p">:</span> <span class="n">vm</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div>
|
|
<div class="viewcode-block" id="VM.list"><a class="viewcode-back" href="../../../com.vmware.html#com.vmware.vcenter_client.VM.list">[docs]</a> <span class="k">def</span> <span class="nf">list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
|
<span class="nb">filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
|
<span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> Returns information about at most 1000 visible (subject to permission</span>
|
|
<span class="sd"> checks) virtual machines in vCenter matching the</span>
|
|
<span class="sd"> :class:`VM.FilterSpec`.</span>
|
|
|
|
<span class="sd"> :type filter: :class:`VM.FilterSpec` or ``None``</span>
|
|
<span class="sd"> :param filter: Specification of matching virtual machines for which information</span>
|
|
<span class="sd"> should be returned.</span>
|
|
<span class="sd"> If None, the behavior is equivalent to a :class:`VM.FilterSpec`</span>
|
|
<span class="sd"> with all attributes None which means all virtual machines match the</span>
|
|
<span class="sd"> filter.</span>
|
|
<span class="sd"> :rtype: :class:`list` of :class:`VM.Summary`</span>
|
|
<span class="sd"> :return: Commonly used information about the virtual machines matching the</span>
|
|
<span class="sd"> :class:`VM.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` </span>
|
|
<span class="sd"> if the :attr:`VM.FilterSpec.power_states` attribute contains a</span>
|
|
<span class="sd"> value that is not supported by the server.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` </span>
|
|
<span class="sd"> if more than 1000 virtual machines match the</span>
|
|
<span class="sd"> :class:`VM.FilterSpec`.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` </span>
|
|
<span class="sd"> if the system is unable to communicate with a service to complete</span>
|
|
<span class="sd"> the request.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` </span>
|
|
<span class="sd"> if the user can not be authenticated.</span>
|
|
<span class="sd"> :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` </span>
|
|
<span class="sd"> if the user doesn't have the required privileges.</span>
|
|
<span class="sd"> """</span>
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_invoke</span><span class="p">(</span><span class="s">'list'</span><span class="p">,</span>
|
|
<span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">filter</span><span class="p">,</span>
|
|
<span class="p">})</span>
|
|
</div></div>
|
|
<span class="k">class</span> <span class="nc">_ClusterStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Cluster.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for get operation</span>
|
|
<span class="n">get_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'cluster'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'ClusterComputeResource'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">get_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">get_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">get_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Cluster.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'get'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">get_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Cluster.Info'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">get_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">get_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">get_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.cluster'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_DatacenterStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for create operation</span>
|
|
<span class="n">create_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datacenter.CreateSpec'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">create_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.already_exists'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'AlreadyExists'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">create_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">create_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for delete operation</span>
|
|
<span class="n">delete_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datacenter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datacenter'</span><span class="p">),</span>
|
|
<span class="s">'force'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">BooleanType</span><span class="p">()),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">delete_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_in_use'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInUse'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">delete_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">delete_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datacenter.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for get operation</span>
|
|
<span class="n">get_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datacenter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datacenter'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">get_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">get_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">get_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'create'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">create_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datacenter'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">create_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">create_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">create_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'delete'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">delete_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">VoidType</span><span class="p">(),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">delete_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">delete_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">delete_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datacenter.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'get'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">get_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datacenter.Info'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">get_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">get_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">get_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.datacenter'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_DatastoreStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for get operation</span>
|
|
<span class="n">get_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'datastore'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'Datastore'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">get_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">get_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">get_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'get'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">get_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.Info'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">get_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">get_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">get_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Datastore.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.datastore'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_FolderStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Folder.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Folder.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.folder'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_HostStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for create operation</span>
|
|
<span class="n">create_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.CreateSpec'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">create_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.already_exists'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'AlreadyExists'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_element_type'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidElementType'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_in_use'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInUse'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unsupported'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unsupported'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">create_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">create_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for delete operation</span>
|
|
<span class="n">delete_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'HostSystem'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">delete_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_in_use'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInUse'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">delete_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">delete_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for connect operation</span>
|
|
<span class="n">connect_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'HostSystem'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">connect_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.already_in_desired_state'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'AlreadyInDesiredState'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">connect_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">connect_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for disconnect operation</span>
|
|
<span class="n">disconnect_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'host'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'HostSystem'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">disconnect_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.already_in_desired_state'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'AlreadyInDesiredState'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">disconnect_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">disconnect_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'create'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">create_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'HostSystem'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">create_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">create_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">create_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'delete'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">delete_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">VoidType</span><span class="p">(),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">delete_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">delete_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">delete_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Host.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'connect'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">connect_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">VoidType</span><span class="p">(),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">connect_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">connect_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">connect_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'disconnect'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">disconnect_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">VoidType</span><span class="p">(),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">disconnect_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">disconnect_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">disconnect_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.host'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_NetworkStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Network.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'Network.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.network'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_ResourcePoolStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for get operation</span>
|
|
<span class="n">get_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'resource_pool'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'ResourcePool'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">get_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">get_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">get_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'ResourcePool.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'get'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">get_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'ResourcePool.Info'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">get_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">get_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">get_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'ResourcePool.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.resource_pool'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
<span class="k">class</span> <span class="nc">_VMStub</span><span class="p">(</span><span class="n">ApiInterfaceStub</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
|
<span class="c"># properties for create operation</span>
|
|
<span class="n">create_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'spec'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'VM.CreateSpec'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">create_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.already_exists'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'AlreadyExists'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_inaccessible'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInaccessible'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_in_use'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInUse'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unsupported'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unsupported'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">create_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">create_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for get operation</span>
|
|
<span class="n">get_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'vm'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'VirtualMachine'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">get_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_inaccessible'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInaccessible'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">get_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">get_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for delete operation</span>
|
|
<span class="n">delete_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'vm'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'VirtualMachine'</span><span class="p">),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">delete_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.error'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Error'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.not_found'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'NotFound'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_busy'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceBusy'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.resource_inaccessible'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ResourceInaccessible'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">delete_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">delete_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="c"># properties for list operation</span>
|
|
<span class="n">list_input_type</span> <span class="o">=</span> <span class="nb">type</span><span class="o">.</span><span class="n">StructType</span><span class="p">(</span><span class="s">'operation-input'</span><span class="p">,</span> <span class="p">{</span>
|
|
<span class="s">'filter'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">OptionalType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'VM.FilterSpec'</span><span class="p">)),</span>
|
|
<span class="p">})</span>
|
|
<span class="n">list_error_dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.invalid_argument'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'InvalidArgument'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unable_to_allocate_resource'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'UnableToAllocateResource'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.service_unavailable'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'ServiceUnavailable'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthenticated'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthenticated'</span><span class="p">),</span>
|
|
<span class="s">'com.vmware.vapi.std.errors.unauthorized'</span><span class="p">:</span>
|
|
<span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">com</span><span class="o">.</span><span class="n">vmware</span><span class="o">.</span><span class="n">vapi</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">errors_client</span><span class="p">,</span> <span class="s">'Unauthorized'</span><span class="p">),</span>
|
|
|
|
<span class="p">}</span>
|
|
<span class="n">list_input_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
<span class="n">list_output_validator_list</span> <span class="o">=</span> <span class="p">[</span>
|
|
<span class="p">]</span>
|
|
|
|
<span class="n">operations</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s">'create'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">create_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">IdType</span><span class="p">(</span><span class="n">resource_types</span><span class="o">=</span><span class="s">'VirtualMachine'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">create_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">create_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">create_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'get'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">get_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'VM.Info'</span><span class="p">),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">get_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">get_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">get_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'delete'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">delete_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">VoidType</span><span class="p">(),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">delete_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">delete_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">delete_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="s">'list'</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s">'input_type'</span><span class="p">:</span> <span class="n">list_input_type</span><span class="p">,</span>
|
|
<span class="s">'output_type'</span><span class="p">:</span> <span class="nb">type</span><span class="o">.</span><span class="n">ListType</span><span class="p">(</span><span class="nb">type</span><span class="o">.</span><span class="n">ReferenceType</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="n">__name__</span><span class="p">],</span> <span class="s">'VM.Summary'</span><span class="p">)),</span>
|
|
<span class="s">'errors'</span><span class="p">:</span> <span class="n">list_error_dict</span><span class="p">,</span>
|
|
<span class="s">'input_validator_list'</span><span class="p">:</span> <span class="n">list_input_validator_list</span><span class="p">,</span>
|
|
<span class="s">'output_validator_list'</span><span class="p">:</span> <span class="n">list_output_validator_list</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">}</span>
|
|
<span class="n">ApiInterfaceStub</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iface_name</span><span class="o">=</span><span class="s">'com.vmware.vcenter.VM'</span><span class="p">,</span>
|
|
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
|
|
<span class="n">operations</span><span class="o">=</span><span class="n">operations</span><span class="p">)</span>
|
|
</pre></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="../../../search.html" method="get">
|
|
<input type="text" name="q" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../../genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="../../../py-modindex.html" title="Python Module Index"
|
|
>modules</a> |</li>
|
|
<li><a href="../../../index.html">vSphere Automation SDK for Python 6.5.0 documentation</a> »</li>
|
|
<li><a href="../../index.html" >Module code</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2014, VMware, Inc..
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
|
</div>
|
|
</body>
|
|
</html> |