我正在尝试使用以下 curl 从 zip 文件并通过 REST API 创建 nodejs 函数:
curl --request PUT --url 'https://my:credentials@openwhisk.eu-gb.bluemix.net/api/v1/namespaces/mynamespace/actions/my_action_name?overwrite=true' --header 'accept: application/json' --header 'content-type: application/json' --data '{"annotations":[{"key":"exec","value":"nodejs:10"},{"key":"web-export","value":true}],"exec":{"kind":"nodejs:10","init":"./action.zip"},"parameters":[{"key":"message","value":"Hello World"}]}'
结果我得到一个错误:
"error":"The request content was malformed:\n'code' must be a string or attachment object defined in 'exec' for 'nodejs:10' actions"
是否有可能获得如何从 zip 文件和通过 REST API 创建新操作的示例?谢谢你。