hey everyone welcome back to another video and welcome back to the continuation of the complete devops bootcamp we've already covered complete networking course and getting started with like linux and you know terminal commands and in this video we are going to be looking at something that is very important and that is something that we are going to be working with in the entire course so you can say that this is a this is an important video and what we learn in this particular video is going to be used i repeat it's going to be used in the entire boot camp when we learn about docker this is going to be used extensively when we learn about kubernetes various tools cloud computing like cloud providers and things like that this thing is going to be used everywhere sort of like you know the abcds of devops if you will what is it that we're learning yaml files how to work with yml files so in this course we are going this is an important section so let me tell you first what we are going to cover in this course and then you can decide like you know how you want to proceed it please watch this video entirely if you want to get a good understanding of yaml files in the end i i've actually put like i'll put timestamps and you can directly jump on the jump at that point as well so around the end i will also share with you some tools that can help you out when working with yaml files this is an important point because there are tools that let you work with like email files without actually writing yaml code right and the links for all those tools can be found in the description if you want to learn about these tools then i'll cover that in the end of the video so in this video what are we covering where we're covering let's say this is a yaml course okay if you don't know anything about yaml you don't know what it is why we use it don't worry this is courses for complete beginners no prerequisites required obviously so we are going to cover like an introduction to ml files like what are yaml files and like how do we work with it what are the benefits of it compare it with other files like json you may you may have heard about json files xml files if you have not heard about that don't worry we will compare yaml files with json files and xml files this is files okay like your tech like you have text files if you've done my java bootcamp we have a dot java file similarly we have yaml files we'll tell you like i'll tell you what this is all about and everything okay we'll cover we're going to cover like the syntax of it and everything okay so we're going to cover the syntax we're going to cover like uh properties and like data types properties data types and yaml tools so for example we'll be covering uh a few yaml tools and the links in the description and i'll share this when we start with the uh like at the end of the bootcamp so at the end of this video itself okay let's let's get started okay so yaml first of all what is the full form previously it was known as yet another markup language but now it's called yaml ain't markup language okay i'll tell you the reason for that as well now in my videos i try to go into the details of everything because i assume that not many folks may know everything okay some folks may not know what is a markup language that may be possible you may have heard about one markup language everyone has heard about html hypertext markup language now i ask you a question what is a markup language you know what a programming language is if you don't know then watch my introduction to programming video of the dsa bootcamp what is a markup language if you talk about html okay forget about the markup language what does html do what is the use of html can anyone tell like pause this video think about it don't google think about it what is the use of html okay now that you have paused and now resumed the video you may have thought that okay html is used to you know put some data on the web page put our links and forms over there that's correct yeah you put links and forms and you know text and all these headings and everything okay is html used to like style your particular web page no we use css for that cascading style sheets right and what is the use of html then what is it doing it's providing child parent relationship first header will come inside the header we're going to have lists inside the list we are going to have bullet points inside the bullet points we are going to have paragraph so just that sometimes we have paragraph outside so we have like a page like this okay inside that we have a table over here then we have a list over here then we have some bullet points over here so this relationship what goes inside what how they are layered this is the use of like markup language okay cool now like then why was the yaml name changed to yaml ain't markup language int means like it's not so yaml now stands for basically it stands for yaml ain't markup language so recursive if you don't know what recursion is check out my recursion playlist okay so the idea is that uh let's talk about the the the yaml stuff now like basically like what is it and what it's doing it's not a programming language it is basically a data format data format okay used to exchange data used to exchange data if you have heard now this is the point for someone who has heard about it if you have not heard about this ignore what i am saying it is similar to similar to xml and json data types okay if you don't know about these two things wait till the end of the video i will cover this also if you know about it then you know what i mean okay so we use it to like store data and stuff and we'll talk more about its features and syntax and all these things later on okay so it's basically a simple human readable language that can be used to represent data okay it is used to store some information about some configurations for example okay cool here one more point i would like to make is in yaml you can store only data what type of data i'll tell you later on and not commands so in other programming languages you can add commands and everything right if this do that you can do that in yaml you can't do it you can't add commands you can only store data okay this thing is known as storing of data in like files okay in json you store data in xml use store data it is known as data serialization i'll give you an example we'll code this as well don't worry i'll give you you may have an you may have a doubt right now we know you're saying it stores data but what type of data where is this data coming from how does it look like how do we store it how do we read it we will cover that in a hands-on demo first let me explain to you what it is not how it is focus on what it does then we'll focus on how it does it like we do in every lecture okay data serialization let's learn about that okay so let's think about it let's say you have a data object see the thing is if you don't know about what objects are in memory please watch the introduction to programming video first you don't know introduction to programming basic how computer work and you're learning about devops that will not work okay at least watch the introduction to programming video okay cool objects we have covered that in over there okay so let's talk about objects you know data objects uh your you may have something like an object of if you watch the object in priming playlists you will understand but object is nothing but a collection of like data okay so for example in your memory you have stored objects like related to let's say uh an object of a particular student okay and that has some sort of a memory some sort of a data type like roll number name and marks something like that okay now the idea is that you want to store this information about this student let's say you want to share it in a in an android app and then you want to share this application inside of web app then you want to share this information inside a something like uh you know a machine learning model for example so you have your android app mobile app or whatever you're giving the student object is available you want to share this object with like your web app you want to share that object with your machine learning app or whatever right so the idea is that there needs to be some sort of a way to have a particular data that you want to share in just one single format that can be shared everywhere the data that is stored in android operating systems might be different than you know your uh your websites okay it might be different than your machine learning models so how do i if i want to share the data stored in android i might need to convert it or whatever is showing to web and then machine learning how will that work so the idea is serialization and deserialization so serialization is basically a process of converting the data objects into a complex data structure into a stream of byte okay data object basically convert the data object that is present in some complex data structures into a stream of storage that can be used to transfer this data on likes your physical devices okay so for example this object you have over here this object simple let's say your email file that contains some data okay you create it into a stream what is a stream canal stream is basically just like a byte stream okay chunks of data for example you store that in your database now your computer okay in this direction this is known as serialization the reverse of this take from one device you want to convert it again back to object back to object this is known as deserialization okay if you're aware about json data so you know in in when you get from an api call you get a json data you convert that into your json objects or whatever that's the similar thing over happening over here okay cool so this particular you know serialization means that you have your let's see okay so in simple language you may have some object okay in your memory some object so you have your object let's say okay you put it into like serialization let's say you do some serialization see realization put it into a serializer for example okay it converts it into a stream of bytes stream of bytes okay just memory and now you can store it in your let's say yaml file let's say your database okay let's say or something like your memory for example so that's basically about it i hope this makes it clear this is serialization okay so a refresher of an object an object is basically like what object is combination of code plus data this is something that is like device you know on various devices like your your object like in your memory and ram or whatever okay if you want to learn more about objects what objects are check out the object-oriented playlist but it's basically a data storage unit okay so now you want to store this particular object you want to read what is inside the object or whatever in a human readable form or you want to transfer this object into various other domains you want to transfer one object to another object so whatever okay you want to transfer it into a database in a memory in a file so you pass it into a serializer and it converts it into a stream of byte byte you already know memory and then you can save it in your ml files or whatever so serialization is basically a repeat a process of converting this data object which is a combination of code and data into series of bytes that saves the state of this object in a form that is easily transmittable okay so in this form now this data in the stream form can be transferred over into the ml file or any other file any other file you want database or memory or whatever the reverse of this will be known as de-serialization okay that is basically about it cool so when you work with like things like big data and machine learning and stuff serialization comes into picture i'll show you an example of this as well don't worry but uh yaml so some of the data serialization languages in or in more simple words if you want to represent this object in a file that you can read and code on mult modify in those files are known as the data serialization language or files or if you wanted to call it okay and the language used in those files is known as data serialization language so a language that can be used to represent this data in the text format for example data serialization languages yaml json and what xml so in this way you can use the these languages to represent data in code as simple as that i can make it okay so you can store data in the format of code and then you can use that file to convert it into an object that is known as d serialization object to file file to object object to file serialization file to object d serialization okay i know there are some students who may not even know what an object is so that's why i'm smiling okay i've covered an entire object in probably playlist introduction to programming and everything make sure you check it out okay so that is data serialization and that is about yaml so yaml is a data serialization language it's not programming language we can store like some information in it and data in it and it means yaml ain't markup language so on and so forth but kunal you mentioned it was first known as yet another markup language why are they saying now that it's not another markup language because markup languages are used to store what what are they used to store documents html stores documents right in yaml you can also store objects sorry data not just documents but objects data as well that is why it's known as yamalan markup language okay so a good pointer for you over there cool let's move forward okay so i hope you know what data serialization and deceleration is now okay so you have one object that is on some computer you want to transfer it into let's say another application so format may be different how do we make sure that this you know format is maintained and we can wouldn't it be cool to have just one format that i can share everywhere okay convert that object into a yaml file serialization convert that yaml file back into an object d serialization okay so representation of your object like in code that way you can see it in java file so it's like used you can store it you know uh you know what type of objects will be stored what type of files are stored in yaml files so it's basically used in like configuration files this is why when we you know cube kubernetes configuration files for example so in configuration files when we define see this is an atom little bit advanced topic but you can understand this okay listen very carefully in cuban it is or other tools or whatever you create various objects okay so for example i made my application and i'm like hey i want to run my application on 10 servers in the cloud and they should run in such a way that only you know at most five applications are running per server or something like that i want to do that kubernetes is going to be like okay sure i will i will do that for you i have this object it's like a pod right i call it a pod but my wish community is like it's okay not q in his wish like the community with the people who made cuban it is google um so basically that object you are like okay hey cuban it is you want to create this this object for me uh okay here's the written type of what this object should look like please take it and create the object so that written type where you will provide it where you will write it in the form of yaml what you you can write it in the form of like uh other programming languages as well like java python for that we have clients but that is an advanced topic okay we'll cover that later on cool so this is known as like yaml which is a yaml is a markup language that is used to uh just uh lost my train of thought yaml is used to store uh data okay you can store data is a data serialization language okay let's move forward because i believe it will be much more clear when we give an example okay so it's used where configuration files configuration files you know in like docker and like kubernetes etc etc okay it's very important and it's also used where logs okay caches etc if you don't know what a cache is check out the networking video i did cool all right let's move forward let's learn about some other benefits now what are the benefits of yaml after this we'll also see like a demo okay we'll be writing yaml files and storing some some data on that okay the number one uh is that it's very easy to read human readable it's actually this is a very easy topic okay nothing confusing it's a very easy topic okay so it's very like simple and easy to read okay it's very simple and easy to read um it has a nice syntax it has a strict syntax like you cannot make like mistakes like that okay so indentation is important for example okay here indentation like like in python indentation is important indentation is important okay the next one is it's easily like convertible to for example json xml for example you take input in the form of yaml you output it in the form of json can be done very simple okay uh some of the other like most programming languages use it most languages use yaml okay so it's very very popular that's also another another uh another good use case right another good benefit okay it is more powerful when representing complex data more powerful when representing complex data okay very simple stuff and um it's also like uh you you can also um use various uh you know uh tools with it okay like parsers and etc parsers etc various tools available okay i will actually share with you a tool in the end where you can work with yaml files without even you know directly working with them okay so in cuban it is this is tool called lens ide check out the links in the description or the end of the video i'll also do a dedicated video on this so when we learn about cumulative first we will work heavily with yaml files you know now this is very like writing yaml files again and again it's like really you know boring to me now okay then comes into picture kx lens ide over there you have a graphical user interface and you can just click and you know it does all these things automatically for you show a little bit of a demo at the end so make sure you hang around and if you want to try it out right now the the links in the description for all the tools that i'll be mentioning these tools trust me will make your life very easy i use those i use these daily and it's definitely has helped me in my learning process as well right so i can focus on the concepts and stuff and it takes care of the all the writing stuff and everything for me cool okay one last thing is like there are so many parsers available and everything so parsing is also easy parsing basically means just reading the data okay parsing is easy cool um that's pretty much about it and uh you know yama link markup language and it's used to you know store data and stuff and uh it's used to so similar to like xml json if you don't know xml or json r we'll cover those later on basically in simple terms yaml is just a way to represent data you can use that to convert it into objects and stuff okay okay let's put everything into picture and see a live demo okay let's see how it looks like how do we store it let's see that now okay i have vs code open over here and we're going to work with some basic you know stuff to use the syntax and like everything i mentioned in the beginning some tools i'll share with you syntax and some of the data types and how it compares with json and xml when i have told you that you are going to be using yaml extensively in the course then don't worry yaml is not going to leave you you will get plenty of opportunities to work with yaml this is nothing main thing is kubernetes okay that is the main thing when we work with devops infrastructures and like infrastructure has code and like pipelines and uh cloud providers and working cloud computing and things like that so that's the main thing this is the starting of devops boot camp okay this is nothing this is just the tools that we're learning right now okay let's move forward i have a simple vs code open you can use whatever you want create a new file simple extension of yaml files is dot y a m l or dot y m l both are fine okay so i can say hello dot yaml this is my eml file let me just increase the font a little bit hope you can see that cool okay so let's talk about it you may have heard about like dictionaries or hash maps and stuff similarly in yaml's also we have we can store such data types we can store like key value pairs okay that's the type number one that we can save so we can have something like uh let's say apple is a key and it has a value of what i am a red root that's it or you can add something like one this is kunal's roll number or something this is the key this is the value that's it if you want to see how it's represented you can check that out as well so over here you can see that when we talk about key value pairs okay so you have a key over here is going to be having pointing to some value like this okay this particular thing is not stored in like in hash maps and stuff you know it's stored like in your uh in hash maps and stuff you know it's stored like in the memory but this is over here just a textual representation you can use this file and convert a hashmap out of it in that case this will be the key this will be the value you can convert a json object out of it pass it into your web development or projects or whatever okay so it's a key value pair what are some other pairs we have we have lists okay so we have lists something like this if i add some comments over here list so you can add list something like apple mango banana that's it this is how you represent this using the dash okay one more thing i would like to mention is uh yaml is case sensitive okay so apple and apple these are two different things okay so that's a pointer that i'd like to make that yaml is case sensitive all right okay one more thing i want to mention is that uh if you're using uh in yaml files so if you wanna you know mention some some more complex uh like data types for example so in that way we can do it something like this let's say let's say you add something like this this is known as your um block style okay so in the blog style if you have add something like this you say something like uh cities okay cities and then you add something like new delhi and then you add something like if you're adding a space over here okay then you add something like hey uh new not new uh something like mumbai right something like gujarat or something so now what is happening here you can see something i i tell you more about the syntax later on but here basically what is happening these are like indented by spaces if i do something like this it may give me an error okay and you can check this as well you can use yaml parsers to check this let me show you okay so you can go to yaml link.com i push this over here go okay so here it's saying that uh it's added it as one single line okay instead i wanted something like this something like this if i put it something like this and i say go you can say it's error okay you're not matching with the block so basically spaces are extremely important in yaml you can't use select tabs tabs are not using over here using spaces as i mentioned previously there are like a lot of tools that will be uh will be using and i'll be mentioning those in the end okay so that was another nice nice little pointer for you that uh in yaml we use spaces and indentation is extremely important like it is in python okay but now you're like this is some different document this is some different document this is some different document how do you tell basically yaml file that these are different different documents so in cuban it is you're let's say creating some object of type a let's say you're creating a pod you're creating some replicas you're creating some deployments ingress or whatever okay don't worry if you don't know about all these things let's say you're creating different different objects or you have a simple yaml file that contains various objects of let's say uh it contains an object representation of first one this contains is of let's say apple and fruit second one it consists is a list third one it consists is a city so in our yaml file it's gonna be like what is the data type it says like this is it a list or is it like your this block what is it so we can actually we know that these are three different types of documents and we can write those as dash dash dash now yaml will know that these are three different types of documents okay so yaml basically is a collection of zero and more documents in this i have three documents that are separated by dash dash okay you can also have like zero number of documents or whatever cool that's basically about it and if you want to end the document you and you end it with like if you want to tell your you know whatever wherever you will be sending this yeah you want to tell them that document has ended dot dot dot document finished here that's it how simple is this very simple language okay so now you here after this you will not start a new one you will only work with this so here is a list and here is a normal key value pair what is this kunal this is a block one block style how does it work how does this thing work let's see it's actually pretty simple so we have something like cities and i have a list over here let's say this list contains new delhi mumbai gujarat this is pointing to this that's it as simple as that cool all right so that is uh basically about it let me show you like json files as well hello.json okay so this is a json file side by side i can put these okay so if you want to convert this into json okay you can find some online tools for that let me show you so if you have a yaml file like this so you want to have your own this block code how would this look into json it will look something like this okay so zooming in a little bit there you go okay so this is basically like um flow style in in uh in like json that you have like this okay you can also have it in yaml okay you can i can also put it in uh in like yaml stuff so i can put it something like this so something like if i had something over here like this which is what i had in json file so json has like curly braces outside it okay you start with this is json same thing we have over here is for this thing but one more thing i can do is i can do it something like this i can say something like cities basically let's say consists of um this thing new delhi mumbai etc why are you doing this here you know that we got an error for bad indentation so if you want to store this amount of data in a list in just a single line so that you don't rely on indentation you can use this flow type as you can see it's similar to the json data type okay similarly you can do it something like as this as well if you want to have key value pairs you can have something like mango yellow fruit okay you can add something like a yellow fruit age 56 something like that this also works if i just copy paste this and i paste this over here you can see there you go exactly the same as json but in json you see we are actually adding over here a string data type you're not adding like here you can add it as in like as it is okay okay and you know we learned about comments over here comments are basically something that is ignored by your compilers or interpreters or whatever um in other languages you may have seen like multi-line comments in yaml it does not provide us multi-line comments okay if you recommend this entire thing then for multi-line comments you have to add these hashes again and again and again okay let's move forward okay now let's talk about data types we all know what data types are um because you watch the introduction to programming video data types are very pretty basic basic stuff every language has some data types so we'll be covering those over here so you may have already heard about like normal data types like primitives and complex data types like arrays for example right hash maps for example let's cover that over here uh data types dot yml you can also write y a m l and y m l both work so that anything that you write after the colon like this okay so for example my name is equal to something like kunal kushwa if i just write it simple like this kunal kushwa this web this works as well okay so uh a variable over here like some like uh a name over here basically any any name you can have like myself for example so any word over here colon space the type so this is known as a variable basically okay here colon and a single space and anything you write over here will be known as a variable and variables can be of like various data types so for example we can have a string variable now strings are basically written in either no codes so this is a string and you can write something like this as well something like root is apple double quotes or you can write something like job is equal to software engineer in single quotes these are strings string variables okay so how many types of how many ways are there to represent strings in yaml three okay sometimes it may be possible that you may not add strings that contains various lines for example bio okay what if i write my bio over here hey my name is kunal kushwaha i am a very nice dude for example now this is not actually in two lines this particular thing is one entry and this is another entry if i put it in my parser it's giving error it's like what is this yaml file always contains this thing there should be present always anytime you can see any data type you can see over here we have this thing colon something colon something okay like randomly you cannot have either it has to be a list or something like this or if you add something colon that entire thing then okay so this is actually giving me an error it's like okay this is not cool so what if you want to add new lines and preserve all these indentation marks and spaces and everything you add this over here a dash now this will be stored at a separate line okay now sometimes it may be possible that you have to write that is a single line so for example you want to write a single line in multiple lines like when it is passed in the object it is treated as one single line but when i am writing it down i want to write it in multiple lines because uh because it's like a really long line for example okay so you can say message you can start by with this this character all the new lines now will be into a single line it will look like it's different lines okay this will all be in one single line but when you put it into some object into some language in some database or whatever it will be treated as one line okay so this is same as same as this cool so you'd like to know that here you are not providing any data type or like you know whatever or something like that um we are only covering like strings over here but it is something like number is equal to five four six three five four seven three this is what type integer type you can add floats as well you can add marks something like this this is float data type you can add booleans as well okay so boolean are what true or false in yaml false is actually something like a boolean value is something like we write no this is true or false okay so let's cover this as well like uh we covered about like integers and stuff but you can also specify the data type okay so yaml right now will automatically detect what type of data type this is this is float then storing an integer type restoring a boolean type okay but what we need to do is um we need to basically let's cover the data types first so let me cover like some uh you know like uh values so here we have like our decimal numbers uh you can also have like your uh floating point numbers or whatever um and you have your boolean numbers false and stuff and uh you can have like uh also i think you can have something like n you can have n you can also write also something like this okay you can also write pause with capital letters and false but completely like this okay same for true for true you're gonna use yes and use yes you can use yes something like that okay there are some other types of values they are also known as null values which we'll cover like uh like later on but uh let me first tell you how you can actually specify the type specify the type so yaml is automatically going to detect it but you can also tell it specifically like you can force it you can hey i actually want to tell you the data type that i'm using over here so you can specify the type and while we're specifying we'll also look at all the data types okay so first one is let's say we look at for example integers so if you're talking about all the integers you can check out uh something like uh you can add a 0 so you can say 0 is something like this so if you want to specify a type you just do exclamation exclamation write the type over here and then add the value this is zero okay you want to add a positive number so this is positive number integer something like 45 okay negative number integer negative 45 okay you can also add binary numbers binary number you can add also type integer binary starts with what zero b we've covered this in number system of the data structures boot camp you can add one one zero zero something like one something whatever you want okay octal number also type integer starts with what 0 something like that hexadecimal 0x like this okay there's one more which is uh comma values for example if you want to store something like 500 and 40 000 something like this so you can store it something like this you can say integer can say plus five four zero underscore zero zero zero something like that okay so you use this exclamation exclamation uh thing um and access this symbol and then you specify the data type and then provide the value that's it okay these are some of the common ones um next ones are what floating points let's look at floating point numbers okay so you can add a simple number over here you can add something like or you can say marks plot 56.89 cool you can also add infinity infinity of type float let's say this can be dot infinity okay there's one more thing called not a number you can add that as well you can say not a number dot any not a number okay sound good okay and booleans are something we already talked about over here boolean values you can add something like uh for boolean you can add something like uh over here you can add boolean boolean now it's directly specifying it's a boolean type okay string as well we have seen string so this can be str that's it that's a string okay sound good okay there's one sort of data type in other languages we have like null and none okay since we're going to use yaml files in other languages and stuff we need some sort of a way to represent that also okay so it does not hold like any value as such you can talk about null over here so you can say surname or something you don't have a surname let's say null and you can specify it as null or you can null null or tilde as well tilde works as well sometimes keys may be null this is a that's null okay other complex data types are like you know like arrays and stuff we already covered these are areas representation okay very simple cool so like the block sequence and stuff that we already learned about flow flow statements we already learned about in the previous uh previous file you can also add dates dates and time can also be added okay so i have to google that dates and time in yaml there you go something like that no this is a php php example but you'll get the yaml example ah there we go cool so here we have it google is your best best friend okay utilize google you want to just mention the date over here so you can say koi paste date this is the date today or whatever okay you want to add the time something so here you can say date and time is this thing that's it i believe if no time zone is added over here it says that it's assuming utc time zone okay here it says that if no one is added then it assumes utc cool and the data type for this is timestamp you can add it like this cool okay can also mention the the time yourself as well so you want the indian time for example so i just copy this okay and i paste it over here india time i add the date over here okay something like that and then i add the time over here something like this let's see okay so basically this is the date and time is something like this okay like this and i can add utc 530 that's what we have over here in india that's it okay if you don't want to provide any time zone coil paste no time zone needs to be provided okay in that case just remove it cool that is it okay and we're talking about numbers you can also add like uh exponents okay expo then shell numbers for example you can say 6.023 e 56 ratio bar 56 that's it if you work with exponents you know what this means i think that's pretty much about the standard data types and uh should be enough to you know help you and i think this is it yeah and apart from this let's now learn about some more advanced data types okay so let's create some advanced data types advanced data types dot yaml i created a folder produce file advance data type start yaml think that looks good all right don't need this don't need this so initially we learned about lists so lists are basically known as if you want to write it down what do you do you write down to something like this no you write it as a sequence okay so for example here and something like you can say or you can say something like uh a student has this data a sequence type data okay what does the student have marks name roll number something like that okay okay so the similar thing that we drew over here as you can see on the screen this is actually how it's stored internally this second thing that's water what do you mean by a sequence and as we know that over here we also used this notation to use it so you can write it over here like this also okay like this also cool sometimes it may be possible that uh some of the um you know keys of the sequence will be empty this is known as a sparse sequence okay sparse sequence that's something like hey how this will contain something like empty okay will contain something let's say null or something okay stop spar sequence okay some things are empty maybe possible you have some some fields that are like uh like empty sometimes you may want to represent like sub items of a particular list so for that you can basically um you know do nested sequences as well nested sequence so let's do it over here if we transform it into so if we have something like if you have something like mango apple banana right i add it like this and add a space over here for example then add another thing like this and add a space over here so now you can see we have nested items okay so this is one one type of item another type of item so you can say marks roll number date didn't want to save that i just have it off clicking control s now fine so there you go these are nested okay nested sequences just gonna write it over here there you go you can use the one dash command to use that okay we already covered maps value pairs are called maps like hash maps if you will okay for this you use map very simple okay sometimes it may be possible that you're using uh you know nested mappings map within a map okay so using something like let's say name kunal kushwaha roll inside this i will write my rules i'll write age is equal to 78 job is equal to student so you can see this entire thing outside is a map and this inside thing is also a map make sense this is same as like this okay same as this thing you want to represent a map you can do it using a like this like this okay map within a map very simple okay sometimes it may be possible that you may require one key to have multiple values okay these are known as pairs keys may have duplicate values so pairs are used like pairs okay so you can have something like pair example this is of type pair and i will add my examples over here i will say something like you know i am for example a student and i am also a teacher i am two in one okay cool so basically this will be used in the this this hash table will be like it will be stored like housing but now if i try to access job how will i get it this will be a hash table uh containing arrays so an array of hash tables that's how you'll find it if i try to copy paste this over here somewhere so you can see it got converted into an array job student job teacher so job will actually have two pairs over here okay same as same as this something like this i'm adding pairs over here and i can say bracket sorry a comma like this that's it very simple isn't it good okay opposite of this is like unique values set will allow you to have unique values okay so here there's no key value pair there's only items and items only so you can say for example um names only unique names we want so i'll convert it into a set okay question mark in this case kunal i can't have multiple names here two kunals i cannot have there you go names kunal rahul because i did not provide any value only only like some keys and stuff are provided over here okay sometimes you may want to have like uh a particular key and the value you want it to be is like the sequence that we learned over here the sequences this entire sequence should be represented as a value for example in that case you can use dictionary okay omap okay so for this you can have something like uh people what is the type dictionary and every single thing so this is a key the value is going to be a list itself a sequence itself okay something like this something like uh kunal okay and kunal can have a sequence so for example kunal can have something like name age is equal to this height is equal to something random like this another person will have rahul rahul will have a name rahul p age is equal to 50. okay you can add other things over here you can add something like that height is equal to like this okay so if you want to see a representation of this let's let's see a representation of this how it will look like so i have my people over here let me draw it i have my people over here this contains two things kunal rahul they contain three things name age height name this is how it's stored okay if you wanna visualize it that's basically about it there you can see okay okay now what i want to do is that reusing some properties reusing some properties okay so i add something like like a person and some information i can add about them i can say name is equal to kunal kushwaha and i can say favorite fruit is equal to something like let's say or remove the name okay let's say just the likings of a person okay likings of a person so let's say favorite fruit is of a person what favorite fruit is let's say mango and let's say rank of a person over here or not rank we can say something like dislikes so dislike of this person is what let's say they don't like grapes or something okay now you're creating a person like this you're creating a person like uh you're saying kunal okay kunal for example are you just saying person okay and you're saying name is equal to let's say there are five people whose favorite fruit is mango and favorite dislikes dislikes are grapes what are you going to do copy paste you can do copy paste similarly another person one is person number one then you can have person number two then you can have person number three this is getting repetitive so this code these two lines are getting repetitive if you have to insert a thousand people who have this same property you will write these two lines thousand times so for this we use anchors what do we use we use anchors so basically anchors mean that what is the property you want to use so i'm going to say add the rate base is the command for this this is the property that i want to use all the properties that are available over here and if you want to add the properties you can add the properties over here like this star base so how do we solve this problem we don't have to write this again and again hey can we not just use this thing for this we use something known as using anchors so anchors basically means what do you want to copy and where do you want to copy it what do you want to copy and where do you want to copy it makes sense so that is what we're going to be using over here so for example what do we want to copy we want to copy this thing so we will give our anchor a name we're going to say at the rate likes and now i'm just gonna not write it over here like this i'm just gonna say this this particular symbol over here okay so this basically this symbol basically says that uh the maps that i'm specifying as the value should be inserted here what am i specifying as a value i'm going to say star which particular anchor likes so here what is going to happen is uh this entire thing will be let's say you can imagine copy pasted over here okay so that's about that you can also override it so you can also copy paste over here like this you can override some things so let's say you want to overwrite the dislikes of rahul so you can override it you can say dislikes for rahul or let's say dislikes are berries for example so all the ones will be copied as it is favorite fruit mango dislike scrapes and then dislikes will be overridden by berries so this will be like this person 2 will be something like this person 2 will look something like this this will look like first it will have person2 then it will be like okay copy all the likes okay all the likes i'm going to copy copy all the likes over here copied all the likes dislikes updated okay no problem dislikes updated this is what it will look like okay so these are anchor tags okay so that was basically about all the types and everything that we wanted to cover so as you can see it's only a matter of like let's take a little ticket let's take a real world example okay so let's say you want to define a particular data of some object of let's say students now we can define it now i will explain it to you what i mentioned in the first lecture first introductory like the starting of the video i will tell you about how data is stored in xml json and yaml you know how it's stored in yaml but let's say we're trying to store one simple data type let's say we're saying we're storing let's say uh the main data is like say there's a school for example okay there's a school and the school has a particular like like a name is available for the school and there's a there's a let's say something like uh who is the who is the principal of the school okay and then you have a list of all the students basically okay every single student so students will have every single like there will be let's say one student over here and let's say that student has a role number and a name and marks we want to represent this look at it very carefully we have to represent this in the form of your yaml file or xml file or json file this is a data type this is a data and we have to store it in the form of a code how can we use that you know the serialization and deserialization thing we talked about so that is what we're going to be doing over here serialization let's see how we can do that so if i create a file over here i call xml so xml stands for extensible markup language okay it's also used to store like uh you know like data and can be used to share data across various platforms or whatever so it's used like at various uh in various various systems and like back-end systems and stuff it's used so i can just say what can i say i can say school dot xml okay now xml basically has a version it's basically not readable by humans that's why we prefer like yaml at very places because here this is not readable by humans for big big xml files it will not be readable by humans okay so we have to provide like some versions over here uh here we have to provide like the version and the uh encoding of the character right the character encoding so what can we do is we can provide what is the version of example we are using so we can say xml version is equal to let's say 1.0 and we have the encoding equal to utf-8 i have told you about utf-8 so many times in previous videos okay please check out that now when we're talking about this thing first thing is the school no problem first thing we have over here is school we're going to end it with school sound good that's the first thing now the idea is that basically we're going to have uh what are we going to have inside the school inside the school we're going to have something like the name of the school for example i can just write the name over here uh the name of the school is what can say name is equal to something like dps okay and principle is equal to someone okay and that's it after this let's see the diagram every school is going to have like a student as well so this basically means it's inside it inside this tag inside this tag we also have like what students so i can say that there's a list of students for example i'm gonna end it with the end tag so you have to end everything that you have over here okay we can have one student over here okay we can have one student over here i will have to close it like this as well i forgot to add the closing mark okay um so one more student we need over here and how do we add the student what what is inside a student role number name and marks so i'm going to say roll number roll number name and marks name marks marks roll number is let's say 23 name is kunal gushwaha marks are let's say something like 90 4 something that's how you represent it in xml form very simple okay so this is not like really human readable or whatever but people you know many many companies do use to use that okay and the next version we can look into is what json so json is pretty popular json it stands for javascript object notation heavily used in javascript and one of the most popular you know like serialization uh like formats that people use so there are like data types like json data types these are objects okay in mongodb and stuff as well we use like json objects over there as well so if you want to write this in a code format you can use json for that okay i'm going to create school.json okay so here basically you can also use online online uh you know completion tools like conversion tools but nevermind so it starts with curly braces and everything goes inside curly braces so here i'm gonna have my school okay and school is gonna have a few properties all these three properties will go inside this list area sort of a thing okay first property is what name of the school name of the school is let's say dps comma second property okay so now the second property is basically let's say something like um principle okay and the principle is let's say someone ah everything has to be it has to be like this entire thing is also a set of properties so this will also go inside your curly brace like that that looks good okay so we have school it has this thing that will go inside a curly brace um so we have one school over here that has name dps uh principle is someone and uh then we have what do we have we have students so we have students can be multiple so array list and now a single student you want to add another student you can add like this another student okay so this is the represent difference between square brackets and curly braces this represents a collection this represents one entity you want to add another school you can add it like this okay that's about it and here i can add what role number name and marks so i can say student number one so i have roll number 12 name you can see this is giving error you have to add some data types like this okay and marks obviously has to be over here like this you're adding marks as 67. okay can you do something like this no it's giving me error okay you cannot add numbers as a key over here strings are added okay so this is how you write it in xml this is how you're writing json this is much more human readable right so that makes uh makes much more sense okay let's try yaml now yaml is pretty simple i'm going to copy paste this and i'm going to convert it i can use this json to yaml tool that's it i can just paste it over here that's yaml file okay school school entry number one entire school students entry number one first student here entries were defined by this thing every single entry will be this this is a collection of entry this represents the array this represents curly brace represents one entity you want to add another school you can add another curly brace stuff like this okay over here and over here so yaml is pretty much the cleanest over here okay that is it and now let me just share with you you already know about all these linters and stuff like you can write down you can google like uh you know for example you make some changes in your uh in your yaml file something like this okay these things will give error and stuff and when we work with like cuban humanities so this is an important part releases them carefully so when you will when will i work like with uh cumulatives and big big large large files you have to make sure that your that your files are basically yaml files are validated and stuff okay so let me tell you since this is the devops bootcamp i'm going to share with you some amazing devops tools that are going to help you when working with or without like yaml files and even like remotely working with it okay let's check it out okay and if you want to like check whether your yaml files are correct or not this is a great blog on you know how to validate your uh your email files and uh do check it out and i'll leave the link to it in the in the description below you can use you know directory for that and here's everything is basically mentioned how you can work with schemas and everything okay highly encourage you to check it out and uh you know to give it a clap and a comment uh as well if you enjoy reading it i'll leave the link to it in the description it can definitely help you so just sharing some nice resources so make sure you check out the links in the description okay so the first tool is a day tree so for your it's validates your communities like uh configuration files and those are also in yaml only and it also validates your yaml files okay to see the structure of your yaml file is right or not okay so you can go to the getting started guide basically i've also created an entire tutorial on this so data tree one day tree two and day tree three you will make it will make much more like if you if you're beginner then you will able to you'll be able to understand it much more clearly uh when we cover kubernetes for examples for now you can use data to validate your eml files so what i want you to do right now is go to the link in the description okay and once you sign up and log in using github the second thing i want you to do is watch this video okay even if you don't like just watch this video and uh you it will be able to like it will be clear to you how you can use dirty and run the yaml validation checks and whatever and it also helps you in like community schema checks and everything so this is going to be extremely handy when we work with cuban it is in practice okay so get a hang of it right now there are like no prerequisites you can just install it right now and uh if you want to get started check out this video i've explained it in detail how you can get started check out the link in the description sign up watch this video and you'll be able to check your yaml files like that it's very easy very simple okay just one more line of commands the second one is uh when you work with kubernetes yaml files they are extremely like you know big and stuff and complex so you can check out monocle by cubeshop okay so if you check out monocle by cube shop so all these yaml files and everything you see over here right dot yaml.yaml okay so these yaml files it makes it easy for you to see in a navigation format okay so it basically makes us easier makes it easier for us to work with these large-scale aml files the kubernetes manifest files okay so it will help you in managing your kubernetes manifest or your in other words kubernetes yaml files for example to give them a shout out as well and you can check out their uh twitter account they do some amazing work and uh to check out their like github projects and there's monocle there's cusk and this test cube as well but step by step we'll be learning a lot of other things i'll be doing a tutorial on this as well so make sure you like share and subscribe this is amazing lens so in kubernetes as i mentioned you want to try out something you want to create new pods or any any new objects you have to write big big yaml files and deploy those okay we'll learn about that in the devops bootcamp in the future lens on the other hand what does is it does all these things for us using an application a graphical user interface let me show you there you go so you want to create any pods or something okay you wanna let's say you to check out this pod you want to uh you know create another another resource let's say i want to create another deployment ta-da it created the yaml file for me automatically if you were not using lens and you wanted to create a deployment or something you had to write this on your own obviously we will learn how to write this on our own but when you are practicing and when you are working in production and stuff to save time tools like lens are amazing world's most advanced kubernetes platform you can download it right now and check it out i'll be sharing a demo on this as well the links are in the description and um basically you're working with kubernetes without working with yaml files so it's more developer focused and stuff and you can check out all the information about your cluster of cpu and memory usage and everything i'll do i do a dedicated video on this later on but uh make sure you you know take part in the learning in public initiative uh you can check out kate's lens on uh on twitter as uh as well and you can give them a shout out if you're using their project and what i'd recommend you to do is that you can take a screenshot over here okay and you can share that you learned about yaml files and uh you can tag uh you know lens and cubeshop and the tree on twitter and share your views and uh i have recently started my blog you can check out in the description i would encourage you to do as well because it's a great way to learn in public and documenting your learnings it's uh it's amazing so make sure you check out these platforms please check out these tools all these three you'll find in the description extremely easy to get started with but if you're a beginner don't worry i'll be doing a tutorial on those as well and not just these tools a lot more tools in cloud native will be coming up because you check out the cnc landscape we're doing the devops bootcamp right cncf landscape is huge so many projects are available so i'm trying to think how to make it easier for everyone to understand uh and we'll we'll get there we'll make it and uh now you just practice and in the next video we'll be learning about docker and kubernetes and stuff so make sure you subscribe and press the like button take a screenshot share it and tag all the amazing tools and stuff and we'll see you in the next one join the learning public initiative hashtag devos with kunal take care bye bye like share and subscribe and comment commenting is important so see you around bye [Music]