blob: 1636e397c90a6130457d04e8d94e32ea56640e8e [file] [log] [blame]
Bartek Grzybowskifbbdbec2019-09-25 16:37:05 +02001#!/usr/bin/env python
Kang Xi11d278c2018-04-06 16:56:04 -04002
3import time
4import logging
Bartek Grzybowskibe1067b2020-03-04 14:01:02 +01005from vcpecommon import * # pylint: disable=W0614
Kang Xi11d278c2018-04-06 16:56:04 -04006import commands
7import vcpe_custom_service
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +01008import argparse
Kang Xi11d278c2018-04-06 16:56:04 -04009
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +010010# Run the script with [-h|--help] to get usage info
Kang Xi11d278c2018-04-06 16:56:04 -040011
12logging.basicConfig(level=logging.INFO, format='%(message)s')
13
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +010014parser = argparse.ArgumentParser(formatter_class=
15 argparse.ArgumentDefaultsHelpFormatter)
16parser.add_argument('--config',help='Configuration file path',default=None)
17args = parser.parse_args()
18
19cpecommon = VcpeCommon(cfg_file=args.config)
Kang Xi11d278c2018-04-06 16:56:04 -040020custom = vcpe_custom_service.CustomService(cpecommon)
21
22nodes=['mux']
23hosts = cpecommon.get_vm_ip(nodes)
24
25custom.del_vgmux_ves_mode(hosts['mux'])
26time.sleep(2)
27custom.del_vgmux_ves_collector(hosts['mux'])
Yang Xu9f935b22018-11-22 10:56:52 -050028#exit()
Kang Xi11d278c2018-04-06 16:56:04 -040029
30time.sleep(2)
31logging.info('Setting vGMUX DCAE collector IP address')
32custom.set_vgmux_ves_collector(hosts['mux'])
33time.sleep(2)
34vgmux_vnf_name = cpecommon.load_object('vgmux_vnf_name')
35logging.info('vGMUX VNF instance name is %s', vgmux_vnf_name)
36logging.info('Letting vGMUX report packet loss to DCAE')
37custom.set_vgmux_packet_loss_rate(hosts['mux'], 55, vgmux_vnf_name)