Libcloud is available on PyPi. You can install latest stable version using pip:
pip install apache-libcloud
You can install latest development version from our Git repository:
pip install -e git+https://git.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud
If you used pip to install the library you can also use it to upgrade it:
pip install --upgrade apache-libcloud
This section describes a standard work-flow which you follow when working with any of the Libcloud drivers.
from pprint import pprint
import libcloud
cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE)
driver = cls('my username', 'my api key')
Keep in mind that some drivers take additional arguments such as region
and api_version.
For more information on which arguments you can pass to your provider driver, see provider-specific documentation and the driver docstrings.
pprint(driver.list_sizes())
pprint(driver.list_nodes())
from pprint import pprint
import libcloud
cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE)
driver = cls('my username', 'my api key')
pprint(driver.list_sizes())
pprint(driver.list_nodes())
You can find more examples with common patterns which can help you get started on the :doc:`Compute Examples </compute/examples>` page.
The best thing to do after understanding the basic driver work-flow is to visit the documentation chapter for the API you are interested in (:doc:`Compute </compute/index>`, :doc:`Object Storage </storage/index>`, :doc:`Load Balancer </loadbalancer/index>`, :doc:`DNS </dns/index>`). Chapter for each API explains some basic terminology and things you need to know to make an effective use of that API.
After you have a good grasp of those basic concepts, you are encouraged to check the driver specific documentation (if available) and usage examples. If the driver specific documentation for the provider you are interested in is not available yet, you are encouraged to check docstrings for that driver.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。