Beispiel #1
0
 def test_getDomainId(self):
     ko = IdMKeystoneOperations(self.KEYSTONE_PROTOCOL, self.KEYSTONE_HOST,
                                self.KEYSTONE_PORT)
     SERVICE_ADMIN_TOKEN = ko.getToken(self.SERVICE_NAME,
                                       self.SERVICE_ADMIN_USER,
                                       self.SERVICE_ADMIN_PASSWORD)
     SERVICE_ID = ko.getDomainId(SERVICE_ADMIN_TOKEN, self.SERVICE_NAME)
     print SERVICE_ID
Beispiel #2
0
 def test_getDomainId(self):
     ko = IdMKeystoneOperations(self.KEYSTONE_PROTOCOL,
                                self.KEYSTONE_HOST,
                                self.KEYSTONE_PORT)
     SERVICE_ADMIN_TOKEN = ko.getToken(self.SERVICE_NAME,
                                       self.SERVICE_ADMIN_USER,
                                       self.SERVICE_ADMIN_PASSWORD)
     SERVICE_ID = ko.getDomainId(SERVICE_ADMIN_TOKEN,
                                 self.SERVICE_NAME)
     print SERVICE_ID
Beispiel #3
0
def check_endpoints():

    KEYSTONE_PROTOCOL = settings.KEYSTONE['protocol']
    KEYSTONE_HOST = settings.KEYSTONE['host']
    KEYSTONE_PORT = settings.KEYSTONE['port']

    KEYPASS_PROTOCOL = settings.KEYPASS['protocol']
    KEYPASS_HOST = settings.KEYPASS['host']
    KEYPASS_PORT = settings.KEYPASS['port']

    idm = IdMOperations(KEYSTONE_PROTOCOL, KEYSTONE_HOST, KEYSTONE_PORT)
    try:
        idm.checkIdM()
        logger.info("Keystone endpoint OK")
    except Exception, ex:
        logger.error("keystone endpoint not found: %s" % ex)
        return "ERROR keystone endpoint not found: %s" % ex
def check_endpoints():

    KEYSTONE_PROTOCOL = settings.KEYSTONE['protocol']
    KEYSTONE_HOST = settings.KEYSTONE['host']
    KEYSTONE_PORT = settings.KEYSTONE['port']

    KEYPASS_PROTOCOL = settings.KEYPASS['protocol']
    KEYPASS_HOST = settings.KEYPASS['host']
    KEYPASS_PORT = settings.KEYPASS['port']

    idm = IdMOperations(KEYSTONE_PROTOCOL, KEYSTONE_HOST, KEYSTONE_PORT)
    try:
        idm.checkIdM()
        logger.info("Keystone endpoint OK")
    except Exception, ex:
        logger.error("keystone endpoint not found: %s" % ex)
        return "ERROR keystone endpoint not found: %s" % ex
