1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-22 01:39:58 -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:
Shweta 2023-04-19 17:54:26 +05:30 committed by GitHub
parent 88d1c65407
commit 34d801043e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 3034 additions and 2873 deletions

View File

@ -1,13 +1,15 @@
LICENSE LICENSE
vsphere_automation_sdk_python 8.0 vsphere_automation_sdk_python 8.0U1
Copyright (c) 2016-2022 VMware, Inc. All rights reserved. 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. 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 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: 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 above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

View File

@ -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+ The samples have been developed to work with python 3.8+
## Supported OnPrem vCenter Releases ## 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. Please refer to the notes in each sample for detailed compatibility information.
## Supported NSX-T Releases ## Supported NSX-T Releases
@ -54,7 +54,7 @@ pip install --upgrade pip
``` ```
Install/Update setuptools to version *62.0.0*. Install/Update setuptools to version *62.0.0*.
```cmd ```cmd
pip install --upgrade setuptools==62.0.0 pip install --upgrade setuptools
``` ```
Install SDK packages from Github. Install SDK packages from Github.
```cmd ```cmd
@ -264,8 +264,9 @@ $ python samples/vsphere/vcenter/vm/list_vms.py -v
### vSphere API Documentation ### vSphere API Documentation
* [VMware vSphere REST API Reference documentation](https://developer.vmware.com/docs/vsphere-automation/latest/) * [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/) * [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.0](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.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 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/). [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/).

View File

@ -5,7 +5,7 @@ For python developers, client libraries are supplied for testing and development
Name | Description Name | Description
------------------------------------| ------------- ------------------------------------| -------------
vapi_runtime | vAPI runtime responsible for serialization/de-serialization of objects and wire protocol vapi_runtime | vAPI runtime responsible for serialization/de-serialization of objects and wire protocol
vapi_client_bindings | Client stubs for vSphere Automation APIs vcenter_bindings | Client stubs for vSphere Automation APIs
vmc_client_bindings | Client stubs for VMware Cloud on AWS Console 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 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 nsx-python-sdk | Client stubs for VMware NSX-T APIs

View File

@ -3,7 +3,7 @@
<meta name='api-version' value='2'/> <meta name='api-version' value='2'/>
</head> </head>
<body> <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-client-bindings/'>vmc-client-bindings</a><br/>
<a href='vmc-draas-client-bindings/'>vmc-draas-client-bindings</a><br/> <a href='vmc-draas-client-bindings/'>vmc-draas-client-bindings</a><br/>
<a href='vapi-runtime/'>vapi-runtime</a><br/> <a href='vapi-runtime/'>vapi-runtime</a><br/>

Binary file not shown.

View File

@ -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 />

View File

@ -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 />

View File

@ -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 />

View 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 />

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
###### Common requirements ###### ###### Common requirements ######
lxml >= 4.3.0 lxml >= 4.3.0
pyVmomi (<=7.0.3,>=6.7) pyVmomi >=6.7
six (>=1.12) six (>=1.12)
requests (==2.27.1) requests (>=2.27.1)
pyOpenSSL (==22.0.0) pyOpenSSL (>=22.0.0)
cryptography (==36.0.0) cryptography (>=37.0.2)
setuptools (==62.0.0) setuptools (>=62.3.2)
###### SDK requirements ###### ###### SDK requirements ######
vapi-client-bindings == 4.0.0 vcenter-bindings == 4.1.0
vmc-client-bindings vmc-client-bindings
nsx-python-sdk nsx-python-sdk
nsx-policy-python-sdk nsx-policy-python-sdk

View File

@ -1,9 +1,9 @@
###### This requirements file is used for local installation where access to GitHub is restricted ###### ###### This requirements file is used for local installation where access to GitHub is restricted ######
###### Common requirements ###### ###### Common requirements ######
lxml >= 4.3.0 lxml >= 4.3.0
pyVmomi (<=7.0.3,>=6.7) pyVmomi >=6.7
six (>=1.12) six (>=1.12)
requests (==2.27.1) requests (>=2.27.1)
pyOpenSSL (==22.0.0) pyOpenSSL (>=22.0.0)
cryptography (==36.0.0) cryptography (>=37.0.2)
setuptools (==62.0.0) setuptools (>=62.3.2)

View File

@ -28,8 +28,7 @@ import time
import base64 import base64
import hashlib import hashlib
from pyVmomi import ThumbprintMismatchException from pyVmomi.Security import ThumbprintMismatchException
from uuid import uuid4 from uuid import uuid4
from io import BytesIO from io import BytesIO
from six.moves.urllib.parse import urlparse from six.moves.urllib.parse import urlparse
@ -1013,7 +1012,7 @@ def _extract_element(xml, element_name, namespace):
@rtype: etree element. @rtype: etree element.
@return: The extracted element. @return: The extracted element.
''' '''
assert(len(namespace) == 1) assert (len(namespace) == 1)
result = xml.xpath("//%s:%s" % (list(namespace.keys())[0], element_name), result = xml.xpath("//%s:%s" % (list(namespace.keys())[0], element_name),
namespaces=namespace) namespaces=namespace)
if result: if result:

View File

@ -2,7 +2,7 @@
""" """
* ******************************************************* * *******************************************************
* Copyright VMware, Inc. 2016-2018. All Rights Reserved. * Copyright VMware, Inc. 2016-2023. All Rights Reserved.
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* ******************************************************* * *******************************************************
* *
@ -21,13 +21,9 @@ try:
except ImportError: except ImportError:
import urllib.request as urllib2 import urllib.request as urllib2
import atexit
from com.vmware.vcenter.ovf_client import LibraryItem from com.vmware.vcenter.ovf_client import LibraryItem
from pyVmomi import vim from pyVmomi import vim
from samples.vsphere.common.sample_base import SampleBase
from samples.vsphere.common import sample_cli
from samples.vsphere.common import sample_util
from samples.vsphere.common.id_generator import generate_random_uuid from samples.vsphere.common.id_generator import generate_random_uuid
from samples.vsphere.common.service_manager import ServiceManager from samples.vsphere.common.service_manager import ServiceManager
from samples.vsphere.common.vim.helpers.vim_utils import ( 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 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. 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 Note: the sample needs an existing library item with an OVF template
@ -44,6 +40,7 @@ class DeployOvfTemplate:
""" """
def __init__(self): def __init__(self):
SampleBase.__init__(self, self.__doc__)
self.servicemanager = None self.servicemanager = None
self.client = None self.client = None
self.helper = None self.helper = None
@ -52,38 +49,35 @@ class DeployOvfTemplate:
self.vm_obj = None self.vm_obj = None
self.vm_name = None self.vm_name = None
def setup(self): def _options(self):
parser = sample_cli.build_arg_parser() self.argparser.add_argument('-n',
parser.add_argument('-n', '--vm_name', '--vm_name',
action='store', help='Name of the testing vm.')
help='Name of the testing vm') self.argparser.add_argument('-clustername',
parser.add_argument('-clustername',
'--clustername', '--clustername',
help='The name of the cluster to be used.') help='The name of the cluster to be used.')
parser.add_argument('-libitemname', self.argparser.add_argument('-libitemname',
'--libitemname', '--libitemname',
help='The name of the library item to deploy.' help='The name of the library item to deploy.'
'The library item should contain an OVF package.') '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 # Default VM name
self.vm_name = 'vm-' + str(generate_random_uuid()) 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 # Find the cluster's resource pool moid
cluster_obj = get_obj(self.servicemanager.content, cluster_obj = get_obj(self.servicemanager.content,
[vim.ClusterComputeResource], self.cluster_name) [vim.ClusterComputeResource], self.cluster_name)
@ -143,7 +137,7 @@ class DeployOvfTemplate:
for error in result.error.errors: for error in result.error.errors:
print('OVF error: {}'.format(error.message)) print('OVF error: {}'.format(error.message))
def cleanup(self): def _cleanup(self):
if self.vm_obj is not None: if self.vm_obj is not None:
# Power off the VM and wait for the power off operation to complete # Power off the VM and wait for the power off operation to complete
poweroff_vm(self.servicemanager.content, self.vm_obj) poweroff_vm(self.servicemanager.content, self.vm_obj)
@ -153,9 +147,7 @@ class DeployOvfTemplate:
def main(): def main():
deploy_ovf_sample = DeployOvfTemplate() deploy_ovf_sample = DeployOvfTemplate()
deploy_ovf_sample.setup() deploy_ovf_sample.main()
deploy_ovf_sample.execute()
deploy_ovf_sample.cleanup()
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -13,10 +13,10 @@ setup(name='vSphere Automation SDK',
packages=[], packages=[],
install_requires=[ install_requires=[
'lxml >= 4.3.0', 'lxml >= 4.3.0',
'pyVmomi <=7.0.3,>=6.7', 'pyVmomi >=6.7',
'vapi-runtime @ file://localhost/{}/lib/vapi-runtime/vapi_runtime-2.37.0-py2.py3-none-any.whl'.format(os.getcwd()), 'vapi-runtime @ file://localhost/{}/lib/vapi-runtime/vapi_runtime-2.40.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()), '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.37.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()), '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-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()), '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()),

View File

@ -2,4 +2,4 @@ pytest==3.9.1
pycodestyle pycodestyle
pexpect pexpect
asn1crypto asn1crypto
setuptools>=61.0.0 setuptools>=62.3.2