Revising tenant IDs & Names in samples (#854228)

Change-Id: Ie6dfa3b4d4107aa3e0f64ee8a16e34c9c648579d
This commit is contained in:
Dolph Mathews 2011-09-28 14:44:28 -05:00
parent e1deec3368
commit fa8f0b88c2
8 changed files with 13 additions and 14 deletions

View File

@ -205,7 +205,7 @@ in troubleshooting:
# Get a token for a tenant
$ curl -d '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantId": "1234"}}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens
$ curl -d '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantName": "customer-x"}}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens
# Get an admin token
@ -217,7 +217,7 @@ in troubleshooting:
<pre>
# Create post data
$ echo '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantId": "1234"}}' > post_data
$ echo '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantName": "customer-x"}}' > post_data
# Call Apache Bench

View File

@ -15,7 +15,7 @@
under the License.
Curl Admin API examples
=====
=======================
All examples assume default port usage (5001) and use the example admin account created
on the Getting Started page.
@ -54,7 +54,7 @@ Retrieve a list of tenants:
This will return something like::
$> {"tenants": {"values": [{"enabled": 1, "id": "MyTenant", "description": null}], "links": []}}
$> {"tenants": {"values": [{"enabled": 1, "id": "145", "name": "MyTenant", "description": null}], "links": []}}
Retrieve a list of users:
#####
@ -64,7 +64,7 @@ Retrieve a list of users:
This will return something like::
$> {"users": {"values": [{"email": null, "enabled": true, "id": "MyAdmin", "tenantId": "MyTenant"}], "links": []}}
$> {"users": {"values": [{"email": null, "enabled": true, "id": "1227", "name": "MyAdmin", "tenantId": "MyTenant"}], "links": []}}
Retrieve information about the token:
#####
@ -74,7 +74,7 @@ Retrieve information about the token:
This will return something like::
$> {"auth": {"token": {"expires": "2011-08-11T04:26:58.145171", "id": "0eed0ced-4667-4221-a0b2-24c91f242b0b"}, "user": {"username": "MyAdmin", "roleRefs": [{"roleId": "Admin", "id": 1}], "tenantId": "MyTenant"}}}
$> {"auth": {"token": {"expires": "2011-08-11T04:26:58.145171", "id": "0eed0ced-4667-4221-a0b2-24c91f242b0b"}, "user": {"username": "MyAdmin", "roles": [{"roleId": "Admin", "id": 1}], "tenant": {"id": 932, "name": "MyTenant"}}}}
Revoking a token:
#####
@ -86,7 +86,7 @@ Creating a tenant:
#####
Run::
$> curl -H "X-Auth-Token:999888777666" -H "Content-type: application/json" -d '{"tenant":{"id":"MyTenant2", "description":"My 2nd Tenant", "enabled":true}}' http://localhost:5001/tenants
$> curl -H "X-Auth-Token:999888777666" -H "Content-type: application/json" -d '{"tenant":{"id": 416, "name":"MyTenant2", "description":"My 2nd Tenant", "enabled":true}}' http://localhost:5001/tenants
This will return something like::

View File

@ -69,7 +69,7 @@ if __name__ == '__main__':
# Call the keystone service to get a token
# NOTE: assumes the test_setup.sql script has loaded this user
print "\033[91mTrying with valid test credentials...\033[0m"
auth = get_auth_token("joeuser", "secrete", "1234")
auth = get_auth_token("joeuser", "secrete", "customer-x")
obj = json.loads(auth)
token = obj["auth"]["token"]["id"]
print "Token obtained:", token

View File

@ -4,6 +4,6 @@
"username":"test_user",
"password":"mypass"
},
"tenantId":"1234"
"tenantName":"customer-x"
}
}

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<auth xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://docs.openstack.org/identity/api/v2.0"
tenantId="1234">
tenantName="customer-x">
<passwordCredentials username="test_user" password="test"/>
</auth>

View File

@ -1,6 +1,6 @@
{
"auth": {
"tenantId": "1234",
"tenantName": "customer-x",
"token": {
"id": "abcdefghijk"
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<auth xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://docs.openstack.org/identity/api/v2.0"
tenantId="1234">
tenantName="customer-x">
<token id="abcdefghijk" />
</auth>

View File

@ -7,7 +7,7 @@
}
],
"roles_links": [],
"id": "u1000",
"id": "1000",
"username": "jqsmith",
"email": "john.smith@example.org",
"enabled": true,