Beispiel #5
0
    def __init__(self,
                 KEYSTONE_PROTOCOL,
                 KEYSTONE_HOST,
                 KEYSTONE_PORT,
                 KEYPASS_PROTOCOL=None,
                 KEYPASS_HOST=None,
                 KEYPASS_PORT=None,
                 ORION_PROTOCOL="http",
                 ORION_HOST="localhost",
                 ORION_PORT="1026",
                 PERSEO_PROTOCOL="http",
                 PERSEO_HOST="localhost",
                 PERSEO_PORT="9090",
                 LDAP_HOST="localhost",
                 LDAP_PORT="389",
                 LDAP_BASEDN="dc=openstack,dc=org",
                 MAILER_HOST="localhost",
                 MAILER_PORT="587",
                 MAILER_TLS="true",
                 MAILER_USER="******",
                 MAILER_PASSWORD="******",
                 MAILER_FROM="smtpuser",
                 MAILER_TO="smtpuser",
                 MONGODB_URI="mongodb://127.0.0.1:27017",
                 TRANSACTION_ID=None,
                 CORRELATOR_ID=None):

        # Generate Transaction ID
        self.TRANSACTION_ID = uuid.uuid4()

        if not CORRELATOR_ID:
            self.CORRELATOR_ID = self.TRANSACTION_ID
        else:
            self.CORRELATOR_ID = CORRELATOR_ID

        self.logger = logging.getLogger('orchestrator_core')

        # Put collector into logger
        self.logger.addFilter(ContextFilterCorrelatorId(self.CORRELATOR_ID))
        self.logger.addFilter(ContextFilterTransactionId(self.TRANSACTION_ID))
        self.logger.addFilter(ContextFilterService(None))
        self.logger.addFilter(ContextFilterSubService(""))

        self.idm = IdMOperations(KEYSTONE_PROTOCOL,
                                 KEYSTONE_HOST,
                                 KEYSTONE_PORT)

        self.ac = AccCOperations(KEYPASS_PROTOCOL,
                                 KEYPASS_HOST,
                                 KEYPASS_PORT,
                                 CORRELATOR_ID=self.CORRELATOR_ID,
                                 TRANSACTION_ID=self.TRANSACTION_ID)

        self.cb = CBOperations(ORION_PROTOCOL,
                               ORION_HOST,
                               ORION_PORT,
                               CORRELATOR_ID=self.CORRELATOR_ID,
                               TRANSACTION_ID=self.TRANSACTION_ID)

        self.perseo = PerseoOperations(PERSEO_PROTOCOL,
                                       PERSEO_HOST,
                                       PERSEO_PORT,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.ldap = OpenLdapOperations(LDAP_HOST,
                                       LDAP_PORT,
                                       LDAP_BASEDN,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.mailer = MailerOperations(MAILER_HOST,
                                       MAILER_PORT,
                                       MAILER_TLS,
                                       MAILER_USER,
                                       MAILER_PASSWORD,
                                       MAILER_FROM,
                                       MAILER_TO,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.mongodb = MongoDBOperations(MONGODB_URI,
                                         CORRELATOR_ID=self.CORRELATOR_ID,
                                         TRANSACTION_ID=self.TRANSACTION_ID)

        self.endpoints = {}
        self.iotmodules_aliases = {}

        self.sum = {
            "serviceTime": 0,
            "serviceTimeTotal": 0,
            "outgoingTransactions": 0,
            "outgoingTransactionRequestSize": 0,
            "outgoingTransactionResponseSize": 0,
            "outgoingTransactionErrors": 0,
        }
Beispiel #6
0
class FlowBase(object):
    def __init__(self,
                 KEYSTONE_PROTOCOL,
                 KEYSTONE_HOST,
                 KEYSTONE_PORT,
                 KEYPASS_PROTOCOL=None,
                 KEYPASS_HOST=None,
                 KEYPASS_PORT=None,
                 ORION_PROTOCOL="http",
                 ORION_HOST="localhost",
                 ORION_PORT="1026",
                 PERSEO_PROTOCOL="http",
                 PERSEO_HOST="localhost",
                 PERSEO_PORT="9090",
                 LDAP_HOST="localhost",
                 LDAP_PORT="389",
                 LDAP_BASEDN="dc=openstack,dc=org",
                 MAILER_HOST="localhost",
                 MAILER_PORT="587",
                 MAILER_TLS="true",
                 MAILER_USER="******",
                 MAILER_PASSWORD="******",
                 MAILER_FROM="smtpuser",
                 MAILER_TO="smtpuser",
                 MONGODB_URI="mongodb://127.0.0.1:27017",
                 TRANSACTION_ID=None,
                 CORRELATOR_ID=None):

        # Generate Transaction ID
        self.TRANSACTION_ID = uuid.uuid4()

        if not CORRELATOR_ID:
            self.CORRELATOR_ID = self.TRANSACTION_ID
        else:
            self.CORRELATOR_ID = CORRELATOR_ID

        self.logger = logging.getLogger('orchestrator_core')

        # Put collector into logger
        self.logger.addFilter(ContextFilterCorrelatorId(self.CORRELATOR_ID))
        self.logger.addFilter(ContextFilterTransactionId(self.TRANSACTION_ID))
        self.logger.addFilter(ContextFilterService(None))
        self.logger.addFilter(ContextFilterSubService(""))

        self.idm = IdMOperations(KEYSTONE_PROTOCOL,
                                 KEYSTONE_HOST,
                                 KEYSTONE_PORT)

        self.ac = AccCOperations(KEYPASS_PROTOCOL,
                                 KEYPASS_HOST,
                                 KEYPASS_PORT,
                                 CORRELATOR_ID=self.CORRELATOR_ID,
                                 TRANSACTION_ID=self.TRANSACTION_ID)

        self.cb = CBOperations(ORION_PROTOCOL,
                               ORION_HOST,
                               ORION_PORT,
                               CORRELATOR_ID=self.CORRELATOR_ID,
                               TRANSACTION_ID=self.TRANSACTION_ID)

        self.perseo = PerseoOperations(PERSEO_PROTOCOL,
                                       PERSEO_HOST,
                                       PERSEO_PORT,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.ldap = OpenLdapOperations(LDAP_HOST,
                                       LDAP_PORT,
                                       LDAP_BASEDN,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.mailer = MailerOperations(MAILER_HOST,
                                       MAILER_PORT,
                                       MAILER_TLS,
                                       MAILER_USER,
                                       MAILER_PASSWORD,
                                       MAILER_FROM,
                                       MAILER_TO,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.mongodb = MongoDBOperations(MONGODB_URI,
                                         CORRELATOR_ID=self.CORRELATOR_ID,
                                         TRANSACTION_ID=self.TRANSACTION_ID)

        self.endpoints = {}
        self.iotmodules_aliases = {}

        self.sum = {
            "serviceTime": 0,
            "serviceTimeTotal": 0,
            "outgoingTransactions": 0,
            "outgoingTransactionRequestSize": 0,
            "outgoingTransactionResponseSize": 0,
            "outgoingTransactionErrors": 0,
        }


    def composeErrorCode(self, ex):
        '''
        Compose error detail and code from AssertionError exception ex
        '''
        # Get line where exception was produced
        # exc_type, exc_obj, exc_tb = sys.exc_info()
        # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
        # print(exc_type, fname, exc_tb.tb_lineno)
        res = {"error": str(ex), "code": 500}
        if isinstance(ex.args, tuple) and (
                (len(ex.args) > 0) and
            not isinstance(ex.args[0], tuple)):  # Python 2.6
            res['code'] = ex.args[0]
            if res['code'] == 400 and len(ex.args) > 1 and \
               ex.args[1].startswith('SPASSWORD'):
                res['error'] = ex.args[1]
        elif isinstance(ex.message, tuple):  # Python 2.7
            res['code'] = ex.message[0]
            if res['code'] == 400 and len(ex.message) > 1 and \
               ex.message[1].startswith('SPASSWORD'):
                res['error'] = ex.message[1]
        return res, None, None


    def logError(self, logger, error_code, ex):
        '''
        Log as error level error_code if is < 400 or > 500
        '''
        if (error_code[0]['code'] < 400 or error_code[0]['code'] > 500):
            logger.error(ex)
        else:
            logger.debug(ex)


    def get_endpoint_iot_module(self, iot_module):
        assert iot_module in IOTMODULES
        if iot_module in self.endpoints:
            return self.endpoints[iot_module]
        else:
            comppackage = __import__("settings.dev", fromlist=iot_module)
            iot_module_conf = getattr(comppackage, iot_module)
            assert 'protocol' in iot_module_conf
            assert 'host' in iot_module_conf
            assert 'port' in iot_module_conf
            notifypath = "/notify" if not 'notifypath' in iot_module_conf else iot_module_conf['notifypath']
            iot_mddule_enpoint = iot_module_conf['protocol'] + "://" + \
              iot_module_conf['host'] + ":" + \
              iot_module_conf['port'] + notifypath
            self.endpoints[iot_module] = iot_mddule_enpoint
            return iot_mddule_enpoint


    def get_alias_iot_module(self, iot_module):
        assert iot_module in IOTMODULES
        if iot_module in self.iotmodules_aliases:
            return self.alias[iot_module]
        else:
            comppackage = __import__("settings.dev", fromlist=iot_module)
            iot_module_conf = getattr(comppackage, iot_module)
            alias = iot_module
            if 'alias' in iot_module_conf:
                alias = iot_module_conf['alias']
                self.iotmodules_aliases[iot_module] = alias
            return alias


    def ensure_service_name(self, USER_TOKEN, SERVICE_ID, SERVICE_NAME):
        if not SERVICE_NAME:
            self.logger.debug("Not SERVICE_NAME provided, getting it from token")
            try:
                SERVICE_NAME = self.idm.getDomainNameFromToken(
                    USER_TOKEN,
                    SERVICE_ID)
            except Exception, ex:
                # This op could be executed by cloud_admin user
                SERVICE = self.idm.getDomain(USER_TOKEN,
                                             SERVICE_ID)
                SERVICE_NAME = SERVICE['domain']['name']
        return SERVICE_NAME
Beispiel #7
0
    def __init__(self,
                 KEYSTONE_PROTOCOL,
                 KEYSTONE_HOST,
                 KEYSTONE_PORT,
                 KEYPASS_PROTOCOL=None,
                 KEYPASS_HOST=None,
                 KEYPASS_PORT=None,
                 IOTA_PROTOCOL="http",
                 IOTA_HOST="localhost",
                 IOTA_PORT="4041",
                 ORION_PROTOCOL="http",
                 ORION_HOST="localhost",
                 ORION_PORT="1026",
                 CA_PROTOCOL="http",
                 CA_HOST="localhost",
                 CA_PORT="9999",
                 PERSEO_PROTOCOL="http",
                 PERSEO_HOST="localhost",
                 PERSEO_PORT="9090",
                 TRANSACTION_ID=None,
                 CORRELATOR_ID=None):

        # Generate Transaction ID
        self.TRANSACTION_ID = uuid.uuid4()

        if not CORRELATOR_ID:
            self.CORRELATOR_ID = self.TRANSACTION_ID
        else:
            self.CORRELATOR_ID = CORRELATOR_ID

        self.logger = logging.getLogger('orchestrator_core')

        # Put collector into logger
        self.logger.addFilter(ContextFilterCorrelatorId(self.CORRELATOR_ID))
        self.logger.addFilter(ContextFilterTransactionId(self.TRANSACTION_ID))
        self.logger.addFilter(ContextFilterService(None))
        self.logger.addFilter(ContextFilterSubService(""))

        self.idm = IdMOperations(KEYSTONE_PROTOCOL,
                                 KEYSTONE_HOST,
                                 KEYSTONE_PORT)

        self.ac = AccCOperations(KEYPASS_PROTOCOL,
                                 KEYPASS_HOST,
                                 KEYPASS_PORT,
                                 CORRELATOR_ID=self.CORRELATOR_ID,
                                 TRANSACTION_ID=self.TRANSACTION_ID)

        self.iota = IoTAOperations(IOTA_PROTOCOL,
                                   IOTA_HOST,
                                   IOTA_PORT,
                                   CORRELATOR_ID=self.CORRELATOR_ID,
                                   TRANSACTION_ID=self.TRANSACTION_ID)

        self.cb = CBOperations(ORION_PROTOCOL,
                               ORION_HOST,
                               ORION_PORT,
                               CORRELATOR_ID=self.CORRELATOR_ID,
                               TRANSACTION_ID=self.TRANSACTION_ID)

        self.perseo = PerseoOperations(PERSEO_PROTOCOL,
                                       PERSEO_HOST,
                                       PERSEO_PORT,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        if CA_PROTOCOL:
            # CA for Blackbutton notification flow
            self.ca_endpoint = CA_PROTOCOL + "://"+CA_HOST+":"+CA_PORT+"/v1"+"/notify"


        self.endpoints = {}
        self.iotmodules_aliases = {}

        if CA_PROTOCOL:
            # CA for Geolocation
            self.endpoints['CA'] = \
              CA_PROTOCOL + "://"+CA_HOST+":"+CA_PORT+""+"/v1/notifyGeolocation"

        self.sum = {
            "serviceTime": 0,
            "serviceTimeTotal": 0,
            "outgoingTransactions": 0,
            "outgoingTransactionRequestSize": 0,
            "outgoingTransactionResponseSize": 0,
            "outgoingTransactionErrors": 0,
        }
Beispiel #8
0
class FlowBase(object):
    def __init__(self,
                 KEYSTONE_PROTOCOL,
                 KEYSTONE_HOST,
                 KEYSTONE_PORT,
                 KEYPASS_PROTOCOL=None,
                 KEYPASS_HOST=None,
                 KEYPASS_PORT=None,
                 IOTA_PROTOCOL="http",
                 IOTA_HOST="localhost",
                 IOTA_PORT="4041",
                 ORION_PROTOCOL="http",
                 ORION_HOST="localhost",
                 ORION_PORT="1026",
                 CA_PROTOCOL="http",
                 CA_HOST="localhost",
                 CA_PORT="9999",
                 PERSEO_PROTOCOL="http",
                 PERSEO_HOST="localhost",
                 PERSEO_PORT="9090",
                 TRANSACTION_ID=None,
                 CORRELATOR_ID=None):

        # Generate Transaction ID
        self.TRANSACTION_ID = uuid.uuid4()

        if not CORRELATOR_ID:
            self.CORRELATOR_ID = self.TRANSACTION_ID
        else:
            self.CORRELATOR_ID = CORRELATOR_ID

        self.logger = logging.getLogger('orchestrator_core')

        # Put collector into logger
        self.logger.addFilter(ContextFilterCorrelatorId(self.CORRELATOR_ID))
        self.logger.addFilter(ContextFilterTransactionId(self.TRANSACTION_ID))
        self.logger.addFilter(ContextFilterService(None))
        self.logger.addFilter(ContextFilterSubService(""))

        self.idm = IdMOperations(KEYSTONE_PROTOCOL,
                                 KEYSTONE_HOST,
                                 KEYSTONE_PORT)

        self.ac = AccCOperations(KEYPASS_PROTOCOL,
                                 KEYPASS_HOST,
                                 KEYPASS_PORT,
                                 CORRELATOR_ID=self.CORRELATOR_ID,
                                 TRANSACTION_ID=self.TRANSACTION_ID)

        self.iota = IoTAOperations(IOTA_PROTOCOL,
                                   IOTA_HOST,
                                   IOTA_PORT,
                                   CORRELATOR_ID=self.CORRELATOR_ID,
                                   TRANSACTION_ID=self.TRANSACTION_ID)

        self.cb = CBOperations(ORION_PROTOCOL,
                               ORION_HOST,
                               ORION_PORT,
                               CORRELATOR_ID=self.CORRELATOR_ID,
                               TRANSACTION_ID=self.TRANSACTION_ID)

        self.perseo = PerseoOperations(PERSEO_PROTOCOL,
                                       PERSEO_HOST,
                                       PERSEO_PORT,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        if CA_PROTOCOL:
            # CA for Blackbutton notification flow
            self.ca_endpoint = CA_PROTOCOL + "://"+CA_HOST+":"+CA_PORT+"/v1"+"/notify"


        self.endpoints = {}
        self.iotmodules_aliases = {}

        if CA_PROTOCOL:
            # CA for Geolocation
            self.endpoints['CA'] = \
              CA_PROTOCOL + "://"+CA_HOST+":"+CA_PORT+""+"/v1/notifyGeolocation"

        self.sum = {
            "serviceTime": 0,
            "serviceTimeTotal": 0,
            "outgoingTransactions": 0,
            "outgoingTransactionRequestSize": 0,
            "outgoingTransactionResponseSize": 0,
            "outgoingTransactionErrors": 0,
        }


    def composeErrorCode(self, ex):
        '''
        Compose error detail and code from AssertionError exception ex
        '''
        # Get line where exception was produced
        # exc_type, exc_obj, exc_tb = sys.exc_info()
        # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
        # print(exc_type, fname, exc_tb.tb_lineno)
        res = {"error": str(ex), "code": 500}
        if isinstance(ex.args, tuple) and (
                (len(ex.args) > 0) and
            not isinstance(ex.args[0], tuple)):  # Python 2.6
            res['code'] = ex.args[0]
            if res['code'] == 400 and len(ex.args) > 1 and \
               ex.args[1].startswith('SPASSWORD'):
                res['error'] = ex.args[1]
        elif isinstance(ex.message, tuple):  # Python 2.7
            res['code'] = ex.message[0]
            if res['code'] == 400 and len(ex.message) > 1 and \
               ex.message[1].startswith('SPASSWORD'):
                res['error'] = ex.message[1]
        return res, None, None


    def logError(self, logger, error_code, ex):
        '''
        Log as error level error_code if is < 400 or > 500
        '''
        if (error_code[0]['code'] < 400 or error_code[0]['code'] > 500):
            logger.error(ex)
        else:
            logger.debug(ex)


    def get_endpoint_iot_module(self, iot_module):
        assert iot_module in IOTMODULES
        if iot_module in self.endpoints:
            return self.endpoints[iot_module]
        else:
            comppackage = __import__("settings.dev", fromlist=iot_module)
            iot_module_conf = getattr(comppackage, iot_module)
            assert 'protocol' in iot_module_conf
            assert 'host' in iot_module_conf
            assert 'port' in iot_module_conf
            notifypath = "/notify" if not 'notifypath' in iot_module_conf else iot_module_conf['notifypath']
            iot_mddule_enpoint = iot_module_conf['protocol'] + "://" + \
              iot_module_conf['host'] + ":" + \
              iot_module_conf['port'] + notifypath
            self.endpoints[iot_module] = iot_mddule_enpoint
            return iot_mddule_enpoint


    def get_alias_iot_module(self, iot_module):
        assert iot_module in IOTMODULES
        if iot_module in self.iotmodules_aliases:
            return self.alias[iot_module]
        else:
            comppackage = __import__("settings.dev", fromlist=iot_module)
            iot_module_conf = getattr(comppackage, iot_module)
            alias = iot_module
            if 'alias' in iot_module_conf:
                alias = iot_module_conf['alias']
                self.iotmodules_aliases[iot_module] = alias
            return alias


    def ensure_service_name(self, USER_TOKEN, SERVICE_ID, SERVICE_NAME):
        if not SERVICE_NAME:
            self.logger.debug("Not SERVICE_NAME provided, getting it from token")
            try:
                SERVICE_NAME = self.idm.getDomainNameFromToken(
                    USER_TOKEN,
                    SERVICE_ID)
            except Exception, ex:
                # This op could be executed by cloud_admin user
                SERVICE = self.idm.getDomain(USER_TOKEN,
                                             SERVICE_ID)
                SERVICE_NAME = SERVICE['domain']['name']
        return SERVICE_NAME
Beispiel #9
0
    def __init__(self,
                 KEYSTONE_PROTOCOL,
                 KEYSTONE_HOST,
                 KEYSTONE_PORT,
                 KEYPASS_PROTOCOL=None,
                 KEYPASS_HOST=None,
                 KEYPASS_PORT=None,
                 ORION_PROTOCOL="http",
                 ORION_HOST="localhost",
                 ORION_PORT="1026",
                 PERSEO_PROTOCOL="http",
                 PERSEO_HOST="localhost",
                 PERSEO_PORT="9090",
                 LDAP_HOST="localhost",
                 LDAP_PORT="389",
                 LDAP_BASEDN="dc=openstack,dc=org",
                 MAILER_HOST="localhost",
                 MAILER_PORT="587",
                 MAILER_USER="******",
                 MAILER_PASSWORD="******",
                 MAILER_FROM="smtpuser",
                 MAILER_TO="smtpuser",
                 TRANSACTION_ID=None,
                 CORRELATOR_ID=None):

        # Generate Transaction ID
        self.TRANSACTION_ID = uuid.uuid4()

        if not CORRELATOR_ID:
            self.CORRELATOR_ID = self.TRANSACTION_ID
        else:
            self.CORRELATOR_ID = CORRELATOR_ID

        self.logger = logging.getLogger('orchestrator_core')

        # Put collector into logger
        self.logger.addFilter(ContextFilterCorrelatorId(self.CORRELATOR_ID))
        self.logger.addFilter(ContextFilterTransactionId(self.TRANSACTION_ID))
        self.logger.addFilter(ContextFilterService(None))
        self.logger.addFilter(ContextFilterSubService(""))

        self.idm = IdMOperations(KEYSTONE_PROTOCOL, KEYSTONE_HOST,
                                 KEYSTONE_PORT)

        self.ac = AccCOperations(KEYPASS_PROTOCOL,
                                 KEYPASS_HOST,
                                 KEYPASS_PORT,
                                 CORRELATOR_ID=self.CORRELATOR_ID,
                                 TRANSACTION_ID=self.TRANSACTION_ID)

        self.cb = CBOperations(ORION_PROTOCOL,
                               ORION_HOST,
                               ORION_PORT,
                               CORRELATOR_ID=self.CORRELATOR_ID,
                               TRANSACTION_ID=self.TRANSACTION_ID)

        self.perseo = PerseoOperations(PERSEO_PROTOCOL,
                                       PERSEO_HOST,
                                       PERSEO_PORT,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.ldap = OpenLdapOperations(LDAP_HOST,
                                       LDAP_PORT,
                                       LDAP_BASEDN,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.mailer = MailerOperations(MAILER_HOST,
                                       MAILER_PORT,
                                       MAILER_USER,
                                       MAILER_PASSWORD,
                                       MAILER_FROM,
                                       MAILER_TO,
                                       CORRELATOR_ID=self.CORRELATOR_ID,
                                       TRANSACTION_ID=self.TRANSACTION_ID)

        self.endpoints = {}
        self.iotmodules_aliases = {}

        self.sum = {
            "serviceTime": 0,
            "serviceTimeTotal": 0,
            "outgoingTransactions": 0,
            "outgoingTransactionRequestSize": 0,
            "outgoingTransactionResponseSize": 0,
            "outgoingTransactionErrors": 0,
        }