Python OpenStack SDK获取特定实例元数据
我正在寻找一种方法,在 Python 中使用 OpenStack SDK 获取有关给定区域和项目的实例的特定元数据。我只想获取 id、名称、IP 地址和密钥名称。我想从“计算”开始
I am looking for a way, in Python to use the OpenStack SDK to get specific metadata about an instance for a given region and project. I am looking to only get the id, name, ip address and key name. I was thinking of starting with "compute"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用OpenStack Swift Python API有基本的工作,如下所示:
“ SwiftSearch.py”
以下是运行它的结果:
另外,您必须使用附加的元数据上传,如下所示:
对于我的测试,我也在使用。单个实例OpenStack Swift实例的Docker容器:
https://hub.docker.com/r/fnndsc/docker-swift-只有一个
此解决方案并不是很棒的,因为它必须获取所有元素和统计数据元素中所有元素的列表,以使其元数据进行过滤 - 订单2N算法。
I have something rudimentary working using the openstack swift python api as follows:
"swiftsearch.py"
here are the results from running it:
also, you must upload your objects with metadata attached like as follows:
also for my tests, I was using the docker container for a single instance openstack swift instance:
https://hub.docker.com/r/fnndsc/docker-swift-onlyone
This solution isn't great in that it has to get the list of all elements and stat all elements in the container to get their metadata to filter on - an order 2n algorithm.