File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class IndexNameFrequency(Enum):
56
56
WEEKLY = 1
57
57
MONTHLY = 2
58
58
YEARLY = 3
59
+ NONE = 4
59
60
60
61
# Defaults for the class
61
62
__DEFAULT_ELASTICSEARCH_HOST = [{'host' : 'localhost' , 'port' : 9200 }]
@@ -115,11 +116,20 @@ def _get_yearly_index_name(es_index_name):
115
116
"""
116
117
return "{0!s}-{1!s}" .format (es_index_name , datetime .datetime .now ().strftime ('%Y' ))
117
118
119
+ @staticmethod
120
+ def _get_none_index_name (es_index_name ):
121
+ """ Return elasticsearch index name
122
+ :param: index_name the prefix to be used in the index
123
+ :return: A srting containing the elasticsearch indexname used which should include the date and specific year
124
+ """
125
+ return "{0!s}" .format (es_index_name )
126
+
118
127
_INDEX_FREQUENCY_FUNCION_DICT = {
119
128
IndexNameFrequency .DAILY : _get_daily_index_name ,
120
129
IndexNameFrequency .WEEKLY : _get_weekly_index_name ,
121
130
IndexNameFrequency .MONTHLY : _get_monthly_index_name ,
122
- IndexNameFrequency .YEARLY : _get_yearly_index_name
131
+ IndexNameFrequency .YEARLY : _get_yearly_index_name ,
132
+ IndexNameFrequency .NONE : _get_none_index_name
123
133
}
124
134
125
135
def __init__ (self ,
You can’t perform that action at this time.
0 commit comments