I have this json file:
print(data)
{'entityId': 'clusterId123',
'displayName': 'dev_cluster',
'firstSeenTms': 1584113406351,
'lastSeenTms': 1627524312116,
'properties': {'detectedName': 'dev_cluster'},
'tags': [],
'icon': {'primaryIconType': 'hypervisor'},
'toRelationships': {
'isMemberOf': [
{'id': 'HYPERVISOR_123', 'type': 'HYPERVISOR'},
{'id': 'HYPERVISOR_234', 'type': 'HYPERVISOR'},
{'id': 'HYPERVISOR_345', 'type': 'HYPERVISOR'}
]
}
}
I need to create a data frame that looks like this:
clusterId, clusterName, hypervisorId
clusterId123 dev_cluster HYPERVISOR_123
clusterId123 dev_cluster HYPERVISOR_234
clusterId123 dev_cluster HYPERVISOR_345
as you can see clusterId and clusterName repeats but the hypervisorId changes just like in the data file.
I am doing this:
#create an empty list
`cluList=[]`
#apend elements to the list
`cluList.append([data['entityId'], data['displayName']])`
I dont know how to pull the HYPERVISOR_123, HYPERVISOR_234, HYPERVISOR_345 from this data sets. Any guidance appreciated.