# Runs the ILI clustering algorithm for all the clustering rules Clustering criteria for pipeline defects refer to the guidelines or criteria that are used to determine whether a group of defects in a pipeline should be considered a "cluster." These criteria are typically based on a combination of factors, including the size, location, and severity of the defects, as well as the spacing between them. See [clustering function readme](../ili_clustering/README.md) for more info. This function runs the clustering algorithm for all the rules for a given ILI report. ## 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 - `size_settings`: a string representing the size setting for clustering, possible values - `original` - `tolerance` - `interaction`: a string representing the interaction setting for clustering, possible values - `enabled` - `disabled` - `surface_location`: a string representing the surface location setting for clustering, possible values - `matching` - `any` ## 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_clustering_all \ -d "Runs the ILI clustering algorithm" \ -i org_id=string \ -i project_id=string \ -i pipeline_id=array \ -i ili_id=array \ -i size_settings=string \ -i interaction=string \ -i surface_location=string ``` ## 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_clustering_all/example_input.json) ```