| src | ||
| Cargo.lock | ||
| Cargo.toml | ||
| example_input.json | ||
| README.md | ||
Corrosion coupon report upload
A function that is used for creating corrosion coupon reports.
Input
Arguments
org_id: as string which should be a validuuidfor the organizationproject_id: the id of the data project where the pipeline data is foundpipeline_id: anarrayofstringswhich should be valid UUIDs for pipelinescoupon_retrieval_point_id: anarrayofstringswhich should be valid UUIDs for coupon retrieval points on the pipelineinstallation_date: astringformatted as an ISO date representing the date the corrosion coupon was installed in the pipeline.retrieval_date: astringformatted as an ISO date representing the date the corrosion coupon was retrieved from the pipeline.metal_loss: afloatrepresenting the measured metal loss of the token.inspector: astringrepresenting the identifier of the inspectorremarks: astringfor any additional remarks about the inspection
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/coupon_retrieval_point_id \
-d "Creates new corrosion coupon reports" \
-i org_id=string \
-i project_id=string \
-i pipeline_id=array \
-i coupon_retrieval_point_id=array \
-i installation_date=string \
-i retrieval_date=string \
-i metal_loss=float \
-i inspector=string \
-i remarks=string
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 localhost:8080 -d $(jq '. | tojson' functions/coupon_retrieval_point_id/example_input.json)