本文整理汇总了Python中elastic_controller.ElasticSearchController.create_snapshot方法的典型用法代码示例。如果您正苦于以下问题:Python ElasticSearchController.create_snapshot方法的具体用法?Python ElasticSearchController.create_snapshot怎么用?Python ElasticSearchController.create_snapshot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elastic_controller.ElasticSearchController
的用法示例。
在下文中一共展示了ElasticSearchController.create_snapshot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_snapshot
# 需要导入模块: from elastic_controller import ElasticSearchController [as 别名]
# 或者: from elastic_controller.ElasticSearchController import create_snapshot [as 别名]
def create_snapshot():
snapshot_repo = frappe.get_hooks("snapshot_repo", app_name="propshikari")[0]
snapshot_name = get_datetime().strftime("%Y%m%d_%H%M%S")
es = ElasticSearchController()
print now()
try:
response = es.create_snapshot(snapshot_repo, snapshot_name)
if not response.get("state") == "SUCCESS":
send_email(["[email protected]"], "Propshikari Elastic Backup Operation Error", "/templates/elastic_backup_notification.html", {"error_log":response})
return response
except Exception,e:
print "Elastic Backup Operation Failed"
print frappe.get_traceback()
print "Error Occured : ",e
send_email(["[email protected]", "[email protected]"], "Propshikari Elastic Backup Operation Error", "/templates/elastic_backup_notification.html", {"error_log":frappe.get_traceback()})