I have a JSON as follows:
{
"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"
}
}
]
}
I need to manipulate the attribute "metadata" as follows (note that new attribute is appended) :
{
"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
}
}
]
}
Any straightforward way to accomplish this using node js?