Add missing properties for role

* Domain_id is the base property for role.
* Description was added to role recently[1].

Add the support to openstacksdk.

[1]: I230af9cc833af13064636b5d9a7ce6334c3f6e9a

Change-Id: I700413c7f166c57af75a69ad65947b396ae290f9
This commit is contained in:
wangxiyuan 2018-11-01 16:14:52 +08:00
parent cdef4806ce
commit 5df573b6c2
3 changed files with 13 additions and 0 deletions

View File

@ -32,5 +32,9 @@ class Role(resource.Resource):
# Properties
#: Unique role name, within the owning domain. *Type: string*
name = resource.Body('name')
#: User-facing description of the role. *Type: string*
description = resource.Body('description')
#: References the domain ID which owns the role. *Type: string*
domain_id = resource.Body('domain_id')
#: The links for the service resource.
links = resource.Body('links')

View File

@ -19,6 +19,8 @@ EXAMPLE = {
'id': IDENTIFIER,
'links': {'self': 'http://example.com/user1'},
'name': '2',
'description': 'test description for role',
'domain_id': 'default'
}
@ -50,3 +52,5 @@ class TestRole(base.TestCase):
self.assertEqual(EXAMPLE['id'], sot.id)
self.assertEqual(EXAMPLE['links'], sot.links)
self.assertEqual(EXAMPLE['name'], sot.name)
self.assertEqual(EXAMPLE['description'], sot.description)
self.assertEqual(EXAMPLE['domain_id'], sot.domain_id)

View File

@ -0,0 +1,5 @@
---
features:
- |
Added the newly supported ``description`` parameter and the missing
``domain_id`` parameter to ``Role`` resource.