Debian Codegraph @

docs/labs/lab03-configlet-management/create_configlet.py

raw
1 # Copyright (c) 2021 Arista Networks, Inc.
2 # Use of this source code is governed by the Apache License 2.0
3 # that can be found in the COPYING file.
4
5 from cvprac.cvp_client import CvpClient
6 import ssl
7 ssl._create_default_https_context = ssl._create_unverified_context
8 import requests.packages.urllib3
9 requests.packages.urllib3.disable_warnings()
10
11 # Create connection to CloudVision
12 clnt = CvpClient()
13 clnt.connect(nodes=['cvp1'], username="username",password="password")
14
15 configletName = "cvprac_example"
16
17 configlet = """!
18 interface Ethernet10
19 description test
20 ip address 10.144.144.1/24
21 !
22 """
23
24 clnt.api.add_configlet(configletName,configlet)