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, }
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 ac = AccCOperations(KEYPASS_PROTOCOL, KEYPASS_HOST, KEYPASS_PORT) try: ac.checkAccC() logger.info("Keypass endpoint OK") except Exception, ex: logger.error("keypass endpoint not found: %s" % ex) return "ERROR keypass endpoint not found: %s" % ex return "OK" def show_conf(): conf = {} from django.conf import settings custom_settings_entries = [ 'KEYSTONE', 'KEYPASS', 'ORION', 'PEP', 'IOTAGENT', 'SCIM_API_VERSION',
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, }