Day 15 Task: Python Libraries for DevOps

Day 15 Task: Python Libraries for DevOps

  1. Create a Dictionary in Python and write it to a JSON File.

json.dumps() : It is used to convert a dictionary to JSON string.

2. Read a json file services.json kept in this folder and print the service names of every cloud service provider.

output
aws : ec2
azure : VM
gcp : compute engine

json.load(): json.load() accepts file object, parses the JSON data, populates a Python dictionary with the data and returns it back to you.

  1. Read YAML file using python, file services.yaml and read the contents to convert yaml to json.

YAML (short for "YAML Ain't Markup Language") is a human-readable data serialization language. It is often used as a configuration file format for applications and systems.

YAML uses indentation and line breaks to define a structure, making it easier to read and write than some other data serialization formats like JSON or XML. It is often used to configure applications, describe data structures, and exchange data between systems.

Thank you for reading.