purestorage.flashblade.purefb_lifecycle 模块 – 管理 FlashBlade 对象生命周期
注意
此模块是 purestorage.flashblade 集合(版本 1.19.1)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install purestorage.flashblade
。您需要进一步的要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定:purestorage.flashblade.purefb_lifecycle
。
purestorage.flashblade 1.4.0 中的新增功能
概要
管理对象存储桶的生命周期
要求
执行此模块的主机上需要以下要求。
python >= 3.9
py-pure-client
purity_fb >= 1.12.2
netaddr
datetime
pytz
distro
pycountry
urllib3
参数
参数 |
注释 |
---|---|
在多部分上传不完整后将被中止的时间长度。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 |
|
具有管理员特权用户的 FlashBlade API 令牌。 |
|
生命周期规则应用于的存储桶 |
|
禁用不安全证书警告 选择
|
|
生命周期规则的状态 选择
|
|
FlashBlade 管理 IP 地址或主机名。 |
|
当前版本被标记为过期的时间。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 |
|
当前版本被标记为过期的日期。 以 YYYY-MM-DD 形式输入日期。 注意: 将日期设置为过去将删除所有带有 prefix 值的对象,因为它们是在创建时设置的。 |
|
先前版本被标记为过期的时间。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 |
|
生命周期规则的名称 |
|
对象键前缀,用于标识存储桶中的一个或多个对象 |
|
创建或删除生命周期规则 选择
|
备注
注意
此模块需要
purity_fb
Python 库如果 fb_url 和 api_token 参数未直接传递给模块,则必须设置
PUREFB_URL
和PUREFB_API
环境变量
示例
- name: Create a lifecycle rule called bar for bucket foo (pre-Purity//FB 3.2.3)
purestorage.flashblade.purefb_lifecycle:
name: bar
bucket: foo
keep_previous_for: 2d
prefix: test
fb_url: 10.10.10.2
api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Create a lifecycle rule called bar for bucket foo (post-Purity//FB 3.2.3)
purestorage.flashblade.purefb_lifecycle:
name: bar
bucket: foo
keep_previous_for: 2d
keep_current_for: 1w
abort_uploads_after: 1d
keep_current_until: 2020-11-23
prefix: test
fb_url: 10.10.10.2
api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Modify a lifecycle rule (post-Purity//FB 3.2.3)
purestorage.flashblade.purefb_lifecycle:
name: bar
bucket: foo
keep_previous_for: 10d
fb_url: 10.10.10.2
api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Delete lifecycle rule foo from bucket foo
purestorage.flashblade.purefb_lifecycle:
name: foo
bucket: bar
state: absent
fb_url: 10.10.10.2
api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6