DevOps Classroom notes 17/Dec/2023

Name Value Pair

  • Any data will be having two information
    • name (key)
    • value
  • Lets write the name and value <name>: <value>
model: Dell Lattitue 7490
RAM: 32 GB
processor: i7 6th Gen
apps:

address:
  • Data Types:
    • Simple/Scalar
      • number
      • text
      • boolean
    • Complex
      • list/array
      • objects/maps
  • Lets design structure for resume
Name: <text>
role: <text>
Phone: <text>
Email: <text>
Summary: <text>
Skills: list<name-value> (scripting: shell, bash, powershell)
Experience: list<map>
  • Lets design structure for movie ticket
Theatre:  <text>
ticketnumber: <number>
Screen: <number>
seat: <text>
price: <number>
showtime: <text>

JSON (Java Script Object Notation)

  • JSON is a format for representing data in name value pairs. This is inspired from java script objects
  • details:
    • text: use single or double quotes
    • number: directly write value no quotes required
    • boolean: true false
    • list/array: []
    • map/object: {}
  • Sample resume in Json
{
    "name": "xxxxx",
    "role": "xxxxx",
    "phone": "xxxxx",
    "email": "xxxxx",
    "summary": "xxxxx",
    "skills": {
        "scripting": [ "bash", "powershell", "python" ],
        "os": ["Linux", "Windows" ]
    }
}
  • Sample json
{
    "Vpcs": [
        {
            "CidrBlock": "172.31.0.0/16",
            "DhcpOptionsId": "dopt-57c2e92d",
            "State": "available",
            "VpcId": "vpc-cd32bcb0",
            "OwnerId": "678879106782",
            "InstanceTenancy": "default",
            "CidrBlockAssociationSet": [
                {
                    "AssociationId": "vpc-cidr-assoc-80e77def",
                    "CidrBlock": "172.31.0.0/16",
                    "CidrBlockState": {
                        "State": "associated"
                    }
                }
            ],
            "IsDefault": true
        },
        {
            "CidrBlock": "10.100.0.0/16",
            "DhcpOptionsId": "dopt-57c2e92d",
            "State": "available",
            "VpcId": "vpc-0bfd00988c8efeeb0",
            "OwnerId": "678879106782",
            "InstanceTenancy": "default",
            "CidrBlockAssociationSet": [
                {
                    "AssociationId": "vpc-cidr-assoc-01681eb957dd95726",
                    "CidrBlock": "10.100.0.0/16",
                    "CidrBlockState": {
                        "State": "associated"
                    }
                }
            ],
            "IsDefault": false,
            "Tags": [
                {
                    "Key": "Env",
                    "Value": "Dev"
                },
                {
                    "Key": "Name",
                    "Value": "ntier-primary-manual"
                }
            ]
        }
    ]
}
  • Lets use jso viewer and collaps the items on right hand side to find the structure Refer Here
  • If you want to query json we have two popular ways
  • Azure, AWS CLI support jmes natively

YAML

  • YAML is also a data representation format which use name value pairs
  • YAML is heavily inspired from python
  • details:
    • text: use single or double quotes or without quotes (if value has characters )
    • number: directly write value no quotes required
    • boolean: true false yes no
    • list/array: [] or refer below
    • map/object: {} or refer below
  • Sample resume in YAML
name: xxxxxx
role: xxxxxx
phone: 'xxxxxx'
email: xxxxxx
summary: xxxxxx
skills:
  scripting: 
    - bash
    - powershell
    - python
  os:
    - linux
    - windows  
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%