LoginSignup
1
0

More than 5 years have passed since last update.

pythonでvSphere操作 その3 APIレファレンス & ヘルプ表示

Last updated at Posted at 2018-03-13

APIレファレンス

pyvmomiはVmware公式ライブラリなので、わざわざcurlやrequestせずとも容易にアクセスする手段が用意されている。
便利なサンプルも同梱されているが、ここはAPIの理解を深めるために、レファレンスから調べることにする。

レファレンス:
  https://code.vmware.com/apis/196/vsphere#/doc/index-mo_types.html

これでしたいことが大体調べられるので便利。

やりたいことを整理する。

・ログインする
・フォルダを指定する(なければ作成)
・VMの構成情報(スペック)を指定して作成する
・作成したVMの情報を確認する
・ログアウトする

ヘルプ表示

pythonでモジュールやその中のメソッドのヘルプを表示するには、importしないといけない。

tty
>>>
>>> import pyVim
>>> help(pyVim)
(ヘルプが表示される)
>>> help(pyVim.connect)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'connect'
>>> import pyVim.connect
>>> help(pyVim.connect)
(ヘルプが表示される)
>>>
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0