简体   繁体   English

我如何使用本地python代码从ibm对象存储中获取容器

[英]how do i get a container from ibm object storage using a local python code

i'm writing a python code to get a list of containers from my ibm object storage that i have created. 我正在编写python代码,以从我创建的ibm对象存储中获取容器列表。

i have installed swiftclient,keystoneclient as well as cerftifi pyopenssl packages. 我已经安装了swiftclient,keystoneclient以及cerftifi pyopenssl软件包。

import swiftclient.client as swiftclient

auth_url = "<auth_url>"
project_id = "<Project_id>"
user_id = "<user_id>"
region_name = "<region_name>"
password = "<password>"
conn = swiftclient.Connection(
        key = password,
        authurl = auth_url,
        auth_version = '3',
        os_options = {"project_id": project_id,
                      "user_id": user_id,
                      "region_name": region_name})



for container in conn.get_account():
    print(container['name'])

i wanted to get the name of the container instead it is giving me an error like access forbidden. 我想获取容器的名称,但它给了我一个错误,例如禁止访问。

请在IBM Cloud控制台中打开支持凭单以查看您的帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python:如何为IBM Cloud Object Storage生成预签名URL? - Python: How do I generate presigned URLs for IBM Cloud Object Storage? 如何使用python请求包从oracle云存储经典容器中下载文件夹的内容? - How do I download contents of a folder from oracle cloud storage classic container using the requests package for python? 如何从存储桶中获取所有文件 - IBM Cloud Object Storage? - How to get all files from a Bucket - IBM Cloud Object Storage? 使用Python的IBM对象存储 - IBM Object Storage with Python Kubernetes:如何使用python获取容器的状态并重新启动? - Kubernetes: How do I get the status and restarts of a container using python? 如何获取用Python编写的Azure Worker角色的本地存储位置? - How do I get the location of Local Storage for an Azure Worker Role written in Python? 如何使用 Python 从本地交易所获取历史股价数据? - How do I get historical stock price data from a local exchange using Python? 如何从本地python应用访问Google云存储? - How do I access google cloud storage from local python app? 无法使用 python 在 IBM Cloud object 存储中检索存储桶名称 - Cannot retrieve bucket name in IBM Cloud object storage using python 使用 python 将文件上传到 IBM 云 object 存储时出错 - error while uploading file to IBM cloud object storage using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM