16 KiB
16 KiB
Creation of an ILI report
A function that will create a ILI report asset and sequence.
Input
Arguments
pipeline_id: aarrayeach item of which should be a valid uuid for a pipeline.date: astringformatted as an ISO date representing the date of the inspection.vendor_name: astringthe company who conducted the ILI inspectionreport_type: astringthe type of the report possible values:finalpreliminary
inspection_type: astringthe type of technology used possible values:mfltfiutematcalipercombo_mfl_and_tficombo_mfl_and_utcombo_mfl_and_ec
file_details: aarrayof file detail objectspipebody_tolerances: anobjectrepresenting the tolerances for the pipebodyhaz_tolerances: anobjectrepresenting the tolerances for the heat affected zone (HAZ)
Environment
ORG_ID: the organization idPROJECT_ID: the id of the data project where the pipeline data is foundENV: the environment of the platform e.g.devorstgetc.
Creating the function on the platform
To create this function on the platform using the cli set up the port forwarding as shown in README.
Then run the following command to create the function.
cargo run functions create \
-f functions/ili_creation \
-n uploadili \
-d "Processes an ILI file and create the sequences and assets associated with that report" \
-i pipeline_id=string \
-i date=string \
-i vendor_name=string \
-i report_type=string \
-i inspection_type=string \
-i file_details=object \
-i pipebody_tolerances=object \
-i haz_tolerances=object
Testing the function locally
You can run and test the function locally by running
cargo run
Then you can check it work with curl as follows
curl -X POST localhost:8080 -v \
-d "\"{\\\"date\\\": \\\"Fri Feb 01 2002\\\", \\\"file_details\\\": [{\\\"fileId\\\": \\\"a2e8295f-3547-47b1-92ae-d5446b081eee\\\", \\\"revisionId\\\": \\\"2c68f624-2e9b-4c4a-90e0-d0243bd5c541\\\"}], \\\"formData\\\": {\\\"inpsectionType\\\": \\\"mfl\\\", \\\"pipeline_datasetIds\\\": \\\"\\\", \\\"pipeline_organizationId\\\": \\\"2cbfe270-d195-48ad-aed1-24145924635c\\\", \\\"pipeline_resourceClientIds\\\": [\\\"pipeline-1-local-data\\\"], \\\"pipeline_resourceIds\\\": [\\\"6f9ad309-d882-46af-bb13-ce06ac8c38a5\\\"], \\\"pipeline_resourceTypeId\\\": 6, \\\"pipeline_workspaceId\\\": null, \\\"reportDate\\\": \\\"Fri Feb 01 2002\\\", \\\"reportFile\\\": [{\\\"fileId\\\": \\\"a2e8295f-3547-47b1-92ae-d5446b081eee\\\", \\\"revisionId\\\": \\\"2c68f624-2e9b-4c4a-90e0-d0243bd5c541\\\"}], \\\"reportType\\\": \\\"final\\\", \\\"toolToleranceForHaz\\\": \\\"{\\\\\\\"general_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"general_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"general_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"general_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"general_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"pitting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"pitting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pitting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pitting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"axial_grooving_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"axial_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"circumferential_grooving_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"circumferential_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_sensitivity\\\\\\\":\\\\\\\"2\\\\\\\",\\\\\\\"pinhole_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"pinhole_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"axial_slotting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"axial_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"circumferential_slotting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"circumferential_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\"}\\\", \\\"toolTolerancesForPipeBody\\\": \\\"{\\\\\\\"general_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"general_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_width\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"general_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_length\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"general_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"pitting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"pitting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"pitting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_depth\\\\\\\":\\\\\\\"0.2\\\\\\\",\\\\\\\"axial_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"axial_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"axial_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"circumferential_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"circumferential_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"circumferential_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_depth\\\\\\\":\\\\\\\"0.2\\\\\\\",\\\\\\\"pinhole_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_depth\\\\\\\":\\\\\\\"0.19\\\\\\\",\\\\\\\"axial_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"circumferential_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_width\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"circumferential_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"circumferential_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\"}\\\", \\\"vendorName\\\": \\\"ILI-Ros\\\"}, \\\"haz_tolerances\\\": \\\"{\\\\\\\"general_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"general_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"general_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"general_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"general_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"pitting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"pitting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pitting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pitting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"axial_grooving_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"axial_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"circumferential_grooving_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"circumferential_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_sensitivity\\\\\\\":\\\\\\\"2\\\\\\\",\\\\\\\"pinhole_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"pinhole_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"axial_slotting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"axial_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_sensitivity\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"circumferential_slotting_sensitivity_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"circumferential_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"circumferential_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\"}\\\", \\\"input\\\": null, \\\"inspection_type\\\": \\\"mfl\\\", \\\"pipebody_tolerances\\\": \\\"{\\\\\\\"general_depth\\\\\\\":\\\\\\\"0.15\\\\\\\",\\\\\\\"general_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_width\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"general_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"general_length\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"general_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"pitting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"pitting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pitting_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"pitting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_depth\\\\\\\":\\\\\\\"0.2\\\\\\\",\\\\\\\"axial_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"axial_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_grooving_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"axial_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"circumferential_grooving_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_width\\\\\\\":\\\\\\\"15\\\\\\\",\\\\\\\"circumferential_grooving_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_grooving_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"circumferential_grooving_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_depth\\\\\\\":\\\\\\\"0.2\\\\\\\",\\\\\\\"pinhole_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"pinhole_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"pinhole_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_depth\\\\\\\":\\\\\\\"0.19\\\\\\\",\\\\\\\"axial_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_width\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"axial_slotting_length\\\\\\\":\\\\\\\"20\\\\\\\",\\\\\\\"axial_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_depth\\\\\\\":\\\\\\\"0.13\\\\\\\",\\\\\\\"circumferential_slotting_depth_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_width\\\\\\\":\\\\\\\"19\\\\\\\",\\\\\\\"circumferential_slotting_width_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\",\\\\\\\"circumferential_slotting_length\\\\\\\":\\\\\\\"13\\\\\\\",\\\\\\\"circumferential_slotting_length_inputType\\\\\\\":\\\\\\\"short_text\\\\\\\"}\\\", \\\"pipeline_id\\\": [\\\"6f9ad309-d882-46af-bb13-ce06ac8c38a5\\\"], \\\"report_type\\\": \\\"final\\\", \\\"vendor_name\\\": \\\"ILI-Ros\\\"}\"""