[Openstack] [openstack][keystone] keystone api can not list all tenants

Liao Tonglang liaotonglang at gmail.com
Thu Aug 4 12:00:29 UTC 2016


Hi,

I want to get all tenants of my openstack server, but the api just return
one of them:

    curl -H "X-Auth-Token:<token-of-admin>" \
	    http://187.160.2:5000/v2.0/tenants
		
and it just return one:
    {
		"tenants_links": [],
		"tenants": 
			[{
				"description": "admin tenant",
				"enabled": true,
				"id": "8deb55590cc344bf99b2efa227e069d0",
				"name": "admin"
			}]
	}

While the command "keystone tenant-list" can do it right:

    [root at controller ~(keystone_admin)]# keystone tenant-list
    +----------------------------------+----------+---------+
    |                id                |   name   | enabled |
    +----------------------------------+----------+---------+
    | 8deb55590cc344bf99b2efa227e069d0 |  admin   |   True  |
    | c044a216fdf643dea1ece022b8122614 |   demo   |   True  |
    | 48168a537442481e8254f9c018cb3215 |   mjj    |   True  |
    | 6686ee05ec264124847ddf0da2dde217 | services |   True  |
    +----------------------------------+----------+---------+

So how can I let api do the same action as command "tenant-list"?





More information about the Openstack mailing list