def put_problem(problemId): homeownerService = zookeeper.get_service("homeowner-service") if homeownerService: homeownerManager = RequestManager(request, homeownerService) homeownerId = homeownerManager.authenticate() if homeownerId: tenantService = zookeeper.get_service("problem-service") if tenantService: tenantManager = RequestManager(request, tenantService) return tenantManager.put("problem/v1/Problem/" + str(problemId) + "/Status") return Response(response="Error: Tenant Not Available", status=503) return Response(response="Not Authorized", status=401) return Response(response="Error: Homeowner Not Available", status=503)
def update_tenant(tenantId): homeownerService = zookeeper.get_service("homeowner-service") if homeownerService: homeownerManager = RequestManager(request, homeownerService) homeownerId = homeownerManager.authenticate() if homeownerId: tenantService = zookeeper.get_service("tenant-service") if tenantService: tenantManager = RequestManager(request, tenantService) return tenantManager.put("tenant/v1/Tenant/" + str(tenantId) + "/Approve") return Response(response="Error: Tenant Not Available", status=503) return Response(response="Not Authorized", status=401) return Response(response="Error: Homeowner Not Available", status=503)