我正在寻找一个小代码来获取我所有的项目配额限制。从openstacksdk
开发存储库我可以看到有一个名为的连接compute.v2.limits
,但使用该连接我得到如下所示的空白输出。
import openstack
import openstack.compute.v2.limits
import os
import datetime
################## getting limits ##########################
ip='10.6.X.X'
auth_url_domain="https://10.6.X.X:13000/v3"
conn = openstack.connect(auth_url=auth_url_domain, project_name="admin", username="admin", domain_name="default",password="XXXXXX", cacert="/root/app/cacrt/cacrt/ca.crt10.6.X.X.pem")
data=openstack.compute.v2.limits.AbsoluteLimits(session=conn)
print(data.to_dict())
我得到的输出(键没问题,但值没有。我希望值应该按照为所有项目设置的值):
{'server_groups': None, 'keypairs': None, 'total_ram_used': None,
'total_cores': None, 'instances_used': None, 'total_cores_used': None,
'instances': None, 'id': None, 'security_groups': None,
'total_ram': None, 'floating_ips': None, 'location': None,
'personality_size': None, 'server_groups_used': None,
'personality': None, 'security_group_rules': None,
'name': None, 'server_group_members': None, 'floating_ips_used': None,
'image_meta': None, 'server_meta': None, 'security_groups_used': None}