def get_vault_package_order(self): did, app_id, content, err = get_pre_proc(self.response, "order_id") if err is not None: return err order_id = content['order_id'] info = get_order_info_by_id(ObjectId(order_id)) self.__id_to_order_id(info) return self.response.response_ok({"order_info": info})
def get_vault_backup_plan(self): did, app_id, content, err = get_pre_proc(self.response, "name") if err: return err data = PaymentConfig.get_backup_plan(content["name"]) if data: return self.response.response_ok(data) else: return self.response.response_err(BAD_REQUEST, "not found backup name of:" + content["name"])
def get_vault_pricing_plan(self): did, app_id, content, err = get_pre_proc(self.response, "name") if err: return err data = PaymentConfig.get_pricing_plan(content["name"]) if data: return self.response.response_ok(data) else: return self.response.response_err(NOT_FOUND, "not found pricing name of:" + content["name"])
def get_property(self): did, app_id, content, response = get_pre_proc(self.response, "path", access_vault=VAULT_ACCESS_R) if response is not None: return response metadata, resp_err = v2_wrapper(self.ipfs_files.get_file_metadata)(did, app_id, content['path']) if resp_err: return resp_err data = HiveFile.get_info_by_metadata(metadata) return self.response.response_ok(data)
def file_hash(self): did, app_id, content, response = get_pre_proc(self.response, "path", access_vault=VAULT_ACCESS_R) if response is not None: return response metadata, resp_err = v2_wrapper(self.ipfs_files.get_file_metadata)(did, app_id, content['path']) if resp_err: return resp_err data = {"SHA256": metadata[COL_IPFS_FILES_SHA256]} return self.response.response_ok(data)
def file_hash(self): did, app_id, content, response = get_pre_proc( self.response, "path", access_vault=VAULT_ACCESS_R) if response is not None: return response name = content['path'] data, err = query_hash(did, app_id, name) if err: return self.response.response_err(err["status_code"], err["description"]) return self.response.response_ok(data)