In my dataset, I have information about block devices with specific attributes such as Backend_Device_Path, Capacity, Bytes_Written, etc.
$scope.mydata = [{
"Block_Devices": {
"bdev0": {
"Backend_Device_Path": "/dev/ram1",
"Capacity": "16777216",
"Bytes_Written": 1577,
"timestamp": "4365093970",
"IO_Operations": 17757,
"Guest_Device_Name": "vdb",
"Bytes_Read": 17793,
"Guest_IP_Address": "192.168.26.88"
},
"bdev1": {
"Backend_Device_Path": "/dev/ram2",
"Capacity": "16777216",
"Bytes_Written": 1975,
"timestamp": "9365093970",
"IO_Operations": 21380,
"Guest_Device_Name": "vdb",
"Bytes_Read": 20424,
"Guest_IP_Address": "192.168.26.100"
}
},
"Number of Devices": 2
}]
I want to extract the names of these objects and create an array like this:
devices = ['bdev0', 'bdev1']
When trying $scope.mydata.Block_Devices
, it returns the entire JSON object. How can I only retrieve the object names (i.e bdev0 and bdev1)?