initial commit
This commit is contained in:
5
TP-02/scripts/README.md
Normal file
5
TP-02/scripts/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# SCRIPTS
|
||||
|
||||
**This directory is required.**
|
||||
|
||||
The scripts directory contains your python scripts.
|
||||
41
TP-02/scripts/create_config.py
Normal file
41
TP-02/scripts/create_config.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import json
|
||||
from jinja2 import Template, Environment, FileSystemLoader
|
||||
|
||||
env = Environment(loader=FileSystemLoader("templates"))
|
||||
|
||||
def load_json_data_from_file(file_path):
|
||||
pass
|
||||
|
||||
def render_network_config(template_name, data):
|
||||
pass
|
||||
|
||||
|
||||
def save_built_config(file_name, data):
|
||||
pass
|
||||
|
||||
|
||||
def create_vlan_config_cpe_marseille():
|
||||
"""
|
||||
Must return two values : router config and the switch config
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def create_vlan_config_cpe_paris():
|
||||
"""
|
||||
Must return two values : router config and the switch config
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
"""
|
||||
process question 1 to 5:
|
||||
"""
|
||||
# r02_config, esw2_config = create_vlan_config_cpe_marseille()
|
||||
# save_built_config('config/vlan_R02.conf', r02_config)
|
||||
# save_built_config('config/vlan_ESW2.conf', esw2_config)
|
||||
|
||||
# r03_config, esw3_config = create_vlan_config_cpe_paris()
|
||||
# save_built_config('config/vlan_R03.conf', r03_config)
|
||||
# save_built_config('config/vlan_ESW3.conf', esw3_config)
|
||||
62
TP-02/scripts/run_napalm.py
Normal file
62
TP-02/scripts/run_napalm.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import json
|
||||
from napalm import get_network_driver
|
||||
|
||||
|
||||
def get_inventory():
|
||||
pass
|
||||
|
||||
|
||||
def get_json_data_from_file(file):
|
||||
pass
|
||||
|
||||
def question_26(device):
|
||||
pass
|
||||
|
||||
|
||||
def question_27(device):
|
||||
pass
|
||||
|
||||
|
||||
def question_28(device):
|
||||
pass
|
||||
|
||||
def question_29(device):
|
||||
pass
|
||||
|
||||
|
||||
def question_30(device):
|
||||
pass
|
||||
|
||||
|
||||
def question_31():
|
||||
pass
|
||||
|
||||
|
||||
def question_32():
|
||||
pass
|
||||
|
||||
|
||||
def question_34():
|
||||
pass
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
r01 = {
|
||||
'hostname':'xx.xx.xx.xx',
|
||||
'username': "xx",
|
||||
'password': "xx"
|
||||
}
|
||||
|
||||
# driver = get_network_driver('ios')
|
||||
# device = driver(**r01)
|
||||
# device.open()
|
||||
|
||||
#question_26(device)
|
||||
#question_27(device)
|
||||
#question_28(device)
|
||||
#question_29(device)
|
||||
#question_30(device)
|
||||
#question_31()
|
||||
#question_32()
|
||||
#question_34()
|
||||
68
TP-02/scripts/run_netmiko.py
Normal file
68
TP-02/scripts/run_netmiko.py
Normal file
@@ -0,0 +1,68 @@
|
||||
import json
|
||||
from netmiko import ConnectHandler
|
||||
|
||||
def question_9(net_connect):
|
||||
pass
|
||||
|
||||
def question_10(net_connect):
|
||||
pass
|
||||
|
||||
def question_11(net_connect):
|
||||
pass
|
||||
|
||||
|
||||
def question_12(net_connect):
|
||||
pass
|
||||
|
||||
def question_13(net_connect):
|
||||
pass
|
||||
|
||||
|
||||
def question_14(net_connect):
|
||||
pass
|
||||
|
||||
|
||||
def question_15(net_connect):
|
||||
pass
|
||||
|
||||
def question_16(net_connect):
|
||||
pass
|
||||
|
||||
|
||||
def question_17(net_connect):
|
||||
pass
|
||||
|
||||
|
||||
def get_inventory():
|
||||
pass
|
||||
|
||||
|
||||
def question_20():
|
||||
pass
|
||||
|
||||
|
||||
def question_21():
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
r01 = {
|
||||
'device_type': 'cisco_ios',
|
||||
'host': 'xx.xx.xx.xx',
|
||||
'username': 'xx',
|
||||
'password': 'xx'
|
||||
}
|
||||
#net_connect = ConnectHandler(**r01)
|
||||
|
||||
#question_9(net_connect)
|
||||
#question_10(net_connect)
|
||||
#question_11(net_connect)
|
||||
#question_12(net_connect)
|
||||
#question_13(net_connect)
|
||||
#question_14(net_connect)
|
||||
#question_15(net_connect)
|
||||
#question_16(net_connect)
|
||||
#question_17(net_connect)
|
||||
# hosts = get_inventory()
|
||||
# print(hosts)
|
||||
#question_20()
|
||||
#question_21()
|
||||
Reference in New Issue
Block a user