keystone.catalog.backends.base module¶
- class keystone.catalog.backends.base.CatalogDriverBase[source]¶
基类:
ProviderAPIMixin目录驱动程序的接口描述。
- abstract add_endpoint_group_to_project(endpoint_group_id, project_id)[source]¶
添加端点组到项目的关联。
- 参数:
endpoint_group_id (string) – 要关联的端点标识
project_id (string) – 要关联的项目标识
- 引发:
keystone.exception.Conflict – 如果端点组已添加到该项目。
- 返回值:
None。
- abstract add_endpoint_to_project(endpoint_id, project_id)[source]¶
创建端点到项目的关联。
- 参数:
endpoint_id (string) – 要关联的端点标识
project_id (string) – 要关联的项目标识
- 引发:
keystone.exception.Conflict: 如果端点已添加到项目。
- 返回值:
None。
- abstract check_endpoint_in_project(endpoint_id, project_id)[source]¶
检查端点是否与项目关联。
- 参数:
endpoint_id (string) – 要检查的端点标识
project_id (string) – 关联的项目标识
- 引发:
keystone.exception.NotFound – 如果项目中未找到该端点。
- 返回值:
None。
- abstract create_endpoint(endpoint_id, endpoint_ref)[source]¶
为服务创建一个新的端点。
- 引发:
keystone.exception.Conflict – 如果存在重复的端点。
keystone.exception.ServiceNotFound – 如果服务不存在。
- abstract create_endpoint_group(endpoint_group)[source]¶
创建一个端点组。
- 参数:
endpoint_group (dictionary) – 要创建的端点组
- 引发:
keystone.exception.Conflict: 如果已经存在重复的端点组。
- 返回值:
一个端点组表示。
- abstract create_region(region_ref)[source]¶
创建一个新的区域。
- 引发:
keystone.exception.Conflict – 如果该区域已经存在。
keystone.exception.RegionNotFound – 如果父区域无效。
- abstract create_service(service_id, service_ref)[source]¶
创建一个新的服务。
- 引发:
keystone.exception.Conflict – 如果存在重复的服务。
- abstract delete_association_by_endpoint(endpoint_id)[source]¶
删除与端点关联的所有端点到项目关联。
- 参数:
endpoint_id (string) – 要检查的端点标识
- 返回值:
无
- abstract delete_association_by_project(project_id)[source]¶
删除与项目关联的所有端点到项目关联。
- 参数:
project_id (string) – 要检查的项目标识
- 返回值:
无
- abstract delete_endpoint(endpoint_id)[source]¶
删除服务的端点。
- 引发:
keystone.exception.EndpointNotFound – 如果端点不存在。
- abstract delete_endpoint_group(endpoint_group_id)[source]¶
删除一个端点组。
- 参数:
endpoint_group_id (string) – 要删除的端点组标识
- 引发:
keystone.exception.NotFound – 如果未找到该端点组。
- 返回值:
None。
- abstract delete_endpoint_group_association_by_project(project_id)[source]¶
删除端点组到项目关联。
- 参数:
project_id (string) – 要检查的项目标识
- 返回值:
无
- abstract delete_region(region_id)[source]¶
删除现有的区域。
- 引发:
keystone.exception.RegionNotFound – 如果该区域不存在。
- abstract delete_service(service_id)[source]¶
删除现有的服务。
- 引发:
keystone.exception.ServiceNotFound – 如果服务不存在。
- abstract get_catalog(user_id, project_id)[source]¶
检索并格式化当前的服务目录。
示例
{ 'RegionOne': {'compute': { 'adminURL': u'http://host:8774/v1.1/project_id', 'internalURL': u'http://host:8774/v1.1/project_id', 'name': 'Compute Service', 'publicURL': u'http://host:8774/v1.1/project_id'}, 'ec2': { 'adminURL': 'http://host:8773/services/Admin', 'internalURL': 'http://host:8773/services/Cloud', 'name': 'EC2 Service', 'publicURL': 'http://host:8773/services/Cloud'}}
- 返回值:
一个嵌套字典,表示服务目录或一个空字典。
- 引发:
keystone.exception.NotFound – 如果端点不存在。
- abstract get_endpoint(endpoint_id)[source]¶
通过id获取端点。
- 返回值:
endpoint_ref 字典
- 引发:
keystone.exception.EndpointNotFound – 如果端点不存在。
- abstract get_endpoint_group(endpoint_group_id)[source]¶
获取一个端点组。
- 参数:
endpoint_group_id (string) – 要检索的端点组标识
- 引发:
keystone.exception.NotFound – 如果未找到该端点组。
- 返回值:
一个端点组表示。
- abstract get_endpoint_group_in_project(endpoint_group_id, project_id)[source]¶
获取端点组到项目的关联。
- 参数:
endpoint_group_id (string) – 要检索的端点组标识
project_id (string) – 要关联的项目标识
- 引发:
keystone.exception.NotFound – 如果未找到端点组到项目的关联。
- 返回值:
一个项目端点组表示。
- abstract get_region(region_id)[source]¶
通过id获取区域。
- 返回值:
region_ref 字典
- 引发:
keystone.exception.RegionNotFound – 如果该区域不存在。
- abstract get_service(service_id)[source]¶
通过id获取服务。
- 返回值:
service_ref 字典
- 引发:
keystone.exception.ServiceNotFound – 如果服务不存在。
- get_v3_catalog(user_id, project_id)[source]¶
检索并格式化当前的V3服务目录。
示例
[ { "endpoints": [ { "interface": "public", "id": "--endpoint-id--", "region": "RegionOne", "url": "http://external:8776/v1/--project-id--", }, { "interface": "internal", "id": "--endpoint-id--", "region": "RegionOne", "url": "http://internal:8776/v1/--project-id--", }, ], "id": "--service-id--", "type": "volume", } ]
- 返回值:
一个列表,表示服务目录或一个空列表
- 引发:
keystone.exception.NotFound – 如果端点不存在。
- abstract list_endpoint_groups_for_project(project_id)[source]¶
列出项目的所有端点组到项目关联。
- 参数:
project_id (string) – 要关联的项目标识
- 返回值:
None。
- abstract list_endpoints(hints)[source]¶
列出所有端点。
- 参数:
hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。
- 返回值:
端点_refs列表或一个空列表。
- abstract list_endpoints_for_project(project_id)[source]¶
列出与项目关联的所有端点。
- 参数:
project_id (string) – 要检查的项目标识
- 返回值:
一个身份端点id列表或一个空列表。
- abstract list_projects_associated_with_endpoint_group(endpoint_group_id)[source]¶
列出与端点组关联的所有项目。
- 参数:
endpoint_group_id (string) – 要关联的端点标识
- 返回值:
None。
- abstract list_projects_for_endpoint(endpoint_id)[source]¶
列出与端点关联的所有项目。
- 参数:
endpoint_id (string) – 要检查的端点标识
- 返回值:
一个项目列表或一个空列表。
- abstract list_regions(hints)[source]¶
列出所有区域。
- 参数:
hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。
- 返回值:
区域引用列表或一个空列表。
- abstract list_services(hints)[source]¶
列出所有服务。
- 参数:
hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。
- 返回值:
服务引用列表或一个空列表。
- abstract remove_endpoint_from_project(endpoint_id, project_id)[source]¶
移除端点到项目的关联。
- 参数:
endpoint_id (string) – 要移除的端点的标识
project_id (string) – 关联的项目标识
- 引发:
keystone.exception.NotFound – 如果项目中未找到该端点。
- 返回值:
None。
- abstract remove_endpoint_group_from_project(endpoint_group_id, project_id)[source]¶
移除端点到项目的关联。
- 参数:
endpoint_group_id (string) – 要关联的端点标识
project_id (string) – 要关联的项目标识
- 引发:
keystone.exception.NotFound – 如果未找到端点组项目关联。
- 返回值:
None。
- abstract update_endpoint(endpoint_id, endpoint_ref)[source]¶
通过id获取端点。
- 返回值:
endpoint_ref 字典
- 引发:
keystone.exception.EndpointNotFound – 如果端点不存在。
keystone.exception.ServiceNotFound – 如果服务不存在。
- abstract update_endpoint_group(endpoint_group_id, endpoint_group)[source]¶
更新一个端点组。
- 参数:
endpoint_group_id (string) – 要检索的端点组标识
endpoint_group (dictionary) – 一个完整的或部分端点组
- 引发:
keystone.exception.NotFound – 如果未找到该端点组。
- 返回值:
一个端点组表示。
- abstract update_region(region_id, region_ref)[source]¶
通过ID更新区域。
- 返回值:
region_ref 字典
- 引发:
keystone.exception.RegionNotFound – 如果该区域不存在。
- abstract update_service(service_id, service_ref)[source]¶
通过ID更新服务。
- 返回值:
service_ref 字典
- 引发:
keystone.exception.ServiceNotFound – 如果服务不存在。