Liking cljdoc? Tell your friends :D

ductile.lifecycle

Lifecycle management abstraction for ILM (Elasticsearch) and ISM (OpenSearch).

This module provides transformation between Elasticsearch's ILM (Index Lifecycle Management) and OpenSearch's ISM (Index State Management) policy formats, allowing the same policy API to work transparently with both engines.

Lifecycle management abstraction for ILM (Elasticsearch) and ISM (OpenSearch).

This module provides transformation between Elasticsearch's ILM (Index Lifecycle Management)
and OpenSearch's ISM (Index State Management) policy formats, allowing the same policy
API to work transparently with both engines.
raw docstring

create-policy!clj

(create-policy! {:keys [uri version engine request-fn] :as conn}
                policy-name
                policy)

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str policy :- Policy]

Create a lifecycle management policy.

  • For Elasticsearch: Creates an ILM policy
  • For OpenSearch: Creates an ISM policy (automatically transforms ILM if needed)

The policy parameter should be in ILM format. It will be automatically transformed to ISM format if connecting to OpenSearch.

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str policy :- Policy]

Create a lifecycle management policy.
 - For Elasticsearch: Creates an ILM policy
 - For OpenSearch: Creates an ISM policy (automatically transforms ILM if needed)

 The policy parameter should be in ILM format. It will be automatically
 transformed to ISM format if connecting to OpenSearch.
sourceraw docstring

delete-policy!clj

(delete-policy! {:keys [uri version engine request-fn] :as conn} policy-name)

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str]

Delete a lifecycle management policy. Works with both Elasticsearch ILM and OpenSearch ISM.

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str]

Delete a lifecycle management policy.
 Works with both Elasticsearch ILM and OpenSearch ISM.
sourceraw docstring

get-policyclj

(get-policy {:keys [uri version engine request-fn] :as conn} policy-name)

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str]

Get a lifecycle management policy. Works with both Elasticsearch ILM and OpenSearch ISM. Returns the policy in its native format (ILM or ISM).

Inputs: [{:keys [uri version engine request-fn], :as conn} :- ESConn policy-name :- s/Str]

Get a lifecycle management policy.
 Works with both Elasticsearch ILM and OpenSearch ISM.
 Returns the policy in its native format (ILM or ISM).
sourceraw docstring

ILMPhaseclj

ILM phase structure

ILM phase structure
sourceraw docstring

ILMPolicyclj

Elasticsearch ILM policy structure

Elasticsearch ILM policy structure
sourceraw docstring

ISMActionclj

OpenSearch ISM action structure

OpenSearch ISM action structure
sourceraw docstring

ISMPolicyclj

OpenSearch ISM policy structure

OpenSearch ISM policy structure
sourceraw docstring

ISMStateclj

OpenSearch ISM state structure

OpenSearch ISM state structure
sourceraw docstring

ISMTransitionclj

OpenSearch ISM transition structure

OpenSearch ISM transition structure
sourceraw docstring

normalize-policyclj

(normalize-policy policy target-engine)

Normalize a policy for the target engine. If the policy is already in the target format, return as-is. Otherwise, transform it.

Normalize a policy for the target engine.
If the policy is already in the target format, return as-is.
Otherwise, transform it.
sourceraw docstring

phase-orderclj

Standard ILM phase order

Standard ILM phase order
sourceraw docstring

policy-uriclj

(policy-uri uri policy-name)
(policy-uri uri policy-name engine)

Inputs: ([uri :- s/Str policy-name :- s/Str engine :- s/Keyword] [uri :- s/Str policy-name :- s/Str]) Returns: s/Str

Make a policy URI from a host, policy name, and engine type.

  • Elasticsearch uses _ilm/policy
  • OpenSearch uses _plugins/_ism/policies
Inputs: ([uri :- s/Str policy-name :- s/Str engine :- s/Keyword] [uri :- s/Str policy-name :- s/Str])
Returns: s/Str

Make a policy URI from a host, policy name, and engine type.
 - Elasticsearch uses _ilm/policy
 - OpenSearch uses _plugins/_ism/policies
sourceraw docstring

transform-ilm-to-ismclj

(transform-ilm-to-ism ilm-policy)

Inputs: [ilm-policy :- ILMPolicy] Returns: ISMPolicy

Transform Elasticsearch ILM policy to OpenSearch ISM policy.

ILM uses phases (hot, warm, cold, delete) with actions. ISM uses states with actions and transitions between states.

Example: (transform-ilm-to-ism {:phases {:hot {:actions {:rollover {:max_docs 100000}}} :delete {:min_age "30d" :actions {:delete {}}}}})

Inputs: [ilm-policy :- ILMPolicy]
Returns: ISMPolicy

Transform Elasticsearch ILM policy to OpenSearch ISM policy.

 ILM uses phases (hot, warm, cold, delete) with actions.
 ISM uses states with actions and transitions between states.

 Example:
   (transform-ilm-to-ism
     {:phases {:hot {:actions {:rollover {:max_docs 100000}}}
               :delete {:min_age "30d" :actions {:delete {}}}}})
sourceraw docstring

transform-ism-to-ilmclj

(transform-ism-to-ilm ism-policy)

Inputs: [ism-policy :- ISMPolicy] Returns: ILMPolicy

Transform OpenSearch ISM policy to Elasticsearch ILM policy.

This is a best-effort transformation as ISM is more flexible than ILM. Some ISM features may not have direct ILM equivalents.

Inputs: [ism-policy :- ISMPolicy]
Returns: ILMPolicy

Transform OpenSearch ISM policy to Elasticsearch ILM policy.

 This is a best-effort transformation as ISM is more flexible than ILM.
 Some ISM features may not have direct ILM equivalents.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close