Debian Codegraph @

docs/labs/lab05-device-management/remove_image_from_device.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(['cvp1'],'username', 'password')
14
15 image_name = "vEOS-4.26.0.1F"
16 image = clnt.api.get_image_bundle_by_name(image_name)
17
18 device_name = "tp-avd-leaf2"
19 device = clnt.api.get_device_by_name(device_name)
20
21 clnt.api.remove_image_from_device(image, device)