openstack.identity.v3.group

Group 类

The Group 类继承自 Resource

class openstack.identity.v3.group.Group(_synchronized=False, connection=None, **attrs)

基础资源

参数:
  • _synchronized (bool) – 这不打算直接使用。请参阅 new()existing()

  • connection (openstack.connection.Connection) – 对正在使用的 Connection 的引用。默认为 None,允许在单元测试中等情况下使用不带活动 Connection 的 Resource 对象。Resource 代码中对 self._connection 的使用应使用 None 检查进行保护。

resource_key = 'group'

资源的单数形式的键。

resources_key = 'groups'

资源的复数形式的键。

base_path = '/groups'

此资源的 URI 的基本部分。

allow_create = True

允许对此资源进行创建操作。

allow_fetch = True

允许对此资源进行获取操作。

allow_commit = True

允许对此资源进行更新操作。

allow_delete = True

允许对此资源进行删除操作。

allow_list = True

允许对此资源进行列表操作。

commit_method = 'PATCH'

提交资源的 HTTP 方法 (PUT、PATCH、POST)

description

此组的描述。类型:字符串

domain_id

引用拥有该组的域 ID;如果客户端未指定域 ID,则 Identity 服务实现将默认使用客户端令牌的作用域内的域 ID。类型:字符串

name

在拥有域内的唯一组名。类型:字符串

add_user(session, user)

将用户添加到组

remove_user(session, user)

从组中删除用户

check_user(session, user)

检查用户是否属于该组

UserGroup 类

The UserGroup 类继承自 Group

class openstack.identity.v3.group.UserGroup(_synchronized=False, connection=None, **attrs)

基础资源

参数:
  • _synchronized (bool) – 这不打算直接使用。请参阅 new()existing()

  • connection (openstack.connection.Connection) – 对正在使用的 Connection 的引用。默认为 None,允许在单元测试中等情况下使用不带活动 Connection 的 Resource 对象。Resource 代码中对 self._connection 的使用应使用 None 检查进行保护。

base_path = '/users/%(user_id)%/groups'

此资源的 URI 的基本部分。

user_id

来自资源 URI 的用户 ID

allow_create = False

允许对此资源进行创建操作。

allow_fetch = False

允许对此资源进行获取操作。

allow_commit = False

允许对此资源进行更新操作。

allow_delete = False

允许对此资源进行删除操作。

allow_list = True

允许对此资源进行列表操作。