mirror of
https://github.com/vmware/vsphere-automation-sdk-python.git
synced 2024-11-21 01:09:59 -05:00
Refresh vSphere bindings for 8.0U1 (#372)
* Updated the runtime and readme Signed-off-by: shweta purohit <spurohit@vmware.com> Signed-off-by: shweta purohit <spurohit@vmware.com> * Refreshed source and license file Signed-off-by: shweta purohit <spurohit@vmware.com> * Updated depedency files and Samples Signed-off-by: shweta purohit <spurohit@vmware.com> * updated setup.py Signed-off-by: shweta purohit <spurohit@vmware.com> * Updated lib/index.html and lib/README Signed-off-by: shweta purohit <spurohit@vmware.com> --------- Signed-off-by: shweta purohit <spurohit@vmware.com>
This commit is contained in:
parent
88d1c65407
commit
34d801043e
32
LICENSE
32
LICENSE
@ -1,15 +1,17 @@
|
||||
LICENSE
|
||||
|
||||
vsphere_automation_sdk_python 8.0
|
||||
|
||||
Copyright (c) 2016-2022 VMware, Inc. All rights reserved.
|
||||
|
||||
This product is licensed to you under the MIT License (the License). You may not use this product except in compliance with the License.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
LICENSE
|
||||
|
||||
vsphere_automation_sdk_python 8.0U1
|
||||
|
||||
Copyright (c) 2016-2023 VMware, Inc. All rights reserved.
|
||||
|
||||
This product is licensed to you under the MIT License (the License). You may not use this product except in compliance with the License.
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -21,7 +21,7 @@ samples require the vSphere Management SDK packages (pyVmomi) to be installed on
|
||||
The samples have been developed to work with python 3.8+
|
||||
|
||||
## Supported OnPrem vCenter Releases
|
||||
vCenter 7.0, 7.0U1, 7.0U2, 7.0U3 and 8.0.
|
||||
vCenter 7.0, 7.0U1, 7.0U2, 7.0U3 , 8.0 and 8.0U1
|
||||
Please refer to the notes in each sample for detailed compatibility information.
|
||||
|
||||
## Supported NSX-T Releases
|
||||
@ -54,7 +54,7 @@ pip install --upgrade pip
|
||||
```
|
||||
Install/Update setuptools to version *62.0.0*.
|
||||
```cmd
|
||||
pip install --upgrade setuptools==62.0.0
|
||||
pip install --upgrade setuptools
|
||||
```
|
||||
Install SDK packages from Github.
|
||||
```cmd
|
||||
@ -264,8 +264,9 @@ $ python samples/vsphere/vcenter/vm/list_vms.py -v
|
||||
### vSphere API Documentation
|
||||
|
||||
* [VMware vSphere REST API Reference documentation](https://developer.vmware.com/docs/vsphere-automation/latest/)
|
||||
* [vSphere 8.0.0.1 (latest)](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.1/)
|
||||
* Previous Releases: vSphere [8.0.0.0](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.0/),
|
||||
* [vSphere 8.0.1.0 (latest)](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.1.0/)
|
||||
* Previous Releases: vSphere [8.0.0.1](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.1/)
|
||||
[8.0.0.0](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.0/),
|
||||
[7.0 U3](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.3.0/)
|
||||
[7.0 U2](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.2.0/), [7.0 U1](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.1.0/), [7.0](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.0.1/).
|
||||
|
||||
|
@ -4,8 +4,8 @@ For python developers, client libraries are supplied for testing and development
|
||||
|
||||
Name | Description
|
||||
------------------------------------| -------------
|
||||
vapi_runtime | vAPI runtime responsible for serialization/de-serialization of objects and wire protocol
|
||||
vapi_client_bindings | Client stubs for vSphere Automation APIs
|
||||
vapi_runtime | vAPI runtime responsible for serialization/de-serialization of objects and wire protocol
|
||||
vcenter_bindings | Client stubs for vSphere Automation APIs
|
||||
vmc_client_bindings | Client stubs for VMware Cloud on AWS Console APIs
|
||||
vmc_draas_client_bindings | Client stubs for VMware Cloud (VMC) Disaster Recovery as a Service (DRaaS) APIs
|
||||
nsx-python-sdk | Client stubs for VMware NSX-T APIs
|
||||
|
@ -3,7 +3,7 @@
|
||||
<meta name='api-version' value='2'/>
|
||||
</head>
|
||||
<body>
|
||||
<a href='vapi-client-bindings/'>vapi-client-bindings</a><br/>
|
||||
<a href='vcenter-bindings/'>vcenter-bindings</a><br/>
|
||||
<a href='vmc-client-bindings/'>vmc-client-bindings</a><br/>
|
||||
<a href='vmc-draas-client-bindings/'>vmc-draas-client-bindings</a><br/>
|
||||
<a href='vapi-runtime/'>vapi-runtime</a><br/>
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
lib/src/vapi-common-client/vapi_common_client-2.40.0.zip
Normal file
BIN
lib/src/vapi-common-client/vapi_common_client-2.40.0.zip
Normal file
Binary file not shown.
Binary file not shown.
BIN
lib/src/vcenter-bindings/vcenter_bindings-4.1.0.zip
Normal file
BIN
lib/src/vcenter-bindings/vcenter_bindings-4.1.0.zip
Normal file
Binary file not shown.
@ -1 +0,0 @@
|
||||
<a href='vapi_client_bindings-4.0.0-py2.py3-none-any.whl'>vapi_client_bindings-4.0.0-py2.py3-none-any.whl</a><br />
|
Binary file not shown.
@ -1 +1 @@
|
||||
<a href='vapi_common_client-2.37.0-py2.py3-none-any.whl'>vapi_common_client-2.37.0-py2.py3-none-any.whl</a><br />
|
||||
<a href='vapi_common_client-2.40.0-py2.py3-none-any.whl'>vapi_common_client-2.40.0-py2.py3-none-any.whl</a><br />
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
<a href='vapi_runtime-2.37.0-py2.py3-none-any.whl'>vapi_runtime-2.37.0-py2.py3-none-any.whl</a><br />
|
||||
<a href='vapi_runtime-2.40.0-py2.py3-none-any.whl'>vapi_runtime-2.40.0-py2.py3-none-any.whl</a><br />
|
Binary file not shown.
1
lib/vcenter-bindings/index.html
Normal file
1
lib/vcenter-bindings/index.html
Normal file
@ -0,0 +1 @@
|
||||
<a href='vcenter_bindings-4.1.0-py2.py3-none-any.whl'>vcenter_bindings-4.1.0-py2.py3-none-any.whl</a><br />
|
BIN
lib/vcenter-bindings/vcenter_bindings-4.1.0-py2.py3-none-any.whl
Normal file
BIN
lib/vcenter-bindings/vcenter_bindings-4.1.0-py2.py3-none-any.whl
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,14 @@
|
||||
###### Common requirements ######
|
||||
lxml >= 4.3.0
|
||||
pyVmomi (<=7.0.3,>=6.7)
|
||||
pyVmomi >=6.7
|
||||
six (>=1.12)
|
||||
|
||||
requests (==2.27.1)
|
||||
pyOpenSSL (==22.0.0)
|
||||
cryptography (==36.0.0)
|
||||
setuptools (==62.0.0)
|
||||
requests (>=2.27.1)
|
||||
pyOpenSSL (>=22.0.0)
|
||||
cryptography (>=37.0.2)
|
||||
setuptools (>=62.3.2)
|
||||
###### SDK requirements ######
|
||||
vapi-client-bindings == 4.0.0
|
||||
vcenter-bindings == 4.1.0
|
||||
vmc-client-bindings
|
||||
nsx-python-sdk
|
||||
nsx-policy-python-sdk
|
||||
|
@ -1,9 +1,9 @@
|
||||
###### This requirements file is used for local installation where access to GitHub is restricted ######
|
||||
###### Common requirements ######
|
||||
lxml >= 4.3.0
|
||||
pyVmomi (<=7.0.3,>=6.7)
|
||||
pyVmomi >=6.7
|
||||
six (>=1.12)
|
||||
requests (==2.27.1)
|
||||
pyOpenSSL (==22.0.0)
|
||||
cryptography (==36.0.0)
|
||||
setuptools (==62.0.0)
|
||||
requests (>=2.27.1)
|
||||
pyOpenSSL (>=22.0.0)
|
||||
cryptography (>=37.0.2)
|
||||
setuptools (>=62.3.2)
|
@ -28,8 +28,7 @@ import time
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
from pyVmomi import ThumbprintMismatchException
|
||||
|
||||
from pyVmomi.Security import ThumbprintMismatchException
|
||||
from uuid import uuid4
|
||||
from io import BytesIO
|
||||
from six.moves.urllib.parse import urlparse
|
||||
@ -1013,7 +1012,7 @@ def _extract_element(xml, element_name, namespace):
|
||||
@rtype: etree element.
|
||||
@return: The extracted element.
|
||||
'''
|
||||
assert(len(namespace) == 1)
|
||||
assert (len(namespace) == 1)
|
||||
result = xml.xpath("//%s:%s" % (list(namespace.keys())[0], element_name),
|
||||
namespaces=namespace)
|
||||
if result:
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
"""
|
||||
* *******************************************************
|
||||
* Copyright VMware, Inc. 2016-2018. All Rights Reserved.
|
||||
* Copyright VMware, Inc. 2016-2023. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
* *******************************************************
|
||||
*
|
||||
@ -21,13 +21,9 @@ try:
|
||||
except ImportError:
|
||||
import urllib.request as urllib2
|
||||
|
||||
import atexit
|
||||
|
||||
from com.vmware.vcenter.ovf_client import LibraryItem
|
||||
from pyVmomi import vim
|
||||
|
||||
from samples.vsphere.common import sample_cli
|
||||
from samples.vsphere.common import sample_util
|
||||
from samples.vsphere.common.sample_base import SampleBase
|
||||
from samples.vsphere.common.id_generator import generate_random_uuid
|
||||
from samples.vsphere.common.service_manager import ServiceManager
|
||||
from samples.vsphere.common.vim.helpers.vim_utils import (
|
||||
@ -36,7 +32,7 @@ from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient
|
||||
from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper
|
||||
|
||||
|
||||
class DeployOvfTemplate:
|
||||
class DeployOvfTemplate(SampleBase):
|
||||
"""
|
||||
Demonstrates the workflow to deploy an OVF library item to a resource pool.
|
||||
Note: the sample needs an existing library item with an OVF template
|
||||
@ -44,6 +40,7 @@ class DeployOvfTemplate:
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
SampleBase.__init__(self, self.__doc__)
|
||||
self.servicemanager = None
|
||||
self.client = None
|
||||
self.helper = None
|
||||
@ -52,38 +49,35 @@ class DeployOvfTemplate:
|
||||
self.vm_obj = None
|
||||
self.vm_name = None
|
||||
|
||||
def setup(self):
|
||||
parser = sample_cli.build_arg_parser()
|
||||
parser.add_argument('-n', '--vm_name',
|
||||
action='store',
|
||||
help='Name of the testing vm')
|
||||
parser.add_argument('-clustername',
|
||||
'--clustername',
|
||||
help='The name of the cluster to be used.')
|
||||
parser.add_argument('-libitemname',
|
||||
'--libitemname',
|
||||
help='The name of the library item to deploy.'
|
||||
def _options(self):
|
||||
self.argparser.add_argument('-n',
|
||||
'--vm_name',
|
||||
help='Name of the testing vm.')
|
||||
self.argparser.add_argument('-clustername',
|
||||
'--clustername',
|
||||
help='The name of the cluster to be used.')
|
||||
self.argparser.add_argument('-libitemname',
|
||||
'--libitemname',
|
||||
help='The name of the library item to deploy.'
|
||||
'The library item should contain an OVF package.')
|
||||
args = sample_util.process_cli_args(parser.parse_args())
|
||||
self.lib_item_name = args.libitemname
|
||||
self.cluster_name = args.clustername
|
||||
self.vm_name = args.vm_name
|
||||
|
||||
self.servicemanager = ServiceManager(args.server,
|
||||
args.username,
|
||||
args.password,
|
||||
args.skipverification)
|
||||
self.servicemanager.connect()
|
||||
atexit.register(self.servicemanager.disconnect)
|
||||
|
||||
self.client = ClsApiClient(self.servicemanager)
|
||||
self.helper = ClsApiHelper(self.client, args.skipverification)
|
||||
|
||||
def _setup(self):
|
||||
# Default VM name
|
||||
self.vm_name = 'vm-' + str(generate_random_uuid())
|
||||
|
||||
def execute(self):
|
||||
self.cluster_name = self.args.clustername
|
||||
assert self.cluster_name is not None
|
||||
|
||||
self.lib_item_name = self.args.libitemname
|
||||
assert self.lib_item_name is not None
|
||||
|
||||
if not self.servicemanager:
|
||||
self.servicemanager = self.get_service_manager()
|
||||
|
||||
self.client = ClsApiClient(self.servicemanager)
|
||||
self.helper = ClsApiHelper(self.client, self.skip_verification)
|
||||
|
||||
def _execute(self):
|
||||
# Find the cluster's resource pool moid
|
||||
cluster_obj = get_obj(self.servicemanager.content,
|
||||
[vim.ClusterComputeResource], self.cluster_name)
|
||||
@ -143,7 +137,7 @@ class DeployOvfTemplate:
|
||||
for error in result.error.errors:
|
||||
print('OVF error: {}'.format(error.message))
|
||||
|
||||
def cleanup(self):
|
||||
def _cleanup(self):
|
||||
if self.vm_obj is not None:
|
||||
# Power off the VM and wait for the power off operation to complete
|
||||
poweroff_vm(self.servicemanager.content, self.vm_obj)
|
||||
@ -153,9 +147,7 @@ class DeployOvfTemplate:
|
||||
|
||||
def main():
|
||||
deploy_ovf_sample = DeployOvfTemplate()
|
||||
deploy_ovf_sample.setup()
|
||||
deploy_ovf_sample.execute()
|
||||
deploy_ovf_sample.cleanup()
|
||||
deploy_ovf_sample.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
8
setup.py
8
setup.py
@ -13,10 +13,10 @@ setup(name='vSphere Automation SDK',
|
||||
packages=[],
|
||||
install_requires=[
|
||||
'lxml >= 4.3.0',
|
||||
'pyVmomi <=7.0.3,>=6.7',
|
||||
'vapi-runtime @ file://localhost/{}/lib/vapi-runtime/vapi_runtime-2.37.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'vapi-client-bindings @ file://localhost/{}/lib/vapi-client-bindings/vapi_client_bindings-4.0.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'vapi-common-client @ file://localhost/{}/lib/vapi-common-client/vapi_common_client-2.37.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'pyVmomi >=6.7',
|
||||
'vapi-runtime @ file://localhost/{}/lib/vapi-runtime/vapi_runtime-2.40.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'vcenter-bindings @ file://localhost/{}/lib/vcenter-bindings/vcenter_bindings-4.1.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'vapi-common-client @ file://localhost/{}/lib/vapi-common-client/vapi_common_client-2.40.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'vmc-client-bindings @ file://localhost/{}/lib/vmc-client-bindings/vmc_client_bindings-1.61.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'nsx-python-sdk @ file://localhost/{}/lib/nsx-python-sdk/nsx_python_sdk-4.0.1.0.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
'nsx-policy-python-sdk @ file://localhost/{}/lib/nsx-policy-python-sdk/nsx_policy_python_sdk-4.0.1.0.0-py2.py3-none-any.whl'.format(os.getcwd()),
|
||||
|
@ -2,4 +2,4 @@ pytest==3.9.1
|
||||
pycodestyle
|
||||
pexpect
|
||||
asn1crypto
|
||||
setuptools>=61.0.0
|
||||
setuptools>=62.3.2
|
||||
|
Loading…
Reference in New Issue
Block a user