test_name = "Update" configpath = os.path.abspath('./edm.yml') if os.path.exists( './edm.yml') else sys.exit(1) config = None with open(configpath, 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as e: raise Exception from e ret = 0 # print(config) try: edm = ElasticDataManager() edm.connect(config, config['default_index']) edm.connection.create(index='group', doc_type='doc', id='g100', body={ "gid": 234, "owner": "bemineni", "name": "Sammy", "grp_hash": "456678", "description": "Sammy group" }) edm.update({ '_index': 'group', '_type': "doc", '_id': 'g100',
test_name = "Add" configpath = os.path.abspath('./edm.yml') if os.path.exists( './edm.yml') else sys.exit(1) config = None with open(configpath, 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as e: raise Exception from e ret = 0 # print(config) try: edm = ElasticDataManager() edm.connect(config, config['default_index']) item = { '_index': 'group', '_type': 'doc', '_id': '2', '_source': { "gid": 234, "owner": "bemineni", "name": "Sammy", "grp_hash": "456678", "description": "Sammy group" } } edm.add(item)
test_name = "Abort" configpath = os.path.abspath('./edm.yml') if os.path.exists('./edm.yml') else sys.exit(1) config = None with open(configpath, 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as e: raise Exception from e ret = 0 # print(config) try: tdmgr = TestDataManager() edm = ElasticDataManager() edm.connect(config, config['default_index']) data = [{'_type': 'group', '_id': 'g1', '_source': {"gid": 234, "owner": "bemineni", "name": "Sammy", "grp_hash": "456678", "description": "Sammy group" } }, {'_type': 'group', '_id': 'g2', '_source': {"gid": 456, "owner": "bemineni", "name": "Srikanth",
test_name = "Update_by_query" configpath = os.path.abspath('./edm.yml') if os.path.exists( './edm.yml') else sys.exit(1) config = None with open(configpath, 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as e: raise Exception from e ret = 0 # print(config) try: edm = ElasticDataManager() edm.connect(config, config['default_index']) data = [{ '_index': 'group', '_type': 'doc', '_id': 'g2', '_source': { "gid": 234, "owner": "bemineni", "name": "Sammy", "grp_hash": "456678", "description": "Sammy group" } }, { '_index': 'group',
test_name = "Add" configpath = os.path.abspath('./edm.yml') if os.path.exists( './edm.yml') else sys.exit(1) config = None with open(configpath, 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as e: raise Exception from e ret = 0 # print(config) try: edm = ElasticDataManager() edm.connect(config, config['default_index']) edm.add({ '_type': 'group', '_id': '2', '_source': { "gid": 234, "owner": "bemineni", "name": "Sammy", "grp_hash": "456678", "description": "Sammy group" } }) transaction.commit()