Skip to main content

Running a Function in Cloud

With your code submitted to our platform and deployed to the cloud, Let's run it!

Invoking Function in Public Cloud

Invoking a function

User will be able to use the Lyrid CLI to invoke their function in the cloud for testing purposes by calling this following command:

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>"

Note: The default invocation policy is listed here

Invoking function to a specific cloud

To force invocation to specific cloud, user can call the command:

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>" --framework "<Cloud>"

Note: Currently framework selection is "AWS", "GCP", "LYR", or "ANY"

Passing parameters on invoke

To pass parameter into the invocation:

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>" --framework "<Cloud>" --parameter '{\"InputSample\":\"Hello\"}'

Note: Parameter must be passed in a JSON readable string. Passing this string may differ per Operating System.

Running multiple threads on invoke

To run multiple threads for invocation:

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>" --framework "<Cloud>" --parameter '{\"InputSample\":\"Hello\"}' --threads 10

Invoking Function with Rest API

Now that you're able to run the function with CLI. We also provided you another way to invoke a function with Rest API. It's more complicated that CLI , so we decided to split it

Invoking Function With Rest API