如何获取ECS的名称空间详细信息

时间:2019-05-13 06:16:25

标签: python api amazon-ecs

我想为我的ecs-client打印名称空间。当我使用print(client.user_info.whoami())时,我得到了输出。但是,当我执行以下代码时,出现属性错误。

from ecsclient.client import Client
from ecsclient.common.multitenancy import namespace

client = Client('3',
                username='root',
                password='password',
                token_endpoint='https://abc.xyz.com:4443/login',
                ecs_endpoint='https://abc.xyz.com:4443')

print(client.namespace.get_namespaces())

错误:

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    print(client.namespace.get_namespaces())
AttributeError: 'Namespace' object has no attribute 'get_namespaces'

1 个答案:

答案 0 :(得分:0)

我使用print(client.namespace.get_namespaces())而不是使用print(client.namespace.list())并获得了名称空间列表

相关问题