+
+def saveExample(data):
+ if 'directory' in data and 'domain' in data and 'body' in data:
+ name = data['domain']
+ if 'pnfId' in data: name = '-'.join( (data['pnfId'], data['domain']) )
+ outputFileName = data['directory'] + '/json/examples/' + name + '.json'
+ with open(outputFileName, 'w') as f:
+ json.dump(data['body'], f, indent=2, sort_keys=True)
+ else:
+ print("Example could not been saved:\n" + json.dump(data, f, indent=2, sort_keys=True))
+
\ No newline at end of file