keystone.catalog.backends.sql 模块

class keystone.catalog.backends.sql.Catalog[source]

基类: CatalogDriverBase

add_endpoint_group_to_project(endpoint_group_id, project_id)[source]

添加端点组到项目的关联。

参数:
  • endpoint_group_id (string) – 要关联的端点的标识

  • project_id (string) – 要关联的项目标识

引发:

keystone.exception.Conflict – 如果端点组已添加到该项目。

返回值:

None。

add_endpoint_to_project(endpoint_id, project_id)[source]

创建端点到项目的关联。

参数:
  • endpoint_id (string) – 要关联的端点标识

  • project_id (string) – 要关联的项目标识

引发:

keystone.exception.Conflict: 如果端点已添加到项目。

返回值:

None。

check_endpoint_in_project(endpoint_id, project_id)[source]

检查端点是否与项目关联。

参数:
  • endpoint_id (string) – 要检查的端点标识

  • project_id (string) – 关联的项目标识

引发:

keystone.exception.NotFound – 如果项目中未找到该端点。

返回值:

None。

create_endpoint(endpoint_id, endpoint)[source]

为服务创建一个新的端点。

引发:
create_endpoint_group(endpoint_group_id, endpoint_group)[source]

创建一个端点组。

参数:

endpoint_group (dictionary) – 要创建的端点组

引发:

keystone.exception.Conflict: 如果已经存在重复的端点组。

返回值:

一个端点组表示。

create_region(region_ref)[source]

创建一个新的区域。

引发:
create_service(service_id, service_ref)[source]

创建一个新的服务。

引发:

keystone.exception.Conflict – 如果存在重复的服务。

delete_association_by_endpoint(endpoint_id)[source]

删除与端点关联的所有端点到项目关联。

参数:

endpoint_id (string) – 要检查的端点标识

返回值:

delete_association_by_project(project_id)[source]

删除与项目关联的所有端点到项目关联。

参数:

project_id (string) – 要检查的项目标识

返回值:

delete_endpoint(endpoint_id)[source]

删除服务的端点。

引发:

keystone.exception.EndpointNotFound – 如果端点不存在。

delete_endpoint_group(endpoint_group_id)[source]

删除一个端点组。

参数:

endpoint_group_id (string) – 要删除的端点组标识

引发:

keystone.exception.NotFound – 如果未找到该端点组。

返回值:

None。

delete_endpoint_group_association_by_project(project_id)[source]

删除端点组到项目关联。

参数:

project_id (string) – 要检查的项目标识

返回值:

delete_region(region_id)[source]

删除现有的区域。

引发:

keystone.exception.RegionNotFound – 如果该区域不存在。

delete_service(service_id)[source]

删除现有的服务。

引发:

keystone.exception.ServiceNotFound – 如果服务不存在。

get_catalog(user_id, project_id)[source]

检索并格式化 V2 服务目录。

参数:
  • user_id – 已通过身份验证以创建服务目录的用户 ID。

  • project_id – 项目 ID。如果调用是为了创建一个域作用域令牌中的目录,则 ‘project_id’ 将为 None。在这种情况下,任何需要项目 ID 作为其 URL 部分的端点都将被跳过(如果因此,整个服务没有有效的端点)。

返回值:

一个嵌套字典,表示服务目录或一个空字典。

get_endpoint(endpoint_id)[source]

按 ID 获取端点。

返回值:

endpoint_ref 字典

引发:

keystone.exception.EndpointNotFound – 如果端点不存在。

get_endpoint_group(endpoint_group_id)[source]

获取一个端点组。

参数:

endpoint_group_id (string) – 要检索的端点组标识

引发:

keystone.exception.NotFound – 如果未找到该端点组。

返回值:

一个端点组表示。

get_endpoint_group_in_project(endpoint_group_id, project_id)[source]

获取端点组到项目的关联。

参数:
  • endpoint_group_id (string) – 要检索的端点组标识

  • project_id (string) – 要关联的项目标识

引发:

keystone.exception.NotFound – 如果未找到端点组到项目的关联。

返回值:

一个项目端点组表示。

get_region(region_id)[source]

按 ID 获取区域。

返回值:

region_ref 字典

引发:

keystone.exception.RegionNotFound – 如果该区域不存在。

get_service(service_id)[source]

按 ID 获取服务。

返回值:

service_ref 字典

引发:

keystone.exception.ServiceNotFound – 如果服务不存在。

get_v3_catalog(user_id, project_id)[source]

检索并格式化当前的 V3 服务目录。

