예제 #1
0
 def __init__(self):
     self.Plan = base.create_dynamic_model(keyspace=CONF.keyspace,
                                           baseclass=Plan,
                                           classname="Plan")
     self.TriageTool = base.create_dynamic_model(keyspace=CONF.keyspace,
                                                 baseclass=TriageTool,
                                                 classname="TriageTool")
예제 #2
0
 def __init__(self):
     self.Plan = base.create_dynamic_model(keyspace=CONF.keyspace,
                                           baseclass=Plan,
                                           classname="Plan")
     self.OrderLock = base.create_dynamic_model(keyspace=CONF.keyspace,
                                                baseclass=OrderLock,
                                                classname="OrderLock")
예제 #3
0
 def __init__(self):
     self.Region_PlaceHolder = base.create_dynamic_model(
         keyspace=CONF.keyspace,
         baseclass=RegionPlaceholders,
         classname="RegionPlaceholders")
     self.Country_Latency = base.create_dynamic_model(
         keyspace=CONF.keyspace,
         baseclass=CountryLatency,
         classname="CountryLatency")
예제 #4
0
def plan_prepare(conf):
    music = db_backend.get_client()
    music.keyspace_create(keyspace=conf.keyspace)
    plan_tmp = base.create_dynamic_model(keyspace=conf.keyspace,
                                         baseclass=plan.Plan,
                                         classname="Plan")
    return plan_tmp
예제 #5
0
def plan_prepare(conf):
    music = api.API()
    music.keyspace_create(keyspace=conf.keyspace)
    plan_tmp = base.create_dynamic_model(keyspace=conf.keyspace,
                                         baseclass=plan.Plan,
                                         classname="Plan")
    return plan_tmp
예제 #6
0
    def __init__(self, conf):
        self.conf = conf

        # Set up Music access.
        self.music = api.API()
        self.music.keyspace_create(keyspace=conf.keyspace)

        # Dynamically create a plan class for the specified keyspace
        self.Plan = base.create_dynamic_model(
            keyspace=conf.keyspace, baseclass=plan.Plan, classname="Plan")
        self.OrderLock = base.create_dynamic_model(
            keyspace=conf.keyspace, baseclass=order_lock.OrderLock, classname="OrderLock")

        if not self.Plan:
            raise
        if not self.OrderLock:
            raise
예제 #7
0
def plan_prepare(conf):
    cfg.CONF.set_override('certificate_authority_bundle_file',
                          '../AAF_RootCA.cer', 'music_api')
    music = db_backend.get_client()
    music.keyspace_create(keyspace=conf.keyspace)
    plan_tmp = base.create_dynamic_model(keyspace=conf.keyspace,
                                         baseclass=plan.Plan,
                                         classname="Plan")
    return plan_tmp
예제 #8
0
파일: service.py 프로젝트: onap/optf-has
    def __init__(self, conf):
        self.conf = conf

        # Set up Music access.
        self.music = db_backend.get_client()
        self.music.keyspace_create(keyspace=conf.keyspace)

        # Dynamically create a plan class for the specified keyspace
        self.Plan = base.create_dynamic_model(
            keyspace=conf.keyspace, baseclass=plan.Plan, classname="Plan")
        self.OrderLock = base.create_dynamic_model(
            keyspace=conf.keyspace, baseclass=order_lock.OrderLock, classname="OrderLock")

        if not self.Plan:
            raise
        if not self.OrderLock:
            raise

        self.insert_healthcheck_plan()
예제 #9
0
    def __init__(self):
        self.TriageTool = base.create_dynamic_model(keyspace=CONF.keyspace,
                                                    baseclass=TriageTool,
                                                    classname="TriageTool")

        self.triage = {}

        self.triage['candidates'] = []
        self.triage['final_candidate'] = {}
        self.children = {'children': []}
        self.triage['plan_id'] = None
        self.triage['request_id'] = None
        self.sorted_demand = []
예제 #10
0
    def __init__(self, conf):

        self.conf = conf

        # Set up Music access.
        self.music = db_backend.get_client()
        self.music.keyspace_create(keyspace=conf.keyspace)

        # Dynamically create a plan class for the specified keyspace
        self.Plan = base.create_dynamic_model(keyspace=conf.keyspace,
                                              baseclass=plan.Plan,
                                              classname="Plan")
        self.OrderLock = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=order_lock.OrderLock,
            classname="OrderLock")
        self.OrderLockHistory = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=order_lock_history.OrderLockHistory,
            classname="OrderLockHistory")
        self.RegionPlaceholders = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=region_placeholders.RegionPlaceholders,
            classname="RegionPlaceholders")
        self.CountryLatency = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=country_latency.CountryLatency,
            classname="CountryLatency")
        self.TriageTool = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=triage_tool.TriageTool,
            classname="TriageTool")
        # self.Groups = base.create_dynamic_model(
        #    keyspace=conf.keyspace, baseclass=groups.Groups, classname="Groups")
        # self.GroupRules = base.create_dynamic_model(
        #    keyspace=conf.keyspace, baseclass=group_rules.GroupRules, classname="GroupRules")

        # Initialize Prometheus metrics Endpoint
        # Solver service uses index 1
        PC._init_metrics(1)

        if not self.Plan:
            raise
        if not self.OrderLock:
            raise
        if not self.OrderLockHistory:
            raise
        if not self.RegionPlaceholders:
            raise
        if not self.CountryLatency:
            raise
        if not self.TriageTool:
            raise
예제 #11
0
    def __init__(self, topic):
        """Set the topic and topic class"""
        self._topic = topic

        # Because this is Music-specific, the server is
        # built-in to the API class, stored as the transport.
        # Thus, unlike oslo.messaging, there is no server
        # specified for a target. There also isn't an
        # exchange, namespace, or version at the moment.

        # Dynamically create a message class for this topic.
        self._topic_class = base.create_dynamic_model(
            keyspace=CONF.messaging_server.keyspace,
            baseclass=message.Message,
            classname=self.topic)

        if not self._topic_class:
            RuntimeError("Error setting the topic class "
                         "for the messaging layer.")
예제 #12
0
    def thefinalCallTrans(self, triage_translator_data):
        triage_translator = {}
        triage_translator['plan_id'] = triage_translator_data['plan_id']
        triage_translator['plan_name'] = triage_translator_data['plan_name']
        triage_translator['translator_triage'] = {}
        triage_translator['translator_triage']['dropped_candidates'] = []

        for td in triage_translator_data['translator_triage']:
            for a in td:
                triage_translator['translator_triage'][
                    'dropped_candidates'].append(a)
        tria_final = triage_translator['translator_triage']
        triage_translator_dataTool = base.create_dynamic_model(
            keyspace=CONF.keyspace,
            baseclass=TriageTool,
            classname="TriageTool")

        triage_translator = json.dumps(tria_final)
        triageTransDatarow = triage_translator_dataTool(
            id=triage_translator_data['plan_id'],
            name=triage_translator_data['plan_name'],
            triage_translator=triage_translator)
        response = triageTransDatarow.insert()
예제 #13
0
 def __init__(self):
     self.TriageTool = base.create_dynamic_model(
         keyspace=CONF.keyspace, baseclass=TriageTool, classname="TriageTool")
     self.optimzation={}
     self.latency_dropped = []