Invoke CloudFunctions
Invoke
Invoke CloudFunctions
This API is used to run various tasks: run sample, run analyze, run CloudFunction.
The target parameter has two kinds of values:
- Cloud Function ID (e.g.
MARVIZPLOT). In this case, theactionparameter must berun. The content inparametersis defined by the specific Cloud Function. - Workflow ID (e.g.
F46FF98D7). In this case, theactionparameter must berun_sampleorrun_analyze, andparametersshould be empty or ignored.
The get_response parameter is used to indicate whether to synchronously and
wait for the response from the command. If set to true, the API will wait for
the command to finish and return the response. If set to false, the API will
return immediately after the command is started.
The return format is also defined by the specific Cloud Function.
Example:
- Arivz plot in serverside
// curl -H "Authorization: Bearer $token" "$root/invoke" --json \
{
"target": "MARVIZPLOT",
"action": "run",
"get_response": true,
"parameters": {
"experiment_id": "X7CED97DD",
"return_type": "json",
"plot_func": "plot_ecdf",
"plot_chain": "chain#1",
"plot_var": "σ/val"
}
}
// OUTPUT
{"status": "ok", "data": {"cloudfunction_response": {<plotdata>}}}
- Run sample
// curl -H "Authorization: Bearer $token" "$root/invoke" --json \
{
"target": "F46FF98D7",
"action": "run_sample",
"get_response": true
}
// OUTPUT
{"status": "ok", "data": {"experiment_id": "XFF2F7F8B", "experiment_name": "priceless_elion"}}
- Run Analyze
// curl -H "Authorization: Bearer $token" "$root/invoke" --json \
{
"target": "F46FF98D7",
"action": "run_analyze",
"get_response": false
}
// OUTPUT
{"status": "ok", "data": {}}
POST
Invoke CloudFunctions
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json