Join AnsibleFest at Red Hat Summit!

netapp.storagegrid.na_sg_grid_ilm_rule module – Manage ILM rules on StorageGRID.

Note

This module is part of the netapp.storagegrid collection (version 21.14.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install netapp.storagegrid.

To use it in a playbook, specify: netapp.storagegrid.na_sg_grid_ilm_rule.

New in netapp.storagegrid 21.14.0

Synopsis

  • Interact with ILM rules on NetApp StorageGRID.

Parameters

Parameter

Comments

api_url

string / required

Rest endpoint for all invocations against the grid

auth_token

string / required

The authorization token for the API request

bucket_filter

dictionary

S3 or Swift bucket(s) to which the ILM rule applies.

If omitted, matches all objects in any specified tenant accounts

operator

string / required

Operator used to match bucket(s) with the value

Choices:

  • "contains"

  • "endsWith"

  • "equals"

  • "startsWith"

value

string / required

str value used to match bucket(s) with the specified operator

description

string

A short description of the ILM rule to indicate its purpose

filters

list / elements=dictionary

Filtering criteria used to determine if the ILM rule shall be applied to the evaluated object.

An ILM rule without filters applies to all objects

Default: []

criteria

list / elements=dictionary

A group of logical conditions based on object metadata

metadataName

string / required

System metadata identifier, user metadata name, or tag name

metadataType

string

Indicates the type of filtered metadata

operator

string / required

Used to compare the “metadataName” with the “value” str

Choices:

  • "contains"

  • "notContains"

  • "equals"

  • "notEquals"

  • "startsWith"

  • "notStartsWith"

  • "endsWith"

  • "notEndsWith"

  • "exists"

  • "notExists"

  • "lessThan"

  • "lessThanOrEquals"

  • "greaterThan"

  • "greaterThanOrEquals"

value

string

Entry against which the metadata values specified by metadataName should be compared

logicalOperator

string

Logical operator connecting filtering criteria when more than one criterion provided

ingest_behavior

string

How objects matching this rule are stored on ingest.

dual-commit creates interim copies and applies the rule later.

strict and balanced immediately create the copies specified in the rule’s day 0 instructions.

balanced uses dual-commit if following the rule instructions is not possible.

Choices:

  • "strict"

  • "balanced" ← (default)

  • "dual-commit"

name

string / required

Displayed name of the ILM rule.

A representative and unique name for the ILM rule.

Immutable once the ILM rule is created

placements

list / elements=dictionary

Specifies where and how object data that matches the ILM rule is stored

erasureCoded

list / elements=dictionary

Creates erasure coded copies of object data; otherwise, must be omitted

poolId

string / required

Storage pool where object data is stored

profileId

string / required

Erasure coding profile used. Erasure coded object data only

replicated

list / elements=dictionary

Creates replicated copies of object data; otherwise, must be omitted

cloudStoragePoolId

string

Cloud Storage Pool where object data is saved. Cloud Storage Pools cannot be used in the same placement as a storage pool.

Either poolId or cloudStoragePoolId is required.

copies

integer / required

Number of replicated copies

poolId

string

One or more storage pools where object data is saved, specified as comma-separated values. Either poolId or cloudStoragePoolId is required.

temporaryPoolId

string

Temporary locations are deprecated and should not be used for new ILM rules.

If you select the Strict ingest behavior, the temporary location is ignored.

retention

dictionary / required

Specifies where and how object data that matches the ILM rule is stored over time

after

integer / required

Day when object storage starts

duration

integer

Number of days object data to be stored at the specified locations. Objects stored forever if null

reference_time

string

Indicates the time from which the ILM rule is applied

Choices:

  • "ingestTime" ← (default)

  • "lastAccessTime"

  • "noncurrentTime"

  • "userDefinedCreationTime"

state

string

Whether the specified rule should exist.

Choices:

  • "present" ← (default)

  • "absent"

tenant_account_id

string

One or more S3 or Swift tenant account IDs to which the ILM rule applies

If omitted, applies to all objects

validate_certs

boolean

Should https certificates be validated?

Choices:

  • false

  • true ← (default)

Notes

Note

  • The modules prefixed with na_sg are built to manage NetApp StorageGRID.

Examples

- name: Create ILM rule with existing EC pool
  na_sg_grid_ilm_rule:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    name: "1 Copy Per Site"
    state: present
    reference_time: "ingestTime"
    ingest_behavior: "balanced"
    filters: []
    placements:
        - retention:
            after: 0
          erasureCoded:
              - profileId: "1"
                poolId: "p10771105546308032398"

- name: Delete existing ILM rule
  na_sg_grid_ilm_rule:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    name: "1 Copy Per Site"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

resp

dictionary

Returns information about the StorageGRID ILM rule.

Returned: If state is ‘present’.

Sample: {"active": false, "api": "s3OrSwift", "displayName": "1 Copy Per Site", "filters": [], "id": "r14896911895584977919", "ingestBehavior": "balanced", "permissions": ["delete", "edit"], "placements": [{"erasureCoded": [{"poolId": "p10771105546308032398", "profileld": "1"}], "retention": {"after": 0}}], "proposed": false, "referenceTime": "ingestTime", "schemaVersion": "1.0", "version": "1.0"}

Authors

  • Denis Magel (@dmagel-netapp)