Created
April 20, 2021 20:20
-
-
Save gbossert/4454c44eca7784d4898d2de9158e40dc to your computer and use it in GitHub Desktop.
How to connect on OVH Object Storage with Python Apache Libcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# | |
# third parties | |
from libcloud.storage.types import Provider | |
from libcloud.storage.providers import get_driver | |
my_username = "HORIZON-USERNAME" | |
my_password = "HORIZON-PASSWORD-FOR-MY-USERNAME" | |
my_tenant_name = "TENANT_NAME_I_CAN_FIND_IN_OVH_GENERATED_OPENRC_FILE" | |
cls = get_driver(Provider.OPENSTACK_SWIFT) | |
driver = cls( | |
key=my_username, | |
secret=my_password, | |
ex_force_service_region='GRA', | |
ex_force_auth_url="https://auth.cloud.ovh.net/v3/auth/tokens", | |
ex_force_auth_version='3.x_password', | |
ex_tenant_name=my_tenant_name | |
) | |
driver.list_containers() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment