openstack.identity.v3.project

项目类

项目 (Project) 类继承自 Resource

class openstack.identity.v3.project.Project(_synchronized=False, connection=None, **attrs)

基础资源

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

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

resource_key = 'project'

资源的单数形式的键。

resources_key = 'projects'

资源的复数形式的键。

base_path = '/projects'

此资源的 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。类型: 字符串

is_domain

指示项目是否也充当域。如果设置为 True,则该项目将同时充当项目和域。默认值为 False。3.6 版本新增

is_enabled

将此属性设置为 False 可防止用户针对此项目进行授权。此外,所有针对该项目预先授权的令牌将立即失效。重新启用项目不会重新启用预先存在的令牌。类型: 布尔值

options

项目的资源选项。可用的资源选项是不可变的。

parent_id

项目的父 ID。3.4 版本新增

与项目资源相关的链接。

assign_role_to_user(session, user, role, inherited)

将角色分配给项目中的用户

validate_user_has_role(session, user, role, inherited)

验证用户是否在项目上拥有角色

unassign_role_from_user(session, user, role, inherited)

从项目中的用户取消分配角色

assign_role_to_group(session, group, role, inherited)

将角色分配给项目中的组

validate_group_has_role(session, group, role, inherited)

验证组是否在项目上拥有角色

unassign_role_from_group(session, group, role, inherited)

从项目中的组取消分配角色

associate_endpoint(session, endpoint_id)

将端点与项目关联。

参数:
  • session – 用于进行此请求的会话。

  • endpoint_id – 端点的 ID。

返回值:

disassociate_endpoint(session, endpoint_id)

将端点从项目取消关联。

参数:
  • session – 用于进行此请求的会话。

  • endpoint_id – 端点的 ID。

返回值: