I have below nested yaml file, I want extract only NN41_R11
.
devices:
NN41_R11:
connections:
defaults:
a:
ip:
port:
protocol: telnet
class:
type: IOS
testbed:
name:
I am new to yaml parsing using python, below is the code which i tried to pseudo code, but its printing the entire yaml file.
import yaml
stream = open('/tmp/testbed1.yaml','r')
data = yaml.load(stream)
print data.get('devices')