Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.03 KB

File metadata and controls

28 lines (23 loc) · 1.03 KB

Build using fn cli

fn -v deploy --app <app-name>

oci-cli based function invocation

oci fn function invoke --function-id <function-ocid> --file "-" --body '{"ENDPOINT":"<predict-url>", "PAYLOAD": "<json-payload>"}'

Sample:

oci fn function invoke --function-id <function-ocid> --file "-" --body '{"ENDPOINT":"https://modeldeployment.us-ashburn-1.oci.customer-oci.com/<md-ocid>/predict", "PAYLOAD": "{\"index\": \"1\"}"}'

fn cli based invocation

fn invoke <app-name> <function-name>

Sample:

echo -n '{"ENDPOINT":"https://modeldeployment.us-ashburn-1.oci.customer-oci.com/<md-ocid>/predict", "PAYLOAD": "{\"index\": \"1\"}"}' | fn invoke <app-name> <function-name>

More information

The sample code in func.py also shows how to get headers and request body. Required headers can also be passed to downstream call, if needed. Other ways of function invocation can be found here