5d6c90d3b7fe49a6b917fe8bd37.../README.md
2025-06-25 13:06:32 +00:00

1.1 KiB

Updates the pipeline facility geolocations

A function that updates the pipeline facilities with their geolocation based on the pipeline route. Fails if there is no pipeline route.

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: an array of strings which should be valid UUIDs for pipelines

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/facility_locations \
  -d "Update the facility locations based on the pipeline route and log distance" \
  -i org_id=string \
  -i project_id=string \
  -i pipeline_id=array

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/facility_locations/example_input.json)