1. 程式人生 > >Python 之 連接VCENTER

Python 之 連接VCENTER

con min ssl serve reat default word imp 3.1

代碼
#Author Kang

import ssl
import pysphere
from pysphere import VIServer

ssl._create_default_https_context = ssl._create_unverified_context
host_ip = ‘10.3.152.88‘
username = ‘[email protected]‘
passwd = ‘password‘

server = VIServer()
server.connect(host_ip,username,passwd)

print server.get_api_type()
print server.get_api_version()

server.disconnect()

#結果
VirtualCenter
6.5

Python 之 連接VCENTER