我有一个 JSON 如下:
{
"elements": [
{
"name": "F975CFAF-8FB4-2926-DD56-74CD230D15AF",
"uri": "vm/hpcloud/nova/large",
"parameters": {
"imageUri": "image/hpcloud/nova/ami-00001b03",
"securityGroups": [
"default"
]
},
"metadata": {
"name": "HPCloud Large VM with Ubuntu 10.04 With BitNami WebPack 1.2-0 Nova",
"description": "HPCloud Large VM with Ubuntu 10.04 With BitNami WebPack 1.2-0 Nova"
}
}
]
}
我需要按如下方式操作属性“元数据”(注意附加了新属性):
{
"elements": [
{
"name": "F975CFAF-8FB4-2926-DD56-74CD230D15AF",
"uri": "vm/hpcloud/nova/large",
"parameters": {
"imageUri": "image/hpcloud/nova/ami-00001b03",
"securityGroups": [
"default"
]
},
"metadata": {
"name": "HPCloud Large VM with Ubuntu 10.04 With BitNami WebPack 1.2-0 Nova",
"description": "HPCloud Large VM with Ubuntu 10.04 With BitNami WebPack 1.2-0 Nova",
"charge" : 80
}
}
]
}
使用 node js 完成此任务的任何直接方法?