43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
# Local Growth Rate
|
|
|
|
A function that calculates the local growth rate from an existing ILI comparison
|
|
|
|
## 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
|
|
- `ili_comparison_id`: an `array` of `strings` which should be valid UUIDs an ILI comparison sequence
|
|
|
|
## 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/acr_local_growth_rate \
|
|
-d "Runs the local growth rate calculation based of a previous ILI comparison" \
|
|
-i org_id=string \
|
|
-i project_id=string \
|
|
-i pipeline_id=array \
|
|
-i ili_comparison_id=array
|
|
```
|
|
|
|
## 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/acr_local_growth_rate/example_input.json)
|
|
```
|