You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@libcloud.apache.org by Dan Peschman <dp...@godaddy.com> on 2020/03/30 18:31:30 UTC
Two providers with varying arguments
Hello. Is there a standard or best practice for integrating with multiple providers that take different parameters to the same API? For instance, say we want to integrate with create_image, supporting EC2 and OpenStack drivers. EC2 takes (description=None, reboot=False, etc) parameters, OpenStack takes (metadata=None). What’s the right way to pass EC2 parameters when using EC2 and OpenStack ones to OpenStack?
Code view:
d = get_driver(type, provider)
node = ...
d.create_image(node, name, {?provider-specific-args?})
Thanks,
Dan Peschman