def object_create_appset(request): try: srxobject = srxconfig.srxObject(request) result = srxobject.create_appset() request.session["configdict"] = result response = helpers.convert_dict_to_yaml(result) except Exception: response = helpers.view_exception(Exception) return JsonResponse(response, safe=False)
def policy_rename(request): try: srxpolicy = srxconfig.srxPolicy(request) result = srxpolicy.update_policyname() request.session["configdict"] = result response = helpers.convert_dict_to_yaml(result) except Exception: response = helpers.view_exception(Exception) return JsonResponse(response, safe=False)
def policy_add_address(request): try: srxpolicy = srxconfig.srxPolicy(request) result = srxpolicy.add_address() if "p_exists" not in result: request.session["configdict"] = result response = helpers.convert_dict_to_yaml(result) else: request.session["configdict"] = result["p_existing"] request.session["pe_detail"] = result["pe_detail"] response = "p_exists" except Exception: response = helpers.view_exception(Exception) return JsonResponse(response, safe=False)
def get_yamlconfig(request): response = helpers.convert_dict_to_yaml(request.session["configdict"]) return JsonResponse(response, safe=False)