Data formats have rules and structure similar to what we have with programming and written languages. Each data format will have specific characteristics:
A RESTful web service is implemented using HTTP. It is a collection of resources with four defined aspects:
RESTful APIs use common HTTP methods including POST, GET, PUT, PATCH and DELETE. As shown in the following table, these correspond to RESTful operations: Create, Read, Update, and Delete (or CRUD).
These are the parts of the URI https://www.example.com/author/book.html#page155 :
These are the different parts of the API request:
The goal of all of these tools is to reduce the complexity and time involved in configuring and maintaining a large-scale network infrastructure with hundreds, even thousands of devices. These same tools can benefit smaller networks as well.
CURL or even better Postman.
Router config:
conf t
username admin priv 15 secret Cisco!23
ip http secure-server
ip http authentication local
restconf
int gig 1
ip add 192.168.1.56 255.255.255.0
no shut
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
ip route 0.0.0.0 0.0.0.0 192.168.1.1
router eigrp 1
net 0.0.0.0
end
debug ip http ssl error
remember authentication/authorization
-user “admin:Cisco!23”
remember header:
Content-Type:application/yang-data+json
GET:
https://sandbox-iosxe-recomm-1.cisco.com/restconf/data/ietf-interfaces:interfaces
https://192.168.10.117/restconf/data/Cisco-IOS-XE-native:native/
https://192.168.10.117/restconf/data/Cisco-IOS-XE-native:native/router/
https://192.168.10.117/restconf/data/Cisco-IOS-XE-native:native/router/router-ospf
https://192.168.10.117/restconf/data/Cisco-IOS-XE-native:native/interface/
https://192.168.10.117/restconf/data/Cisco-IOS-XE-native:native/interface/
https://192.168.10.117/restconf/data/ietf-interfaces:interfaces
https://192.168.10.117/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces
https://192.168.10.117/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1
https://192.168.10.117/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface=Loopback0
POST:
https://192.168.10.117/restconf/data/ietf-interfaces:interfaces
Body:
yum update -y
yum install epel-release -y
yum install ansible -y
cd /etc/ansible
ls
nano ansible.cfg
#host_key_checking=false
remove hashtag after clicking i and then esc :wq
nano hosts
[routers]
192.168.10.117
[routers:vars]
ansible_user=admin
ansible_password=Cisco123
ansible_connection=network_cli
ansible_network_os=ios
ansible_port=22
On the network Device you need to enable SSH
hostname R1
username admin priv 15 pass cisco
ip domain name cisco.com
line vty 0 4
transport input ssh
login local
enable pass cisco
crypto key gen rsa
1024
[routers]
sandbox-iosxe-latest-1.cisco.com
[routers:vars]
ansible_user=developer
ansible_password=C1sco12345
ansible_connection=network_cli
ansible_network_os=ios
ansible_port=22