参数:
  • user_id – 已通过身份验证以创建服务目录的用户 ID。

  • project_id – 项目 ID。如果调用是为了创建一个域作用域令牌中的目录,则 ‘project_id’ 将为 None。在这种情况下,任何需要项目 ID 作为其 URL 部分的端点都将被跳过。

返回值:

一个列表,表示服务目录或一个空列表

list_endpoint_groups(hints)[source]

列出所有端点组。

返回值:

None。

list_endpoint_groups_for_project(project_id)[source]

列出项目的所有端点组到项目关联。

参数:

project_id (string) – 要关联的项目标识

返回值:

None。

list_endpoints(hints)[source]

列出所有端点。

参数:

hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。

返回值:

端点引用列表或一个空列表。

list_endpoints_for_project(project_id)[source]

列出与项目关联的所有端点。

参数:

project_id (string) – 要检查的项目标识

返回值:

一个身份端点 ID 列表或一个空列表。

list_projects_associated_with_endpoint_group(endpoint_group_id)[source]

列出与端点组关联的所有项目。

参数:

endpoint_group_id (string) – 要关联的端点的标识

返回值:

None。

list_projects_for_endpoint(endpoint_id)[source]

列出与端点关联的所有项目。

参数:

endpoint_id (string) – 要检查的端点标识

返回值:

一个项目列表或一个空列表。

list_regions(hints)[source]

列出所有区域。

参数:

hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。

返回值:

区域引用列表或一个空列表。

list_services(hints)[source]

列出所有服务。

参数:

hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。

返回值:

服务引用列表或一个空列表。

remove_endpoint_from_project(endpoint_id, project_id)[source]

移除端点到项目的关联。

参数:
  • endpoint_id (string) – 要移除的端点的标识。

  • project_id (string) – 关联的项目标识

引发:

keystone.exception.NotFound – 如果项目中未找到该端点。

返回值:

None。

remove_endpoint_group_from_project(endpoint_group_id, project_id)[source]

移除端点到项目的关联。

参数:
  • endpoint_group_id (string) – 要关联的端点的标识

  • project_id (string) – 要关联的项目标识

引发:

keystone.exception.NotFound – 如果未找到端点组项目关联。

返回值:

None。

update_endpoint(endpoint_id, endpoint_ref)[source]

按 ID 获取端点。

返回值:

endpoint_ref 字典

引发:
update_endpoint_group(endpoint_group_id, endpoint_group)[source]

更新一个端点组。

参数:
  • endpoint_group_id (string) – 要检索的端点组标识

  • endpoint_group (dictionary) – 一个完整的或部分端点组。

引发:

keystone.exception.NotFound – 如果未找到该端点组。

返回值:

一个端点组表示。

update_region(region_id, region_ref)[source]

通过 ID 更新区域。

返回值:

region_ref 字典

引发:

keystone.exception.RegionNotFound – 如果该区域不存在。

update_service(service_id, service_ref)[source]

通过 ID 更新服务。

返回值:

service_ref 字典

引发:

keystone.exception.ServiceNotFound – 如果服务不存在。

class keystone.catalog.backends.sql.Endpoint(*args, **kwargs)[source]

基类: Base, ModelDictMixinWithExtras

attributes: list[str] = ['id', 'interface', 'region_id', 'service_id', 'url', 'legacy_endpoint_id', 'enabled']
enabled
extra
classmethod from_dict(endpoint_dict)[source]

覆盖 from_dict 以在缺少时设置 enabled。

id
interface
legacy_endpoint_id
region_id
service_id
url
class keystone.catalog.backends.sql.EndpointGroup(*args, **kwargs)[source]

基础: Base, ModelDictMixin

Endpoint Groups 表。

attributes = ['id', 'name', 'description', 'filters']
description
filters
id
mutable_attributes = frozenset({'description', 'filters', 'name'})
name
class keystone.catalog.backends.sql.ProjectEndpoint(*args, **kwargs)[source]

基础: Base, ModelDictMixin

项目-端点关系表。

attributes = ['endpoint_id', 'project_id']
endpoint_id
project_id
class keystone.catalog.backends.sql.ProjectEndpointGroupMembership(*args, **kwargs)[source]

基础: Base, ModelDictMixin

项目到端点组关系表。

attributes = ['endpoint_group_id', 'project_id']
endpoint_group_id
project_id
class keystone.catalog.backends.sql.Region(*args, **kwargs)[source]

基类: Base, ModelDictMixinWithExtras

attributes: list[str] = ['id', 'description', 'parent_region_id']
description
endpoints
extra
id
parent_region_id
class keystone.catalog.backends.sql.Service(*args, **kwargs)[source]

基类: Base, ModelDictMixinWithExtras

attributes: list[str] = ['id', 'type', 'enabled']
enabled
endpoints
extra
id
type