Ask Your Question

Revision history [back]

Here is some python code to authenticate and add a new project/tenant. Run this python code after you install the command line utils and python.

from keystoneclient.v2_0 import client
keystone = client.Client(username="user_name", password="your_passwd", tenant_name="Demo", auth_url="http://horizon_url:5000/v2.0")
list=keystone.tenants.list()
tenant = keystone.tenants.create(tenant_name="test-1", description="My new tenant! via API and Python", enabled=True)