heat.engine.clients.os.swift module

class heat.engine.clients.os.swift.SwiftClientPlugin(context)[source]

基类: ClientPlugin

OBJECT_STORE = 'object-store'
exceptions_module = <module 'swiftclient.exceptions' from '/home/zuul/src/opendev.org/openstack/heat/.tox/docs/lib/python3.12/site-packages/swiftclient/exceptions.py'>
get_files_from_container(files_container, files_to_skip=None)[source]

从容器中获取文件内容。

从容器中的文件中获取文件内容。 还可以指定要跳过的文件列表,这些文件将不会从 swift 下载。

get_signal_url(container_name, obj_name, timeout=None)[source]

启用对象版本控制。

我们可以为多个信号使用单个 TempURL,并返回 Swift TempURL。

get_temp_url(container_name, obj_name, timeout=None, method='PUT')[source]

返回 Swift TempURL。

is_client_exception(ex)[source]

如果当前异常来自客户端,则返回 True。

is_conflict(ex)[source]

如果异常是冲突,则返回 True。

is_not_found(ex)[source]

如果异常是未找到,则返回 True。

is_over_limit(ex)[source]

如果异常是超出限制,则返回 True。

is_valid_temp_url_path(path)[source]

如果路径是有效的 Swift TempURL 路径,则返回 True,否则返回 False。

Swift TempURL 路径必须:- 包含五个部分,[‘’, ‘v1’, ‘account’, ‘container’, ‘object’] - 必须是 v1 请求 - 必须具有 account、container 和 object 值 - object 值不能只有 ‘/’

参数:

path (string) – TempURL 路径

parse_last_modified(lm)[source]

解析 last-modified 值。

例如,来自 swift 对象标头的 last-modified 值。 返回该值的 datetime.datetime。

参数:

lm (string) – last-modified 值(或 None)

返回值:

该值的 offset-naive UTC datetime(或 None)

service_types = ['object-store']