blob: 43255c94c9afdebd81ce4b267cc7c35fa62123a6 [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
5import json
6import mysql.connector
7import ipaddress
8import re
9import sys
10import base64
11from vcpecommon import *
12import preload
13import commands
14import vcpe_custom_service
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +010015import argparse
Kang Xi11d278c2018-04-06 16:56:04 -040016
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +010017# Run the script with [-h|--help] to get usage info
Kang Xi11d278c2018-04-06 16:56:04 -040018
19logging.basicConfig(level=logging.INFO, format='%(message)s')
20
Bartek Grzybowski01abb5d2019-12-17 15:09:26 +010021parser = argparse.ArgumentParser(formatter_class=
22 argparse.ArgumentDefaultsHelpFormatter)
23parser.add_argument('--config',help='Configuration file path',default=None)
24args = parser.parse_args()
25
26cpecommon = VcpeCommon(cfg_file=args.config)
Kang Xi11d278c2018-04-06 16:56:04 -040027custom = vcpe_custom_service.CustomService(cpecommon)
28
29nodes=['mux']
30hosts = cpecommon.get_vm_ip(nodes)
31
32custom.del_vgmux_ves_mode(hosts['mux'])
33time.sleep(2)
34custom.del_vgmux_ves_collector(hosts['mux'])
Yang Xu9f935b22018-11-22 10:56:52 -050035#exit()
Kang Xi11d278c2018-04-06 16:56:04 -040036
37time.sleep(2)
38logging.info('Setting vGMUX DCAE collector IP address')
39custom.set_vgmux_ves_collector(hosts['mux'])
40time.sleep(2)
41vgmux_vnf_name = cpecommon.load_object('vgmux_vnf_name')
42logging.info('vGMUX VNF instance name is %s', vgmux_vnf_name)
43logging.info('Letting vGMUX report packet loss to DCAE')
44custom.set_vgmux_packet_loss_rate(hosts['mux'], 55, vgmux_vnf_name)