3 ²˜‚]·ã@s,ddlmZmZmZmZGdd„deƒZdS)é)ÚNamespacedClientÚ query_paramsÚ _make_pathÚ SKIP_IN_PATHc@s¾eZdZeƒddd„ƒZedƒddd„ƒZeƒddd„ƒZeƒdd d „ƒZeƒdd d „ƒZeƒdd d„ƒZ eƒddd„ƒZ eƒd dd„ƒZ eƒd!dd„ƒZ eƒd"dd„ƒZ eƒd#dd„ƒZdS)$Ú CcrClientNcCs*|tkrtdƒ‚|jjdtdd|ƒ|d�S)z³ ``_ :arg name: The name of the auto follow pattern. z2Empty value passed for a required argument 'name'.ÚDELETEÚ_ccrÚ auto_follow)Úparams)rÚ ValueErrorÚ transportÚperform_requestr)ÚselfÚnamer ©rúG/tmp/pip-build-z81i1n8o/elasticsearch/elasticsearch/client/xpack/ccr.pyÚdelete_auto_follow_patternsz$CcrClient.delete_auto_follow_patternZwait_for_active_shardscCs>x ||fD]}|tkr tdƒ‚q W|jjdt|ddƒ||d�S)a^ ``_ :arg index: The name of the follower index :arg body: The name of the leader index and other optional ccr related parameters :arg wait_for_active_shards: Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1), default '0' z+Empty value passed for a required argument.ÚPUTrÚfollow)r Úbody)rr r r r)rÚindexrr Úparamrrrrs  zCcrClient.followcCs|jjdt|ddƒ|d�S)zí ``_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices ÚGETrÚinfo)r )r r r)rrr rrrÚ follow_info'szCcrClient.follow_infocCs*|tkrtdƒ‚|jjdt|ddƒ|d�S)zî ``_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices z3Empty value passed for a required argument 'index'.rrÚstats)r )rr r r r)rrr rrrÚ follow_stats3szCcrClient.follow_statscCs>x ||fD]}|tkr tdƒ‚q W|jjdt|ddƒ||d�S)aÐ ``_ :arg index: the name of the leader index for which specified follower retention leases should be removed :arg body: the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index z+Empty value passed for a required argument.ÚPOSTrÚforget_follower)r r)rr r r r)rrrr rrrrrAs   zCcrClient.forget_followercCs|jjdtdd|ƒ|d�S)z° ``_ :arg name: The name of the auto follow pattern. rrr )r )r r r)rrr rrrÚget_auto_follow_patternWsz!CcrClient.get_auto_follow_patterncCs*|tkrtdƒ‚|jjdt|ddƒ|d�S)zß ``_ :arg index: The name of the follower index that should pause following its leader index. z3Empty value passed for a required argument 'index'.rrÚ pause_follow)r )rr r r r)rrr rrrr bszCcrClient.pause_followcCs>x ||fD]}|tkr tdƒ‚q W|jjdtdd|ƒ||d�S)zð ``_ :arg name: The name of the auto follow pattern. :arg body: The specification of the auto follow pattern z+Empty value passed for a required argument.rrr )r r)rr r r r)rrrr rrrrÚput_auto_follow_patternps  z!CcrClient.put_auto_follow_patterncCs,|tkrtdƒ‚|jjdt|ddƒ||d�S)a ``_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr related parameters z3Empty value passed for a required argument 'index'.rrÚ resume_follow)r r)rr r r r)rrrr rrrr"s zCcrClient.resume_followcCs|jjdd|d�S)zi ``_ rz /_ccr/stats)r )r r )rr rrrrŽszCcrClient.statscCs*|tkrtdƒ‚|jjdt|ddƒ|d�S)zÁ ``_ :arg index: The name of the follower index that should be turned into a regular index. z3Empty value passed for a required argument 'index'.rrÚunfollow)r )rr r r r)rrr rrrr#•szCcrClient.unfollow)N)N)NN)N)N)NN)N)N)NN)N)N)Ú__name__Ú __module__Ú __qualname__rrrrrrrr r!r"rr#rrrrrs,          rN)ÚutilsrrrrrrrrrÚs