Debian Codegraph @

docs/labs/lab04-container-management/assign_configlet_to_container.py

raw
1 # Copyright (c) 2020 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 container_name = "TP_LEAFS"
16
17 configletName = 'cvprac_example2'
18
19 container = clnt.api.get_container_by_name(container_name)
20
21 configlet = clnt.api.get_configlet_by_name(configletName)
22
23 clnt.api.apply_configlets_to_container("", container, [configlet])