X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fprodstub%2Fapp%2Fprodstub.py;h=d7604406927d746109cbbb6b050ec686fa69a2a7;hb=3283f01dc3092ac5dbd1400090d7eb9f14fcd279;hp=f4f148812ea53dae5a7919439be4030ac3d96ec2;hpb=ce4b14cdfcd3a2e131c7364776452a67ee858f72;p=nonrtric.git diff --git a/test/prodstub/app/prodstub.py b/test/prodstub/app/prodstub.py index f4f14881..d7604406 100644 --- a/test/prodstub/app/prodstub.py +++ b/test/prodstub/app/prodstub.py @@ -63,7 +63,7 @@ JOB_DATA="/jobdata//" STATUS="/status" -#Constsants +#Constants APPL_JSON='application/json' UNKNOWN_QUERY_PARAMETERS="Unknown query parameter(s)" RETURNING_CONFIGURED_RESP="returning configured response code" @@ -185,7 +185,7 @@ def index(): # Arm the create callback with a response code # Omitting the query parameter switch to response back to the standard 200/201 response -# URI and parameters (PUT): /arm/create//[?response=] +# URI and parameters (PUT): /arm/create//[?response=] # Setting # response: 200 (400 if incorrect query params) @app.route(ARM_CREATE_RESPONSE, @@ -218,7 +218,7 @@ def arm_create(producer_id, job_id): # Arm the delete callback with a response code # Omitting the query parameter switch to response back to the standard 204 response -# URI and parameters (PUT): /arm/delete//[?response=] +# URI and parameters (PUT): /arm/delete//[?response=] # response: 200 (400 if incorrect query params) @app.route(ARM_DELETE_RESPONSE, methods=['PUT']) @@ -239,7 +239,7 @@ def arm_delete(producer_id, job_id): job_dict=setup_callback_dict(producer_id, job_id) - if (arm_response is None): #Reset the response depening if a job exists or not + if (arm_response is None): #Reset the response depending if a job exists or not if (job_dict['json'] is None): job_dict['delete_response']=404 else: @@ -251,7 +251,7 @@ def arm_delete(producer_id, job_id): # Arm the supervision callback with a response code # Omitting the query parameter switch to response back to the standard 200 response -# URI and parameters (PUT): /arm/supervision/[?response=] +# URI and parameters (PUT): /arm/supervision/[?response=] # response: 200 (400 if incorrect query params) @app.route(ARM_SUPERVISION_RESPONSE, methods=['PUT']) @@ -364,6 +364,7 @@ def callback_create(producer_id): return_msg="" if (req_json_dict[job_key_name] == job_id): print("Create callback received for producer: "+str(producer_id)+" and job: "+str(job_id)) + print(json.loads(request.data)) return_code=job_dict['create_response'] if ((job_dict['create_response'] == 200) or (job_dict['create_response'] == 201)): job_dict['json']=req_json_dict