SlideShare a Scribd company logo
1 of 32
Introduction to GraphQL
A use case using Arista cEOS and Nautobot
Thursday, March 10, 2022
Introduction to GraphQL for NetDevOps Engineers
Details
GraphQL is a query language for APIs and has been
adopted by popular web services, including GitHub,
ArangoDB and Nautobot, a network automation platform.
This session introduces GraphQL and demonstrates
using Nautobot as a Source of Truth for managing the
configuration of Arista Containerized EOS (cEOS) routers
using Ansible.
Network engineers who wish to learn GraphQL for
Nautobot, Ansible, and cEOS will benefit from this
session. A sample code repository will be published for
attendees.
Photo Credit: Dan Dimmock on Unsplash
What’s in it for me?
gitlab.com/joelwking/graphql4netdevops
Arista CloudEOS
Network to Code
Ansible
gitlab.com/joelwking/graphql4netdevops
topology
CONTAINER
(HOST) EC2 INSTANCE
CONTAINER
NET1
NET2
AristacEOSLab
version4.26.4M Nautobot
CONTAINER
sshadmin@<ec2_instance>-p 2201 -p 2202
http://<ec2_instance>:8001
VSCODE DEVCONTAINER
httpapi_port:4431 : 4432
ansible.netcommon.httpapi
ansible.netcommon.network_cli
Install lab environment
RACKS
PODS (RACK GROUPS)
RACKS
Inventory
Receiving
Connection
Initial
Config
LAB_BUILD.md
DAY ZERO
populate Nautobot
CONTAINER
(HOST) EC2 INSTANCE
CONTAINER
NET1
NET2
AristacEOSLab
version4.26.4M Nautobot
CONTAINER
http://<ec2_instance>:8001
files/global.yml
build_nautobot.yml
group_vars/all.yml
nautobot:
url: "http://{{ lab_instance }}:8001"
token: '{{ vault_nautobot.token }}'
ANSIBLE PLAYBOOK
onboard device using a YAML file
host_vars/ceos1.example.net.yml
files/inventory.yml
group_vars/cloud_ceos/vars.yml
files/vault.yml
onboard device into Nautobot
history
https://engineering.fb.com/2015/09/14/core-data/graphql-a-data-query-language
Developed in 2012, for Facebook’s native mobile apps - query language for APIs - returns JSON
GraphQL vs APIs
• Supports Queries (via GET or POST)
modifying state in the server (mutation)
• HTTP via a single URL endpoint
• Returns the data that's explicitly requested
(avoiding versioning)
• Query fields are same as the results
(you get back what you expect)
• Arguments implement data transformations
e.g. height(unit: FOOT)
Supports all REST Verbs: POST PATCH GET …
HTTP suite of URLs for each resource
New features to an API = new version
Postman, Swagger | OpenAPI
Client-side data transformations
GraphQL
GraphQL is a query language for your API
{ API } { GraphQL } nautobot.query_graphql
Nautobot
GraphiQL
http://ec2-54-175-161-85.compute-1.amazonaws.com:8001/graphql/
GraphiQL is an in-browser tool for writing,
validating, and testing GraphQL queries.
GraphiQL is an in-browser tool Schema definition
arguments
{
"data": {
"devices": [
{
"name": "ceos1.example.net",
"interfaces": [
{
"mtu": 9214,
"name": "Ethernet1"
}
],
"tags": [
{
"name": "r00"
}
],
"device_role": {
"name": "LEAF"
}
}
]
}
}
GraphQL, every field and nested object can get its own set of arguments
RESULT
query ArgumentExample {
devices(name: "ceos1.example.net") {
name
interfaces(name: "Ethernet1") {
mtu
name
}
tags {
name
}
device_role{
name
}
}
}
graph Variables
factor dynamic values out of the query and pass them as a separate dictionary.
Eliminate any static value(s) in the
query with $variableName
Declare $variableName as one of the variables
accepted by the query
Pass variableName: value in the separate,
transport-specific (usually JSON) variables
dictionary
arguments: limiting results
multiple GraphQL operations in a request
query MultipleQueries {
devices(name: "ceos1.example.net") {
name
interfaces(name: "Ethernet1") {
mtu
name
}
tags {
name
}
device_role{
name
}
}
device_roles {
name
color
description
}
}
{
"data": {
"devices": [
{
"name": "ceos1.example.net",
"interfaces": [
{
"mtu": 9214,
"name": "Ethernet1"
}
],
"tags": [
{
"name": "r00"
}
],
"device_role": {
"name": "LEAF"
}
}
],
"device_roles": [
{
"name": "LEAF",
"color": "ffeeff",
"description": ""
},
{
"name": "SPINE",
"color": "ffeeff",
"description": ""
},
- name: configure a device defined in Nautobot
hosts: '{{ group_name | default("cloud_ceos") }}'
gather_facts: false
vars:
graph_vars:
device_name: '{{ inventory_hostname }}'
tip
./configure_device.yml --limit ceos1.example.net
execute a GraphQL query per device at the beginning of the playbook
--limit ceos1.example.net,ceos2.example.net
ansible-playbook ./configure_device.yml --limit ceos1.example.net,ceos2.example.net -f 1
-i files/inventory.yml
GraphQL
inventory plugin
ok: [ceos1.example.org] => {
"hostvars[inventory_hostname]": {
"ansible_check_mode": false,
...
"ansible_host": "ceos1.example.org",
"ansible_inventory_sources": [
"/workspaces/graphql4netdevops/playbooks/files/inventory_gql.yml"
],
"device": {
"interfaces": [
...
{
"address": "198.51.100.3/32",
"description": "management",
"name": "Loopback0",
"tags": [
"loopback"
],
"type": "Virtual"
}
],
"name": "ceos1.example.org",
"rack": "r10",
"role": "LEAF",
"serial_number": "AD3C6BFFD846916E0875D8EDAA7F83FB-2",
"site": "RALEIGH",
"type": "N5860-48SC"
},
"device_role": {
"name": "LEAF"
},
ansible-playbook 
./graph_ql_as_inventory.yml 
-i files/inventory_gql.yml
- name: GraphQL as an inventory source
hosts: all
gather_facts: false
tasks:
- name: Display all variables/facts
debug:
var: hostvars[inventory_hostname]
gitlab.com/joelwking/graphql4netdevops
/ config_contexts
Nautobot
{
devices(name: "ceos1.example.net") {
name
config_context
tags {
name
}
device_role{
name
}
}
}
Git as a data source
config contexts + extensibility + GraphQL
RACKS
PODS (RACK GROUPS)
RACKS
R04
RACKS
PODS (RACK GROUPS)
RACKS
ASN
64521
ASN
64621
TAG
TAG
ceos1.example.net
{
"_metadata":{
"name":"r00",
"weight": 1000,
"description":"Rack specific",
"is_active":true,
"tags":[{"slug": "r00"}],
"schema":""
},
"asn":{
"number":64521},
"acl": {
"definitions":{
"named ": {
"PERMIT_ROUTES":[
"10 permit ipanyany"
]
}
}
}
}
config contexts + extensibility + GraphQL
RACKS
PODS (RACK GROUPS)
RACKS
R04
RACKS
PODS (RACK GROUPS)
RACKS
ASN
64521
ASN
64621
TAG
TAG
r00.json
Assignments:
Region, Site, Role, Device type, Platform, Cluster group, Cluster, Tenant group,
Tenant, Tag
GraphQL results
config context by device and tag
TAG
Learning environment
Arista cEOS
Ansible
VSCode
Nautobot
Overview of GraphQL
GraphIQL
arguments
variables
Ansible inventory plugin
Configuration Contexts
Git as a Data Source
Reference config contexts in GraphQL Query
past sessions content posted at
https://www.wwt.com/community/programmability-and-
automation-meetup-group/
 GraphQL
https://graphql.org/learn/
 graphql4netdevops
https://gitlab.com/joelwking/graphql4netdevops
 Programmability and Automation Meetup Group [RECORDINGS]
https://www.wwt.com/community/programmability-and-automation-meetup-group/
 GraphQL user guide
https://nautobot.readthedocs.io/en/latest/user-guides/graphql/
 Config Contexts
https://nautobot.readthedocs.io/en/latest/additional-features/config-contexts/
https://blog.networktocode.com/post/keeping-data-clean-in-nautobot/
 Nautobot Solution Guide
https://www.networktocode.com/wp-
content/uploads/2021/02/Nautobot_Technical_Solution_Guide.pdf
Introduction to GraphQL using Nautobot and Arista cEOS

More Related Content

What's hot

Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introductionsoniasnowfrog
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPThomas Graf
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Databricks
 
Running Apache Spark on Kubernetes: Best Practices and Pitfalls
Running Apache Spark on Kubernetes: Best Practices and PitfallsRunning Apache Spark on Kubernetes: Best Practices and Pitfalls
Running Apache Spark on Kubernetes: Best Practices and PitfallsDatabricks
 
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...InfluxData
 
Cisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceCisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceBertrand Duvivier
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of TruthJoel W. King
 
Application Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centreApplication Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centreCisco Canada
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlJiangjie Qin
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructuredAmi Mahloof
 
Monitoring With Prometheus
Monitoring With PrometheusMonitoring With Prometheus
Monitoring With PrometheusKnoldus Inc.
 
Enabling ABAC with Accumulo and Ranger integration
Enabling ABAC with Accumulo and Ranger integrationEnabling ABAC with Accumulo and Ranger integration
Enabling ABAC with Accumulo and Ranger integrationDataWorks Summit
 

What's hot (20)

Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introduction
 
Cloud Monitoring tool Grafana
Cloud Monitoring  tool Grafana Cloud Monitoring  tool Grafana
Cloud Monitoring tool Grafana
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
 
Running Apache Spark on Kubernetes: Best Practices and Pitfalls
Running Apache Spark on Kubernetes: Best Practices and PitfallsRunning Apache Spark on Kubernetes: Best Practices and Pitfalls
Running Apache Spark on Kubernetes: Best Practices and Pitfalls
 
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
 
Cisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceCisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advance
 
Terraform
TerraformTerraform
Terraform
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Application Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centreApplication Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centre
 
HAProxy
HAProxy HAProxy
HAProxy
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Monitoring With Prometheus
Monitoring With PrometheusMonitoring With Prometheus
Monitoring With Prometheus
 
Enabling ABAC with Accumulo and Ranger integration
Enabling ABAC with Accumulo and Ranger integrationEnabling ABAC with Accumulo and Ranger integration
Enabling ABAC with Accumulo and Ranger integration
 

Similar to Introduction to GraphQL using Nautobot and Arista cEOS

GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchNikolas Burk
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Karel Minarik
 
GraphQL API in Clojure
GraphQL API in ClojureGraphQL API in Clojure
GraphQL API in ClojureKent Ohashi
 
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and TypescriptMongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and TypescriptMongoDB
 
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScriptMongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScriptMongoDB
 
Nikita Galkin "Looking for the right tech stack for GraphQL application"
Nikita Galkin "Looking for the right tech stack for GraphQL application"Nikita Galkin "Looking for the right tech stack for GraphQL application"
Nikita Galkin "Looking for the right tech stack for GraphQL application"Fwdays
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansCarol McDonald
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma CloudNikolas Burk
 
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Michael Reinsch
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Djangokenluck2001
 
Let's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architectureLet's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architectureAndrii Gakhov
 
Применение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовПрименение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовCOMAQA.BY
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)Rob Crowley
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLJohn David Duncan
 
Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNikolas Burk
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsPeter Pilgrim
 
Применение паттерна Page Object для автоматизации веб сервисов - новый взгляд
Применение паттерна Page Object для автоматизации веб сервисов - новый взглядПрименение паттерна Page Object для автоматизации веб сервисов - новый взгляд
Применение паттерна Page Object для автоматизации веб сервисов - новый взглядCOMAQA.BY
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Intro to Spark and Spark SQL
Intro to Spark and Spark SQLIntro to Spark and Spark SQL
Intro to Spark and Spark SQLjeykottalam
 

Similar to Introduction to GraphQL using Nautobot and Arista cEOS (20)

GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]
 
GraphQL API in Clojure
GraphQL API in ClojureGraphQL API in Clojure
GraphQL API in Clojure
 
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and TypescriptMongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
 
Data Pipeline at Tapad
Data Pipeline at TapadData Pipeline at Tapad
Data Pipeline at Tapad
 
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScriptMongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
 
Nikita Galkin "Looking for the right tech stack for GraphQL application"
Nikita Galkin "Looking for the right tech stack for GraphQL application"Nikita Galkin "Looking for the right tech stack for GraphQL application"
Nikita Galkin "Looking for the right tech stack for GraphQL application"
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma Cloud
 
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
 
Let's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architectureLet's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architecture
 
Применение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовПрименение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисов
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
 
Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and Prisma
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala apps
 
Применение паттерна Page Object для автоматизации веб сервисов - новый взгляд
Применение паттерна Page Object для автоматизации веб сервисов - новый взглядПрименение паттерна Page Object для автоматизации веб сервисов - новый взгляд
Применение паттерна Page Object для автоматизации веб сервисов - новый взгляд
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Intro to Spark and Spark SQL
Intro to Spark and Spark SQLIntro to Spark and Spark SQL
Intro to Spark and Spark SQL
 

More from Joel W. King

DevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptxDevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptxJoel W. King
 
BRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptxBRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptxJoel W. King
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development EnvironmentsJoel W. King
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introductionJoel W. King
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network AnalysisJoel W. King
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Joel W. King
 
Cisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design GuideCisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design GuideJoel W. King
 
Meraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk PhantomMeraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk PhantomJoel W. King
 
Business Ready Teleworker Design Guide
Business Ready Teleworker Design GuideBusiness Ready Teleworker Design Guide
Business Ready Teleworker Design GuideJoel W. King
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleJoel W. King
 
DevNet Study Group: Using a SDK
DevNet Study Group: Using a SDKDevNet Study Group: Using a SDK
DevNet Study Group: Using a SDKJoel W. King
 
Foray into Ansible Content Collections
Foray into Ansible Content CollectionsForay into Ansible Content Collections
Foray into Ansible Content CollectionsJoel W. King
 
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...Joel W. King
 
Enabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with AnsibleEnabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with AnsibleJoel W. King
 
Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...Joel W. King
 
Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...Joel W. King
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of TruthJoel W. King
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Joel W. King
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network EngineersJoel W. King
 

More from Joel W. King (20)

DevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptxDevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptx
 
BRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptxBRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptx
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development Environments
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network Analysis
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.
 
Cisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design GuideCisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design Guide
 
Meraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk PhantomMeraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk Phantom
 
Business Ready Teleworker Design Guide
Business Ready Teleworker Design GuideBusiness Ready Teleworker Design Guide
Business Ready Teleworker Design Guide
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using Ansible
 
DevNet Study Group: Using a SDK
DevNet Study Group: Using a SDKDevNet Study Group: Using a SDK
DevNet Study Group: Using a SDK
 
Foray into Ansible Content Collections
Foray into Ansible Content CollectionsForay into Ansible Content Collections
Foray into Ansible Content Collections
 
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
 
Enabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with AnsibleEnabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with Ansible
 
Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...
 
Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 
Under the Hood
Under the HoodUnder the Hood
Under the Hood
 

Recently uploaded

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Introduction to GraphQL using Nautobot and Arista cEOS

  • 1. Introduction to GraphQL A use case using Arista cEOS and Nautobot Thursday, March 10, 2022
  • 2. Introduction to GraphQL for NetDevOps Engineers Details GraphQL is a query language for APIs and has been adopted by popular web services, including GitHub, ArangoDB and Nautobot, a network automation platform. This session introduces GraphQL and demonstrates using Nautobot as a Source of Truth for managing the configuration of Arista Containerized EOS (cEOS) routers using Ansible. Network engineers who wish to learn GraphQL for Nautobot, Ansible, and cEOS will benefit from this session. A sample code repository will be published for attendees. Photo Credit: Dan Dimmock on Unsplash
  • 3. What’s in it for me? gitlab.com/joelwking/graphql4netdevops Arista CloudEOS Network to Code Ansible
  • 5. topology CONTAINER (HOST) EC2 INSTANCE CONTAINER NET1 NET2 AristacEOSLab version4.26.4M Nautobot CONTAINER sshadmin@<ec2_instance>-p 2201 -p 2202 http://<ec2_instance>:8001 VSCODE DEVCONTAINER httpapi_port:4431 : 4432 ansible.netcommon.httpapi ansible.netcommon.network_cli
  • 6. Install lab environment RACKS PODS (RACK GROUPS) RACKS Inventory Receiving Connection Initial Config LAB_BUILD.md DAY ZERO
  • 7. populate Nautobot CONTAINER (HOST) EC2 INSTANCE CONTAINER NET1 NET2 AristacEOSLab version4.26.4M Nautobot CONTAINER http://<ec2_instance>:8001 files/global.yml build_nautobot.yml group_vars/all.yml nautobot: url: "http://{{ lab_instance }}:8001" token: '{{ vault_nautobot.token }}' ANSIBLE PLAYBOOK
  • 8. onboard device using a YAML file host_vars/ceos1.example.net.yml files/inventory.yml group_vars/cloud_ceos/vars.yml files/vault.yml
  • 10.
  • 11. history https://engineering.fb.com/2015/09/14/core-data/graphql-a-data-query-language Developed in 2012, for Facebook’s native mobile apps - query language for APIs - returns JSON
  • 12. GraphQL vs APIs • Supports Queries (via GET or POST) modifying state in the server (mutation) • HTTP via a single URL endpoint • Returns the data that's explicitly requested (avoiding versioning) • Query fields are same as the results (you get back what you expect) • Arguments implement data transformations e.g. height(unit: FOOT) Supports all REST Verbs: POST PATCH GET … HTTP suite of URLs for each resource New features to an API = new version Postman, Swagger | OpenAPI Client-side data transformations
  • 13. GraphQL GraphQL is a query language for your API { API } { GraphQL } nautobot.query_graphql Nautobot
  • 14. GraphiQL http://ec2-54-175-161-85.compute-1.amazonaws.com:8001/graphql/ GraphiQL is an in-browser tool for writing, validating, and testing GraphQL queries.
  • 15. GraphiQL is an in-browser tool Schema definition
  • 16. arguments { "data": { "devices": [ { "name": "ceos1.example.net", "interfaces": [ { "mtu": 9214, "name": "Ethernet1" } ], "tags": [ { "name": "r00" } ], "device_role": { "name": "LEAF" } } ] } } GraphQL, every field and nested object can get its own set of arguments RESULT query ArgumentExample { devices(name: "ceos1.example.net") { name interfaces(name: "Ethernet1") { mtu name } tags { name } device_role{ name } } }
  • 17. graph Variables factor dynamic values out of the query and pass them as a separate dictionary. Eliminate any static value(s) in the query with $variableName Declare $variableName as one of the variables accepted by the query Pass variableName: value in the separate, transport-specific (usually JSON) variables dictionary
  • 19. multiple GraphQL operations in a request query MultipleQueries { devices(name: "ceos1.example.net") { name interfaces(name: "Ethernet1") { mtu name } tags { name } device_role{ name } } device_roles { name color description } } { "data": { "devices": [ { "name": "ceos1.example.net", "interfaces": [ { "mtu": 9214, "name": "Ethernet1" } ], "tags": [ { "name": "r00" } ], "device_role": { "name": "LEAF" } } ], "device_roles": [ { "name": "LEAF", "color": "ffeeff", "description": "" }, { "name": "SPINE", "color": "ffeeff", "description": "" },
  • 20. - name: configure a device defined in Nautobot hosts: '{{ group_name | default("cloud_ceos") }}' gather_facts: false vars: graph_vars: device_name: '{{ inventory_hostname }}' tip ./configure_device.yml --limit ceos1.example.net execute a GraphQL query per device at the beginning of the playbook --limit ceos1.example.net,ceos2.example.net
  • 21. ansible-playbook ./configure_device.yml --limit ceos1.example.net,ceos2.example.net -f 1 -i files/inventory.yml
  • 22. GraphQL inventory plugin ok: [ceos1.example.org] => { "hostvars[inventory_hostname]": { "ansible_check_mode": false, ... "ansible_host": "ceos1.example.org", "ansible_inventory_sources": [ "/workspaces/graphql4netdevops/playbooks/files/inventory_gql.yml" ], "device": { "interfaces": [ ... { "address": "198.51.100.3/32", "description": "management", "name": "Loopback0", "tags": [ "loopback" ], "type": "Virtual" } ], "name": "ceos1.example.org", "rack": "r10", "role": "LEAF", "serial_number": "AD3C6BFFD846916E0875D8EDAA7F83FB-2", "site": "RALEIGH", "type": "N5860-48SC" }, "device_role": { "name": "LEAF" }, ansible-playbook ./graph_ql_as_inventory.yml -i files/inventory_gql.yml - name: GraphQL as an inventory source hosts: all gather_facts: false tasks: - name: Display all variables/facts debug: var: hostvars[inventory_hostname]
  • 23.
  • 25. Git as a data source
  • 26. config contexts + extensibility + GraphQL RACKS PODS (RACK GROUPS) RACKS R04 RACKS PODS (RACK GROUPS) RACKS ASN 64521 ASN 64621 TAG TAG ceos1.example.net
  • 27. { "_metadata":{ "name":"r00", "weight": 1000, "description":"Rack specific", "is_active":true, "tags":[{"slug": "r00"}], "schema":"" }, "asn":{ "number":64521}, "acl": { "definitions":{ "named ": { "PERMIT_ROUTES":[ "10 permit ipanyany" ] } } } } config contexts + extensibility + GraphQL RACKS PODS (RACK GROUPS) RACKS R04 RACKS PODS (RACK GROUPS) RACKS ASN 64521 ASN 64621 TAG TAG r00.json Assignments: Region, Site, Role, Device type, Platform, Cluster group, Cluster, Tenant group, Tenant, Tag
  • 28. GraphQL results config context by device and tag TAG
  • 29. Learning environment Arista cEOS Ansible VSCode Nautobot Overview of GraphQL GraphIQL arguments variables Ansible inventory plugin Configuration Contexts Git as a Data Source Reference config contexts in GraphQL Query
  • 30. past sessions content posted at https://www.wwt.com/community/programmability-and- automation-meetup-group/
  • 31.  GraphQL https://graphql.org/learn/  graphql4netdevops https://gitlab.com/joelwking/graphql4netdevops  Programmability and Automation Meetup Group [RECORDINGS] https://www.wwt.com/community/programmability-and-automation-meetup-group/  GraphQL user guide https://nautobot.readthedocs.io/en/latest/user-guides/graphql/  Config Contexts https://nautobot.readthedocs.io/en/latest/additional-features/config-contexts/ https://blog.networktocode.com/post/keeping-data-clean-in-nautobot/  Nautobot Solution Guide https://www.networktocode.com/wp- content/uploads/2021/02/Nautobot_Technical_Solution_Guide.pdf

Editor's Notes

  1. https://thenewstack.io/introduction-to-graphql/
  2. Mutations can be used for adding data Mutation queries modify data in the data store and returns a value. It can be used to insert, update, or delete data. Mutations are defined as a part of the schema.
  3. https://nautobot.readthedocs.io/en/latest/user-guides/graphql/
  4. https://gitlab.com/joelwking/graphql4netdevops/-/blob/main/playbooks/configure_device.yml#L37
  5. https://dgraph.io/docs/graphql/api/multiples/
  6. Include picture of the components Of Git as a Data Source
  7. Git as a data source https://blog.networktocode.com/post/keeping-data-clean-in-nautobot/
  8. Region Site Role Device type Platform Cluster group Cluster Tenant group Tenant Tag
  9. https://nautobot.readthedocs.io/en/latest/models/extras/configcontext/