#! /usr/bin/python
-import sys
+
import logging
+logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(name)s.%(funcName)s(): %(message)s')
+
+import sys
from vcpecommon import *
import sdcutils
import soutils
def deploy_brg_only():
- logging.basicConfig(level=logging.INFO, format='%(message)s')
logger = logging.getLogger(__name__)
vcpecommon = VcpeCommon()
def closed_loop(lossrate=0):
- if lossrate > 0:
- while 'y' != raw_input('Please enter docker container "drools" in Policy VM and type "policy stop". Then enter y here: ').lower():
- continue
nodes = ['brg', 'mux']
logger = logging.getLogger('__name__')
vcpecommon = VcpeCommon(nodes)
time.sleep(2)
vcpecommon.set_vgmux_packet_loss_rate(lossrate, vcpecommon.load_vgmux_vnf_name())
if lossrate > 0:
- print('Please enter docker container "drools" in Policy VM and type "policy start". Then observe vGMUX being restarted.')
+ print('Now please observe vGMUX being restarted')
def init_so_sdnc():
vgw_vfmod_name_index= 0
vcpecommon.save_object(vgw_vfmod_name_index, vcpecommon.vgw_vfmod_name_index_file)
-def download_vcpe_service_templates():
+
+def init():
vcpecommon = VcpeCommon()
+ init_sdc(vcpecommon)
+ download_vcpe_service_templates(vcpecommon)
+
+
+def init_sdc(vcpecommon):
sdc = sdcutils.SdcUtils(vcpecommon)
- sdc.get_service_list()
+ sdc.create_allotted_resource_subcategory('BRG')
+
+
+def download_vcpe_service_templates(vcpecommon):
+ sdc = sdcutils.SdcUtils(vcpecommon)
+ sdc.download_vcpe_service_template()
+
def tmp_sniro():
logger = logging.getLogger(__name__)
# Setting up SNIRO
config_sniro(vcpecommon, svc_instance_uuid['gmux'], svc_instance_uuid['brg'])
+
def test():
vcpecommon = VcpeCommon()
print("oom-k8s-04 public ip: %s" % (vcpecommon.get_vm_public_ip_by_nova('oom-k8s-04')))
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG, format='%(message)s')
+if __name__ == '__main__':
print('----------------------------------------------------------------------------------------------------')
print(' vcpe.py: Brief info about this program')
# print(' vcpe.py sdc: Onboard VNFs, design and distribute vCPE services (under development)')
if sys.argv[1] == 'sdc':
print('Under development')
elif sys.argv[1] == 'init':
- if 'y' == raw_input('Ready to add customer service data to SDNC and SO DBs? This is needed only once.'
- 'y/n: ').lower():
- download_vcpe_service_templates()
+ init()
init_so_sdnc()
elif sys.argv[1] == 'infra':
if 'y' == raw_input('Ready to deploy infrastructure? y/n: ').lower():