Debian Codegraph @

docs/labs/lab03-configlet-management/update_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 # Modify existing configlet
16
17 configletName = "cvprac_example"
18
19 configlet = """!
20 interface Ethernet10
21 description DUB_R04
22 ip address 10.144.144.2/24
23 !
24 """
25
26 configletID = clnt.api.get_configlet_by_name(configletName)['key']
27
28 clnt.api.update_configlet( configlet, configletID, configletName)