diff options
| author | Ziad Sawalha <gihub@highbridgellc.com> | 2011-06-10 15:46:29 -0700 |
|---|---|---|
| committer | Ziad Sawalha <gihub@highbridgellc.com> | 2011-06-10 15:46:29 -0700 |
| commit | dc29d8b7cc9ae44322ccf6f1b6070859c96de078 (patch) | |
| tree | 8c3d8d614ab2ac7b19a60c8c555ea07bf6f64e49 | |
| parent | cfce057aaa01ed72bd84d53fe6e64b2e0f912f75 (diff) | |
| parent | d6984f31b8b14a14d321605d7ec6c5b15612d844 (diff) | |
Merge pull request #24 from yogirackspace/master
Doc changes.
| -rwxr-xr-x | bin/keystone-manage | 20 | ||||
| -rwxr-xr-x | bin/sampledata.sh | 5 | ||||
| -rwxr-xr-x[-rw-r--r--] | docs/guide/src/docbkx/identitydevguide.xml | 211 | ||||
| -rw-r--r-- | docs/guide/src/docbkx/samples/group.json | 1 | ||||
| -rw-r--r-- | docs/guide/src/docbkx/samples/group.xml | 4 | ||||
| -rw-r--r-- | docs/guide/src/docbkx/samples/groups.json | 1 | ||||
| -rw-r--r-- | docs/guide/src/docbkx/samples/groups.xml | 5 | ||||
| -rwxr-xr-x | keystone/server.py | 4 |
8 files changed, 232 insertions, 19 deletions
diff --git a/bin/keystone-manage b/bin/keystone-manage index 496d5337..582b7bf5 100755 --- a/bin/keystone-manage +++ b/bin/keystone-manage @@ -76,7 +76,7 @@ def Main(): parser.error('No object type specified for first argument') object_type = args[0] - if object_type in ['user', 'tenant', 'role', 'baseURLs' , 'token']: + if object_type in ['user', 'tenant', 'role', 'baseURLs' , 'token', 'tenant_baseURL']: pass else: parser.error('%s is not a supported object type' % object_type) @@ -309,6 +309,24 @@ def Main(): except Exception, e: print 'Error getting all BaseURLs:', str(e) return + elif object_type == "tenant_baseURL": + if command == "add": + if len(args) < 4: + parser.error("Missing arguments: baseURLs add 'tenant'\ + 'baseURL'") + + tenant_id = args[2] + baseURLs_id = args[3] + try: + object = db_models.TenantBaseURLAssociation() + object.tenant_id = tenant_id + object.baseURLs_id = baseURLs_id + object = db_api.baseurls_ref_add(object) + print "BaseURl Ref created successfully. ID=%s" % object.id + return + except Exception as exc: + print "ERROR: Failed to create BaseURL Ref: %s" % exc + return elif object_type == "token": if command == "add": if len(args) < 6: diff --git a/bin/sampledata.sh b/bin/sampledata.sh index 0238d36b..72117827 100755 --- a/bin/sampledata.sh +++ b/bin/sampledata.sh @@ -57,3 +57,8 @@ ./keystone-manage $* token add 999888777666 admin 1234 2015-02-05T00:00 ./keystone-manage $* token add 000999 admin 1234 2010-02-05T00:00 ./keystone-manage $* token add 999888777 disabled 1234 2015-02-05T00:00 + +#Tenant Role +./keystone-manage $*tenant_baseURL add 1234 1 +./keystone-manage $*tenant_baseURL add 1234 2 +./keystone-manage $*tenant_baseURL add 1234 3
\ No newline at end of file diff --git a/docs/guide/src/docbkx/identitydevguide.xml b/docs/guide/src/docbkx/identitydevguide.xml index 5af5c532..e0e9ef11 100644..100755 --- a/docs/guide/src/docbkx/identitydevguide.xml +++ b/docs/guide/src/docbkx/identitydevguide.xml @@ -133,15 +133,6 @@ and operators. Tenant administrators may assign roles to users. </para> </section> - <section> - <title>Group</title> - <para> - A group of users. Groups may be used to organize and assign - privileges to a group of related users. For example, an operator - may create a "delinquent" group, which will assign limited - privileges to users who have past due bills. - </para> - </section> </chapter> <chapter> <title>General API Information</title> @@ -859,6 +850,54 @@ Host: identity.api.openstack.org/v1.1/ <title>Core Admin API Proposal</title> <note>The following table of calls is proposed as core Keystone Admin APIs</note> <section> + <title>Users</title> + <informaltable rules="all"> + &LONG_URI_REFHEAD; + <tbody> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/users</td> + <td colspan="3">Create a User.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/users</td> + <td colspan="3">Get a list of users.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/users/<parameter>userId</parameter></td> + <td colspan="3">Get a user.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/users/<parameter>userId</parameter></td> + <td colspan="3">Update a user.</td> + </tr> + <tr> + <td colspan="1"> &DELETE; </td> + <td colspan="4">/users/<parameter>userId</parameter></td> + <td colspan="3">Delete a user.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/users/<parameter>userId</parameter>/<parameter>password</parameter></td> + <td colspan="3">Update a user password.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/users/<parameter>userId</parameter>/<parameter>enabled</parameter></td> + <td colspan="3">Enable/Disable user.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/users/<parameter>userId</parameter>/<parameter>tenant</parameter></td> + <td colspan="3">Update user tenant.</td> + </tr> + </tbody> + </informaltable> + </section> + <section> <title>Tokens</title> <informaltable rules="all"> &LONG_URI_REFHEAD; @@ -887,15 +926,36 @@ Host: identity.api.openstack.org/v1.1/ <td colspan="4">/tenants</td> <td colspan="3">Get a list of tenants.</td> </tr> - <tr> - <td colspan="1"> &GET; </td> - <td colspan="4">/tenants/<parameter>tenantId</parameter></td> - <td colspan="3">Get a tenant.</td> - </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter></td> + <td colspan="3">Get a tenant.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/tenants</td> + <td colspan="3">Create a tenant.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter></td> + <td colspan="3">Update a tenant.</td> + </tr> + <tr> + <td colspan="1"> &DELETE; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter></td> + <td colspan="3">Delete a tenant.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/users</td> + <td colspan="3">get tenant users.</td> + </tr> + </tbody> </informaltable> - </section> - + </section> + <section> <title>Endpoints (BaseURLs)</title> <informaltable rules="all"> @@ -1008,6 +1068,7 @@ Host: identity.api.openstack.org/v1.1/ </tbody> </informaltable> </section> + <important>All other APIs listed in this section will be extensions used for this reference implementation of Keystone to support user and tenant management</important> </section> @@ -1676,4 +1737,122 @@ Host: identity.api.openstack.org/v1.1/ </section> </section> </chapter> + + <chapter> + <title>Appendix</title> + <section> + <title>Rackspace Extenison Proposal</title> + <section> + <title>Concepts</title> + <para> + The concepts that are specific to rackspace extensions are: + </para> + <section> + <title>Group</title> + <para> + A group of users. Groups may be used to organize and assign + privileges to a group of related users. For example, an operator + may create a "delinquent" group, which will assign limited + privileges to users who have past due bills. + </para> + </section> + </section> + + <note>The following table of calls is proposed as rackspace specific extensions for Keystone APIs</note> + + <section> + <title>Global Groups</title> + <informaltable rules="all"> + &LONG_URI_REFHEAD; + <tbody> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/groups</td> + <td colspan="3">Create a global group.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/groups</td> + <td colspan="3">Get a list of global groups.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/groups/<parameter>groupId</parameter></td> + <td colspan="3">Get a global group.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/groups/<parameter>groupId</parameter></td> + <td colspan="3">Update a global group.</td> + </tr> + <tr> + <td colspan="1"> &DELETE; </td> + <td colspan="4">/groups<parameter>/groupId</parameter></td> + <td colspan="3">Delete a global group.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/groups/<parameter>groupId</parameter>/users</td> + <td colspan="3">Get a list of users of a global group.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/groups/<parameter>groupId</parameter>/users/<parameter>userId</parameter></td> + <td colspan="3">Add user to a global group.</td> + </tr> + <tr> + <td colspan="1"> &DELETE; </td> + <td colspan="4">/groups/<parameter>groupId</parameter>/users/<parameter>userId</parameter></td> + <td colspan="3">Delete user from a global group.</td> + </tr> + </tbody> + </informaltable> + </section> + <section> + <title>Tenant Groups</title> + <informaltable rules="all"> + &LONG_URI_REFHEAD; + <tbody> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups</td> + <td colspan="3">Get a list of tenant groups.</td> + </tr> + <tr> + <td colspan="1"> &POST; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups</td> + <td colspan="3">Create a tenant group.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups/<parameter>groupId</parameter></td> + <td colspan="3">Get a tenant group with the specified id.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups/<parameter>groupId</parameter></td> + <td colspan="3">Update a tenant group.</td> + </tr> + <tr> + <td colspan="1"> &GET; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups/<parameter>groupId</parameter>/users</td> + <td colspan="3">get tenant group users.</td> + </tr> + <tr> + <td colspan="1"> &PUT; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups/<parameter>groupId</parameter>/users/<parameter>userId</parameter></td> + <td colspan="3">Add a user to a tenant group.</td> + </tr> + <tr> + <td colspan="1"> &DELETE; </td> + <td colspan="4">/tenants/<parameter>tenantId</parameter>/groups/<parameter>groupId</parameter>/users/<parameter>userId</parameter></td> + <td colspan="3">Delete user tenant group.</td> + </tr> + </tbody> + </informaltable> + </section> + + </section> + </chapter> + </book> diff --git a/docs/guide/src/docbkx/samples/group.json b/docs/guide/src/docbkx/samples/group.json new file mode 100644 index 00000000..07dc0a10 --- /dev/null +++ b/docs/guide/src/docbkx/samples/group.json @@ -0,0 +1 @@ +{"group": {"id": "test_global_group", "description": "A description ..."}}
\ No newline at end of file diff --git a/docs/guide/src/docbkx/samples/group.xml b/docs/guide/src/docbkx/samples/group.xml new file mode 100644 index 00000000..0f285307 --- /dev/null +++ b/docs/guide/src/docbkx/samples/group.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<group xmlns="http://docs.openstack.org/identity/api/v2.0" id="test group"> + <description>A Description of the group</description> +</group> diff --git a/docs/guide/src/docbkx/samples/groups.json b/docs/guide/src/docbkx/samples/groups.json new file mode 100644 index 00000000..06dd58a0 --- /dev/null +++ b/docs/guide/src/docbkx/samples/groups.json @@ -0,0 +1 @@ +{"groups": {"values": [{"id": "test_global_group_add", "description": "A description ..."}], "links": []}}
\ No newline at end of file diff --git a/docs/guide/src/docbkx/samples/groups.xml b/docs/guide/src/docbkx/samples/groups.xml new file mode 100644 index 00000000..a429fdb3 --- /dev/null +++ b/docs/guide/src/docbkx/samples/groups.xml @@ -0,0 +1,5 @@ +<groups xmlns="http://docs.openstack.org/identity/api/v2.0"> + <group xmlns="http://docs.openstack.org/identity/api/v2.0" id="test_global_group_add"> + <description>A Description of the group</description> + </group> +</groups> diff --git a/keystone/server.py b/keystone/server.py index 8dff1159..139a47d8 100755 --- a/keystone/server.py +++ b/keystone/server.py @@ -533,7 +533,7 @@ class KeystoneAPI(wsgi.Router): db_api.configure_db(options) # Token Operations - auth_controller = AuthController(options) + auth_controller = AuthController(options) mapper.connect("/v2.0/tokens", controller=auth_controller, action="authenticate", conditions=dict(method=["POST"])) @@ -676,7 +676,7 @@ class KeystoneAdminAPI(wsgi.Router): controller=user_controller, action="set_user_password", conditions=dict(method=["PUT"])) - mapper.connect("/v1.0/tenants/{tenant_id}/users/{user_id}/add", + mapper.connect("/v2.0/tenants/{tenant_id}/users/{user_id}/add", controller=user_controller, action="add_user_tenant", conditions=dict(method=["PUT"])) |
