コード例 #1
0
ファイル: loader.py プロジェクト: sen0120/rally
 def _create_template(self, tpl_spec, mapping_dir):
     name = self._r(tpl_spec, "name")
     index_pattern = self._r(tpl_spec, "index-pattern")
     delete_matching_indices = self._r(tpl_spec, "delete-matching-indices", mandatory=False, default_value=True)
     template_file = os.path.join(mapping_dir, self._r(tpl_spec, "template"))
     with self.source(template_file, "rt") as f:
         template_content = json.load(f)
     return track.IndexTemplate(name, index_pattern, template_content, delete_matching_indices)
コード例 #2
0
 def _create_template(self, tpl_spec, mapping_dir):
     name = self._r(tpl_spec, "name")
     index_pattern = self._r(tpl_spec, "index-pattern")
     delete_matching_indices = self._r(tpl_spec,
                                       "delete-matching-indices",
                                       mandatory=False,
                                       default_value=True)
     template_file = "%s/%s" % (mapping_dir, self._r(tpl_spec, "template"))
     return track.IndexTemplate(name, index_pattern, template_file,
                                delete_matching_indices)