Skip to content

Commit 2b2a795

Browse files
Merge pull request #441 from vmware/revert-440-master
Revert "vSphere Automation SDK Python 9.0.0.0 release"
2 parents 3e4e57d + 1b030e7 commit 2b2a795

File tree

130 files changed

+7633
-2751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+7633
-2751
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following information must be included in the README.md or in the sample doc
1515
* Author Name
1616
* This can include full name, email address or other identifiable piece of information that would allow interested parties to contact author with questions.
1717
* Compatible vCenter version
18-
* This should be the vCenter version when the API is introduced, something like "7.0"+.
18+
* This should be the vCenter version when the API is introduced, something like "6.5+" or "6.8.1+".
1919
* Minimal/High Level Description
2020
* What does the sample do ?
2121
* Any KNOWN limitations or dependencies

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2025 Broadcom, Inc.
3+
Copyright (c) 2016-2024 Broadcom, Inc.
44

55
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:
66

README.md

Lines changed: 67 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# VMware vSphere Automation SDK for Python
2+
[![Build Status](https://travis-ci.com/vmware/vsphere-automation-sdk-python.svg?token=v9mEJjcpDiQ9DrYbzyaQ&branch=master)](https://travis-ci.com/vmware/vsphere-automation-sdk-python)
23

34
## Table of Contents
45
- [Abstract](#abstract)
56
- [Supported vCenter Releases](#supported-onprem-vcenter-releases)
67
- [Supported NSX-T Releases](#supported-nsx-t-releases)
8+
- [VMware Cloud on AWS Support](#vmware-cloud-on-aws-support)
79
- [Quick Start Guide](#quick-start-guide)
810
- [Run SDK Samples](#run-sdk-samples)
911
- [API Documentation](#api-documentation)
@@ -12,24 +14,22 @@
1214
- [Repository Administrator Resources](#repository-administrator-resources)
1315
- [VMware Resources](#vmware-resources)
1416

15-
## IMPORTANT NOTICE
16-
Starting with VCF release 9.0.0.0, the vSphere Automation Python SDK repository now includes only the NSX on-prem libraries.
17-
18-
Please use the official [VCF Python SDK](https://github.com/vmware/vcf-sdk-python).
19-
2017
## Abstract
2118
This document describes the vSphere Automation Python SDK samples that use the vSphere Automation
2219
python client library. Additionally, some of the samples demonstrate the combined use of the
2320
vSphere Automation and vSphere APIs. To support this combined use, the vSphere Automation Python SDK
2421
samples require the vSphere Management SDK packages (pyVmomi) to be installed on the client.
25-
The samples have been developed to work with python 3.9+
22+
The samples have been developed to work with python 3.8+
2623

2724
## Supported OnPrem vCenter Releases
28-
vCenter 7.0, 7.0U1, 7.0U2, 7.0U3 , 8.0, 8.0U1, 8.0U2, 8.0U3, 9.0.0.0
25+
vCenter 7.0, 7.0U1, 7.0U2, 7.0U3 , 8.0, 8.0U1, 8.0U2, 8.0U3
2926
Please refer to the notes in each sample for detailed compatibility information.
3027

3128
## Supported NSX-T Releases
32-
NSX-T 2.2 - 4.2.0
29+
NSX-T 2.2 - 4.2.0 and VMC 1.7 - 1.24
30+
31+
## Latest VMware Cloud on AWS Release:
32+
VMC M24 (1.24) ([Release Notes](https://docs.vmware.com/en/VMware-Cloud-on-AWS/0/rn/vmc-on-aws-relnotes.html))
3333

3434
## Quick Start Guide
3535

@@ -47,7 +47,7 @@ SDK package installation commands may differ depending on the environment where
4747
**NOTE:** The SDK also requires OpenSSL 1.0.1+ in order to support TLS1.1 & 1.2
4848

4949
##### 1. Typical Installation
50-
This is the recommended way to install the SDK. The installation is done from [PyPI](https://pypi.org/) and [Automation SDK Python GitHub](https://github.com/vmware/vsphere-automation-sdk-python) repositories.
50+
This is the recommended way to install the SDK. The installation is done from [PyPI](https://pypi.org/) and [Automation SDK Python Github](https://github.com/vmware/vsphere-automation-sdk-python) repositories.
5151

5252
Install/Update latest pip from PyPI.
5353
```cmd
@@ -65,11 +65,6 @@ pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-pytho
6565
##### 2. Local installation
6666
Local installation can be used in an environment which either do not have Github access or users do not want to install from Github repository.
6767

68-
Install all the wheel files from SDK's lib directory.
69-
```cmd
70-
pip install -U lib/*/*.whl
71-
```
72-
Install dependencies like *lxml* and *pyvmomi* from PyPI as other requirements were installed from SDK's lib directory.
7368
```cmd
7469
pip install -U <SDK_DIRECTORY_PATH>
7570
```
@@ -78,7 +73,7 @@ e.g.
7873
```
7974
pip install -U vsphere-automation-sdk-python
8075
Or
81-
pip install -U vsphere-automation-sdk-python-9.0.0.0.zip
76+
pip install -U vsphere-automation-sdk-python-8.0.0.0.zip
8277
```
8378
##### 3. Installation in an air gap environment
8479
For this type of environment an additional step is required to ensure SDK's dependencies are available.
@@ -147,20 +142,53 @@ Type "help", "copyright", "credits" or "license" for more information.
147142

148143
**NOTE:** If you are using Bash, be sure to use single quote for username and password to preserve the values. If you use double quote, you will have to escape special characters, such as "$". See [Bash manual](http://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html)
149144

145+
### Connect to VMware Cloud on AWS
146+
147+
```python
148+
from vmware.vapi.vmc.client import create_vmc_client
149+
150+
# Connect to VMware Cloud on AWS using refresh token
151+
vmc_client = create_vmc_client('<refresh_token>')
152+
153+
# Get organizations associated with calling user.
154+
vmc_client.Orgs.list()
155+
```
156+
157+
Output in a Python Interpreter:
158+
159+
```shell
160+
(venv) het-m03:vsphere-automation-sdk-python het$ python
161+
Python 3.9.8 (main, Nov 10 2021, 06:03:50)
162+
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
163+
Type "help", "copyright", "credits" or "license" for more information.
164+
>>> from vmware.vapi.vmc.client import create_vmc_client
165+
>>> vmc_client = create_vmc_client('<refresh_token>')
166+
>>> vmc_client.Orgs.list()
167+
[Organization(updated=datetime.datetime(2018, 3, 2, 16, 57, 46), user_id='77aa6e6f-3257-3637-9cd9-14fae3a25b9d', updated_by_user_id='2021b5ae-890b-3472-ba9a-bc8cff776ca7', created=datetime.datetime(2017, 4, 4, 11, 57, 48, 861), version=15, updated_by_user_name='mdreyer@vmware.com', user_name='pgifford@vmware.com', id='2a8ac0ba-c93d-4748-879f-7dc9918beaa5', display_name='VMC-SET', name='j13hqg73', sla='VMC_INTERNAL', project_state='CREATED', properties=OrgProperties(values={'defaultAwsRegions': 'US_WEST_2,US_EAST_1', 'sddcLimit': '5', 'planVersion': '3.0', 'defaultHostsPerSddc': '4', 'invitationCode': '/csp/gateway/slc/api/service-invitations/aa7203c3617bbe755597b8b0ad652', 'enableAWSCloudProvider': 'true', 'enableZeroCloudCloudProvider': 'true', 'accountLinkingOptional': 'false', 'defaultPDXDatacenter': 'pdx2', 'skipSubscriptionCheck': 'true', 'minHostsPerSddc': '4', 'maxHostsPerSddc': '8', 'hostLimit': '16', 'maxHostsPerSddcOnCreate': '4', 'isAllAccess': 'true', 'enabledAvailabilityZones': '{"us-east-1":["iad6","iad7","iad12"],"us-west-2":["pdx1", "pdx4", "pdx2"]}'}), cloud_configurations={'AWS': AwsOrgConfiguration(provider='AWS')})
168+
...]
169+
```
170+
150171
## Run SDK Samples
151172

152-
In this section we will walk you through the steps to run the sample code for vSphere.
173+
In this section we will walk you through the steps to run the sample code for vSphere
174+
and VMware Cloud on AWS APIs.
153175

154176
### First, set PYTHONPATH to use SDK helper methods
155177

156178
* Linux/Mac:
157179

158-
export PYTHONPATH=\$\{PWD\}:\$PYTHONPATH
180+
export PYTHONPATH=${PWD}:$PYTHONPATH
159181

160182
* Windows:
161183

162184
set PYTHONPATH=%cd%;%PYTHONPATH%
163185

186+
### Run VMware Cloud on AWS Samples
187+
188+
```cmd
189+
$ python samples/vmc/orgs/organization_operations.py -r <refresh_token>
190+
```
191+
164192
### Run vSphere Samples
165193

166194
A vSphere test environment is required with the following configuration:
@@ -181,7 +209,7 @@ Before executing the samples we'll need to setup the vSphere test environment us
181209
* Create a Distributed Switch
182210
* Create a Distributed Portgroup
183211
* Attach the NFS datastore (if Selected) to the hosts
184-
* Copy the [Photon OS](https://vmware.github.io/photon/) ISO image downloaded from [VMware's bintray server](https://github.com/vmware/photon/wiki/Downloading-Photon-OS#downloading-photon-os-50-ga) to the datastore
212+
* Copy the [Photon OS](https://vmware.github.io/photon/) ISO image downloaded from [VMware's bintray server](https://dl.bintray.com/vmware/photon) to the datastore
185213
* Create directories to add sample ports
186214

187215
First, edit settings in samples/vsphere/vcenter/setup/testbed.py and replace everything in < > brackets with your environment information. Leave the rest of the settings in this file at their default values.
@@ -232,18 +260,27 @@ $ python samples/vsphere/vcenter/vm/list_vms.py -v
232260
### vSphere API Documentation
233261

234262
* [VMware vSphere REST API Reference documentation](https://developer.broadcom.com/xapis/vsphere-automation-api/latest/)
235-
* Previous Releases:
236-
[8.0 U3](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.3.0/),
237-
[8.0 U2](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.2.0/),
238-
[8.0 U1](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.1.0/),
239-
[8.0 GA](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.1/),
263+
* [vSphere 8.0 U3 Python APIs (latest)](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.3.0/)
264+
* Previous Releases: vSphere [8.0 U2](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.2.0/)
265+
[8.0 U1](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.1.0/)
266+
[8.0 GA](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.1/)
240267
[8.0.0.0](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/8.0.0.0/),
241-
[7.0 U3](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.3.0/),
268+
[7.0 U3](https://vmware.github.io/vsphere-automation-sdk-python/vsphere/7.0.3.0/)
242269
[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/).
243270

271+
### VMware Cloud on AWS API Documentation
272+
273+
* [VMware Cloud on AWS REST APIs](https://developer.broadcom.com/xapis/vmware-cloud-on-aws-api-reference/latest/)
274+
* [VMware Cloud on AWS Console Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/vmc/index.html)
275+
* [VMware Cloud on AWS Disaster Recovery as a Service (DRaaS) Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/vmc-draas/index.html)
276+
244277

245278
### NSX API Documentation
246-
* [VMware NSX-T Data Center REST API](https://developer.broadcom.com/xapis/nsx-t-data-center-rest-api/latest/)
279+
* [NSX-T Data Center](https://docs.vmware.com/en/VMware-NSX-T-Data-Center/index.html)
280+
* [NSX Manager Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/nsx/nsx/index.html) - API for managing NSX-T cluster and transport nodes for on-prem customers
281+
* [NSX Policy Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/nsx/nsx_policy/index.html) - primary API for managing logical networks for on-prem customers
282+
* [NSX VMC Policy Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/nsx/nsx_vmc_policy/index.html) - primary API for managing logical networks for VMC customers
283+
* [NSX VMC AWS Integration Python APIs](https://vmware.github.io/vsphere-automation-sdk-python/nsx/nsx_vmc_aws_integration/index.html) - API for managing AWS underlay networks for VMC customers
247284

248285
## Troubleshooting
249286

@@ -270,5 +307,9 @@ Members:
270307

271308
## VMware Resources
272309

310+
* [vSphere Automation SDK Overview](http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.vapi.progguide.doc/GUID-AF73991C-FC1C-47DF-8362-184B6544CFDE.html)
311+
* [VMware Sample Exchange](https://code.vmware.com/samples) It is highly recommended to add any and all submitted samples to the VMware Sample Exchange
312+
* [VMware Code](https://code.vmware.com/home)
313+
* [VMware Developer Community](https://communities.vmware.com/community/vmtn/developer)
273314
* VMware vSphere [REST API Reference documentation](https://developer.broadcom.com/xapis/vsphere-automation-api/latest/).
274-
* [VMware Developer Community](https://community.broadcom.com/vmware-code/home)
315+
* [VMware Python forum](https://code.vmware.com/forums/7508/vsphere-automation-sdk-for-python)

lib/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
21
# SDK libraries
32

43
For python developers, client libraries are supplied for testing and development purposes. All the supplied libraries are located under lib directory.
54

65
Name | Description
76
------------------------------------| -------------
7+
vmwarecloud_aws | Client stubs for VMware Cloud on AWS Console APIs
8+
vmwarecloud_draas | Client stubs for VMware Cloud (VMC) Disaster Recovery as a Service (DRaaS) APIs
89
nsx-python-sdk | Client stubs for VMware NSX-T APIs
9-
nsx-policy-python-sdk | Client stubs for VMware NSX-T Policy APIs
10+
nsx-vmc-policy-python-sdk | Client stubs for VMware NSX-T on VMC Policy APIs
11+
nsx-vmc-aws-integration-python-sdk | Client stubs for VMware NSX-T AWS integration app APIs (for AWS underlay management)

lib/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<html>
2+
<head><title>Simple Index</title>
3+
<meta name='api-version' value='2'/>
4+
</head>
5+
<body>
6+
<a href='vmwarecloud-aws/'>vmwarecloud-aws</a><br/>
7+
<a href='vmwarecloud-draas/'>vmwarecloud-draas</a><br/>
8+
<a href='nsx-python-sdk/'>nsx-python-sdk</a><br/>
9+
<a href='nsx-policy-python-sdk/'>nsx-policy-python-sdk</a><br/>
10+
<a href='nsx-vmc-policy-python-sdk/'>nsx-vmc-policy-python-sdk</a><br/>
11+
<a href='nsx-vmc-aws-integration-python-sdk/'>nsx-vmc-aws-integration-python-sdk</a><br/>
12+
</body>
13+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href='nsx_vmc_aws_integration_python_sdk-4.1.2.0.1-py2.py3-none-any.whl'>nsx_vmc_aws_integration_python_sdk-4.1.2.0.1-py2.py3-none-any.whl</a><br />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href='nsx_vmc_policy_python_sdk-4.1.2.0.1-py2.py3-none-any.whl'>nsx_vmc_policy_python_sdk-4.1.2.0.1-py2.py3-none-any.whl</a><br />
Binary file not shown.
132 KB
Binary file not shown.

0 commit comments

Comments
 (0)