Skip to main content

vCenter Bindings

vCenter Bindings library contains client bindings for VMware vCenter Automation APIs. This library is part of vSphere Automation SDK for Python.

Source code | Package (PyPI) | REST API documentation

Getting started

Prerequisites

  • Python 3.8+ is required to use this package.

Install the package

pip install vcenter-bindings

Connect to a vCenter Server

import requests
import urllib3
from vmware.vapi.vsphere.client import create_vsphere_client
session = requests.session()
 
# Disable cert verification for demo purpose.
# This is not recommended in a production environment.
session.verify = False
 
# Disable the secure connection warning for demo purpose.
# This is not recommended in a production environment.
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
 
# Connect to a vCenter Server using username and password
vsphere_client = create_vsphere_client(server='<vc_ip>', username='<vc_username>', password='<vc_password>', session=session)
 
# List all VMs inside the vCenter Server
vsphere_client.vcenter.VM.list()

Output in a Python Interpreter:

(venv) het-m03:vsphere-automation-sdk-python het$ python
Python 3.9.8 (main, Nov 10 2021, 06:03:50)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> import urllib3
>>> from vmware.vapi.vsphere.client import create_vsphere_client
>>> session = requests.session()
>>> session.verify = False
>>> urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
>>> vsphere_client = create_vsphere_client(server='<vc_ip>', username='<vc_username>', password='<vc_password>', session=session)
>>> vsphere_client.vcenter.VM.list()
[Summary(vm='vm-58', name='standalone-20e4bd3af-esx.0-vm.0', power_state=State(string='POWERED_OFF'), cpu_count=1, memory_size_mib=256),
...]

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

Metadata

Release files for oab-vcenter-bindings 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oab-vcenter-bindings 4.2.0
File Size Uploaded
oab_vcenter_bindings-4.2.0.tar.gz 949.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oab-vcenter-bindings 4.2.0
File Interpreter ABI Platform
oab_vcenter_bindings-4.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 2.2 MB

Release files / oab_vcenter_bindings-4.2.0.tar.gz

Download URL oab_vcenter_bindings-4.2.0.tar.gz
Size 949.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2091e53dfa294e7f74b28bfc14d0146fca00560a17785b3b554b82cfc3b19038
BLAKE2b-256 checksum
How to use checksums
9381713e0b6298666bd1053b88b079e601e4469176a11c6773502fcd83347229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / oab_vcenter_bindings-4.2.0-py2.py3-none-any.whl

Download URL oab_vcenter_bindings-4.2.0-py2.py3-none-any.whl
Size 1.2 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
66e0fd9d9218db172e2b9273d91664f8be725c0fbccfa7237852aa5a1f3f3c7b
BLAKE2b-256 checksum
How to use checksums
a3743c6adcfc824e0301cb664b273eec6231595c3b25a6c71d2540cf9225dd2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

4.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page