@@ -859,95 +859,71 @@ def set_settings(self, settings, forward_to_slaves=True,
859859
860860 @deprecated
861861 def listUserKeys (self ):
862+ """Use `list_api_keys` on the client instead."""
862863 return self .list_user_keys ()
863864
864865 @deprecated
865866 def list_user_keys (self ):
866- """Use `list_api_keys`"""
867+ """Use `list_api_keys` on the client instead. """
867868 return self .list_api_keys ()
868869
870+ @deprecated
869871 def list_api_keys (self , request_options = None ):
870- """
871- List all existing api keys of this index with their associated ACLs.
872- """
872+ """Use `list_api_keys` on the client instead."""
873873 return self ._req (True , '/keys' , 'GET' , request_options )
874874
875875 @deprecated
876876 def getUserKeyACL (self , key ):
877+ """Use `get_api_key` on the client instead."""
877878 return self .get_user_key_acl (key )
878879
879880 @deprecated
880881 def get_user_key_acl (self , key ):
881- """Use `get_api_key_acl` """
882+ """Use `get_api_key` on the client instead. """
882883 return self .get_api_key_acl (key )
883884
885+ @deprecated
884886 def get_api_key_acl (self , key , request_options = None ):
885- """Get ACL of a api key associated to this index ."""
887+ """Use `get_api_key` on the client instead ."""
886888 path = '/keys/%s' % key
887889 return self ._req (True , path , 'GET' , request_options )
888890
889891 @deprecated
890892 def deleteUserKey (self , key ):
893+ """Use `delete_api_key` on the client instead."""
891894 return self .delete_user_key (key )
892895
893896 @deprecated
894897 def delete_user_key (self , key ):
895- """Use `delete_api_key`"""
898+ """Use `delete_api_key` on the client instead. """
896899 return self .delete_api_key (key )
897900
901+ @deprecated
898902 def delete_api_key (self , key , request_options = None ):
899- """Delete an existing api key associated to this index ."""
903+ """Use `delete_api_key` on the client instead ."""
900904 path = '/keys/%s' % key
901905 return self ._req (False , path , 'DELETE' , request_options )
902906
903907 @deprecated
904908 def addUserKey (self , obj , validity = 0 , max_queries_per_ip_per_hour = 0 ,
905909 max_hits_per_query = 0 ):
910+ """Use `add_api_key` on the client instead."""
906911 return self .add_user_key (obj , validity , max_queries_per_ip_per_hour ,
907912 max_hits_per_query )
908913
909914 @deprecated
910915 def add_user_key (self , obj , validity = 0 , max_queries_per_ip_per_hour = 0 ,
911916 max_hits_per_query = 0 ):
912- """Use `add_api_key`"""
917+ """Use `add_api_key` on the client instead. """
913918 return self .add_api_key (
914919 obj , validity , max_queries_per_ip_per_hour ,
915920 max_hits_per_query
916921 )
917922
923+ @deprecated
918924 def add_api_key (self , obj , validity = 0 , max_queries_per_ip_per_hour = 0 ,
919925 max_hits_per_query = 0 , request_options = None ):
920- """
921- Create a new api key associated to this index (can only access to
922- this index).
923-
924- @param obj can be two different parameters:
925- The list of parameters for this key. Defined by a dictionary that
926- can contains the following values:
927- - acl: array of string
928- - indices: array of string
929- - validity: int
930- - referers: array of string
931- - description: string
932- - maxHitsPerQuery: integer
933- - queryParameters: string
934- - maxQueriesPerIPPerHour: integer
935- Or the list of ACL for this key. Defined by an array of string that
936- can contains the following values:
937- - search: allow to search (https and http)
938- - addObject: allows to add/update an object in the index (https only)
939- - deleteObject : allows to delete an existing object (https only)
940- - deleteIndex : allows to delete index content (https only)
941- - settings : allows to get index settings (https only)
942- - editSettings : allows to change index settings (https only)
943- @param validity the number of seconds after which the key will be
944- automatically removed (0 means no time limit for this key)
945- @param max_queries_per_ip_per_hour Specify the maximum number of API
946- calls allowed from an IP address per hour. Defaults to 0 (no
947- rate limit)
948- @param max_hits_per_query Specify the maximum number of hits this
949- API key can retrieve in one call. Defaults to 0 (unlimited)
950- """
926+ """Use `add_api_key` on the client instead."""
951927 if not isinstance (obj , dict ):
952928 obj = {'acl' : obj }
953929
@@ -963,45 +939,17 @@ def add_api_key(self, obj, validity=0, max_queries_per_ip_per_hour=0,
963939 def update_user_key (self , key , obj , validity = None ,
964940 max_queries_per_ip_per_hour = None ,
965941 max_hits_per_query = None ):
966- """Use `update_api_key`"""
942+ """Use `update_api_key` on the client instead. """
967943 return self .update_api_key (
968944 key , obj , validity , max_queries_per_ip_per_hour ,
969945 max_hits_per_query
970946 )
971947
948+ @deprecated
972949 def update_api_key (self , key , obj , validity = None ,
973950 max_queries_per_ip_per_hour = None ,
974951 max_hits_per_query = None , request_options = None ):
975- """
976- Update a api key associated to this index (can only access to this index).
977-
978- @param obj can be two different parameters:
979- The list of parameters for this key. Defined by a dictionary that
980- can contains the following values:
981- - acl: array of string
982- - indices: array of string
983- - validity: int
984- - referers: array of string
985- - description: string
986- - maxHitsPerQuery: integer
987- - queryParameters: string
988- - maxQueriesPerIPPerHour: integer
989- Or the list of ACL for this key. Defined by an array of string that
990- can contains the following values:
991- - search: allow to search (https and http)
992- - addObject: allows to add/update an object in the index (https only)
993- - deleteObject : allows to delete an existing object (https only)
994- - deleteIndex : allows to delete index content (https only)
995- - settings : allows to get index settings (https only)
996- - editSettings : allows to change index settings (https only)
997- @param validity the number of seconds after which the key will be
998- automatically removed (0 means no time limit for this key)
999- @param max_queries_per_ip_per_hour Specify the maximum number of API
1000- calls allowed from an IP address per hour. Defaults to 0 (no rate
1001- limit).
1002- @param max_hits_per_query Specify the maximum number of hits this API
1003- key can retrieve in one call. Defaults to 0 (unlimited)
1004- """
952+ """Use `update_api_key` on the client instead."""
1005953 if not isinstance (obj , dict ):
1006954 obj = {'acl' : obj }
1007955
0 commit comments