@@ -358,15 +358,16 @@ createSnapshot (SnapshotRepoName repoName)
358 url = addQuery params <$> joinPath ["_snapshot", repoName, snapName]
358 url = addQuery params <$> joinPath ["_snapshot", repoName, snapName]
359 params = [("wait_for_completion", Just (boolQP snapWaitForCompletion))]
359 params = [("wait_for_completion", Just (boolQP snapWaitForCompletion))]
360 body = encode $ object prs
360 body = encode $ object prs
361− prs = catMaybes [ ("indices" .=) . renderIndices <$> snapIndices
361+ prs = catMaybes [ ("indices" .=) . indexSelectionName <$> snapIndices
362 , Just ("ignore_unavailable" .= snapIgnoreUnavailable)
362 , Just ("ignore_unavailable" .= snapIgnoreUnavailable)
363 , Just ("ignore_global_state" .= snapIncludeGlobalState)
363 , Just ("ignore_global_state" .= snapIncludeGlobalState)
364 , Just ("partial" .= snapPartial)
364 , Just ("partial" .= snapPartial)
368−renderIndices :: NonEmpty IndexName -> Text
368+indexSelectionName :: IndexSelection -> Text
369+indexSelectionName AllIndexes = "_all"
369−renderIndices (i :| is) = T.intercalate "," (renderIndex <$> (i:is))
370+indexSelectionName (IndexList (i :| is)) = T.intercalate "," (renderIndex <$> (i:is))
371 renderIndex (IndexName n) = n
372 renderIndex (IndexName n) = n
@@ -425,15 +426,17 @@ restoreSnapshot (SnapshotRepoName repoName)
425 url = addQuery params <$> joinPath ["_snapshot", repoName, snapName, "_restore"]
426 url = addQuery params <$> joinPath ["_snapshot", repoName, snapName, "_restore"]
426 params = [("wait_for_completion", Just (boolQP snapRestoreWaitForCompletion))]
427 params = [("wait_for_completion", Just (boolQP snapRestoreWaitForCompletion))]
427 body = encode (object prs)
428 body = encode (object prs)
428− prs = catMaybes [ ("indices" .=) . renderIndices <$> snapRestoreIndices
431+ prs = catMaybes [ ("indices" .=) . indexSelectionName <$> snapRestoreIndices
429− , Just ("ignore_unavailable" .= snapRestoreIgnoreUnavailable)
432+ , Just ("ignore_unavailable" .= snapRestoreIgnoreUnavailable)
430− , Just ("include_global_state" .= snapRestoreIncludeGlobalState)
433+ , Just ("include_global_state" .= snapRestoreIncludeGlobalState)
431− , ("rename_pattern" .=) <$> snapRestoreRenamePattern
434+ , ("rename_pattern" .=) <$> snapRestoreRenamePattern
432− , ("rename_replacement" .=) . renderTokens <$> snapRestoreRenameReplacement
435+ , ("rename_replacement" .=) . renderTokens <$> snapRestoreRenameReplacement
433− , Just ("include_aliases" .= snapRestoreIncludeAliases)
436+ , Just ("include_aliases" .= snapRestoreIncludeAliases)
434− , ("index_settings" .= ) <$> snapRestoreIndexSettingsOverrides
437+ , ("index_settings" .= ) <$> snapRestoreIndexSettingsOverrides
435− , ("ignore_index_settings" .= ) <$> snapRestoreIgnoreIndexSettings
438+ , ("ignore_index_settings" .= ) <$> snapRestoreIgnoreIndexSettings
437 renderTokens (t :| ts) = mconcat (renderToken <$> (t:ts))
440 renderTokens (t :| ts) = mconcat (renderToken <$> (t:ts))
438 renderToken (RRTLit t) = t
441 renderToken (RRTLit t) = t
439 renderToken RRSubWholeMatch = "$0"
442 renderToken RRSubWholeMatch = "$0"
@@ -522,11 +525,6 @@ optimizeIndex ixs IndexOptimizationSettings {..} =
522 body = Nothing
525 body = Nothing
525−-------------------------------------------------------------------------------
526−indexSelectionName :: IndexSelection -> Text
527−indexSelectionName (IndexList names) = renderIndices names
528−indexSelectionName AllIndexes = "_all"
530deepMerge :: [Object] -> Object
528deepMerge :: [Object] -> Object
531deepMerge = LS.foldl' go mempty
529deepMerge = LS.foldl' go mempty
532 where go acc = LS.foldl' go' acc . HM.toList
530 where go acc = LS.foldl' go' acc . HM.toList