Invoking Function With Lyrid CLI

Invoking Function With Lyrid CLI#

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 manual deployment provides insight on errors during the deployment if an issue arises.

Default invocation cloud platform#

Default cloud platform for execution is LYR. To change the policy, go to

Account Policies > Default Execution Platform

note

Supported values here are: LYR, AWS or GCP

Choosing HTTP call method ( --method )#

Default HTTP Call method is POST. To change HTTP call method you can use:

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

Supported HTTP call methods are

GETPOSTDELETEPUTPATCHCOPYHEADOPTIONSLINKUNLINKPURGELOCKUNLOCKPROPFINDVIEWCONNECTTRACE

Invocating on custom URL ( --url )#

To visit a custom URL in an app :

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>" --url "check/uptime/"

Passing parameters and headers on invoke ( --parameter & --header )#

To pass parameter into the invocation:

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

Multiple header can also be passed into the invocation. It's in CUrl style :

lc code invoke --name "<AppName>" --module "<ModuleName>" --function "<FunctionName>" --header "key1: value1" --H "key2: value2"
note
  • --parameter must be passed in a JSON readable string. Passing this string may differ per Operating System.
  • --header is written in CUrl style.

Running multiple threads on invoke ( --thread )#

To run multiple threads for invocation:

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

Executing a tagged function (Pro only) ( --tag )#

User can execute a tagged version of a function by calling:

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