325c10079dd448caaef6638e717.../README.md
2025-06-11 15:52:24 +00:00

66 lines
1.9 KiB
Markdown

# Creation of an ILI report
A function that will create a ILI report asset and sequence.
## Input
### Arguments
- `org_id`: as string which should be a valid `uuid` for the organization
- `project_id`: the id of the data project where the pipeline data is found
- `pipeline_id`: a `array` each item of which should be a valid uuid for a pipeline.
- `date`: a `string` formatted as an ISO date representing the date of the
inspection.
- `vendor_name`: a `string` the company who conducted the ILI inspection
- `report_type`: a `string` the type of the report possible values:
- `final`
- `preliminary`
- `inspection_type`: a `string` the type of technology used possible values:
- `mfl`
- `tfi`
- `ut`
- `emat`
- `caliper`
- `combo_mfl_and_tfi`
- `combo_mfl_and_ut`
- `combo_mfl_and_ec`
- `file_details`: a `array` of file detail objects
- `pipebody_tolerances`: an `object` representing the tolerances for the pipebody
- `haz_tolerances`: an `object` representing the tolerances for the heat affected zone (HAZ)
## 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.
```bash
cargo run functions create \
-f functions/ili_creation \
-d "Processes an ILI file and create the sequences and assets associated with that report" \
-i org_id=string \
-i project_id=string \
-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
```bash
cargo run
```
Then you can check it work with `curl` as follows
```bash
curl localhost:8080 -d $(jq '. | tojson' functions/ili_creation/example_input.json)
```