Bartek Grzybowski | fbbdbec | 2019-09-25 16:37:05 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 2 | |
| 3 | import time |
| 4 | import logging |
Bartek Grzybowski | be1067b | 2020-03-04 14:01:02 +0100 | [diff] [blame] | 5 | from vcpecommon import * # pylint: disable=W0614 |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 6 | import commands |
| 7 | import vcpe_custom_service |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 8 | import argparse |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 9 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 10 | # Run the script with [-h|--help] to get usage info |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 11 | |
| 12 | logging.basicConfig(level=logging.INFO, format='%(message)s') |
| 13 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 14 | parser = argparse.ArgumentParser(formatter_class= |
| 15 | argparse.ArgumentDefaultsHelpFormatter) |
| 16 | parser.add_argument('--config',help='Configuration file path',default=None) |
| 17 | args = parser.parse_args() |
| 18 | |
| 19 | cpecommon = VcpeCommon(cfg_file=args.config) |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 20 | custom = vcpe_custom_service.CustomService(cpecommon) |
| 21 | |
| 22 | nodes=['mux'] |
| 23 | hosts = cpecommon.get_vm_ip(nodes) |
| 24 | |
| 25 | custom.del_vgmux_ves_mode(hosts['mux']) |
| 26 | time.sleep(2) |
| 27 | custom.del_vgmux_ves_collector(hosts['mux']) |
Yang Xu | 9f935b2 | 2018-11-22 10:56:52 -0500 | [diff] [blame] | 28 | #exit() |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 29 | |
| 30 | time.sleep(2) |
| 31 | logging.info('Setting vGMUX DCAE collector IP address') |
| 32 | custom.set_vgmux_ves_collector(hosts['mux']) |
| 33 | time.sleep(2) |
| 34 | vgmux_vnf_name = cpecommon.load_object('vgmux_vnf_name') |
| 35 | logging.info('vGMUX VNF instance name is %s', vgmux_vnf_name) |
| 36 | logging.info('Letting vGMUX report packet loss to DCAE') |
| 37 | custom.set_vgmux_packet_loss_rate(hosts['mux'], 55, vgmux_vnf_name) |