body=`cat -`
id=`echo $body | jq -r '.id'`
command=`echo $body | jq -r '.command'`
body=`echo $body | jq 'del(.id, .command)'`
body=`echo $body | jq '.files += [{name: "@metadata", content: (.metadata | tostring)}] | del(.metadata)'`
# echo "id: $id, command: $command, body: $body"
curl -s --request PUT --header 'Authorization: Token aaa' --header 'Content-type: application/json' --data "$body" --url "http://run.coocn.cn/api/snippets/$id"
null