python keystone_Python python-keystoneclient包_程序模块 - PyPI - Python中文网

归翔
2023-12-01

快速开始:>>> from keystoneauth1.identity import v3

>>> from keystoneauth1 import session

>>> from keystoneclient.v3 import client

>>> auth = v3.Password(auth_url="http://example.com:5000/v3", username="admin",

... password="password", project_name="admin",

... user_domain_id="default", project_domain_id="default")

>>> sess = session.Session(auth=auth)

>>> keystone = client.Client(session=sess)

>>> keystone.projects.list()

[...]

>>> project = keystone.projects.create(name="test", description="My new Project!", domain="default", enabled=True)

>>> project.delete()

 类似资料: