Registering a third party driver
Driver is considered third party if it’s not bundled with a Libcloud release.
To register a third party driver you should use provider.set_driver()
function from the corresponding component.
set_driver()
takes the following arguments:
- set_driver('provider_name', 'path.to.the.module', 'DriverClass')
Keep in mind that the provider_name needs to be unique and this functionneeds to be called before using a third party driver.
For example:
- from libcloud.compute.providers import get_driver
- from libcloud.compute.providers import set_driver
- set_driver('stratuslab',
- 'stratuslab.libcloud.stratuslab_driver',
- 'StratusLabNodeDriver')
- # Your code which uses the driver.
- # For example:
- driver = get_driver('stratuslab')
An example of an existing third party driver can be found athttps://github.com/StratusLab/libcloud-drivers
当前内容版权归 Apache Libcloud 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Apache Libcloud .