def process_deploy_app_request(payload, source='ServiceNow', version='1'): LOG.info('Processing request with version %r' % version) cntx = {'req_id': str(uuid.uuid4())} rpc = rpcapi.RpcAPI() LOG.info('Posting payload %r' % payload) rpc.invoke_notifier(ctxt=cntx, payload=payload, source=source, version=version, action='deploy_app')
def process_create_env_request(payload, source='ServiceNow', version='1'): LOG.info('Processing request with version %r' % version) cntx = {'req_id': str(uuid.uuid4())} # if 'service_info' in payload.keys(): # if 'ser_cat_ds' in payload['service_info'].keys(): # app_handler_poc.install_database(payload) # else: # app_handler_poc.install_webserver(payload) rpc = rpcapi.RpcAPI() LOG.info('Posting payload %r' % payload) rpc.invoke_notifier(ctxt=cntx, payload=payload, source=source, version=version, action='deploy_env')
def trigger_backend(req_id): DIR = '/opt/matilda/requests/' + req_id file_count = len([ name for name in os.listdir(DIR) if os.path.isfile(os.path.join(DIR, name)) ]) if file_count == 3: cntx = {'req_id': str(uuid.uuid4())} payload = {'request_id': req_id} rpc = rpcapi.RpcAPI() LOG.info('Posting payload %r' % payload) rpc.invoke_notifier(ctxt=cntx, payload=payload, source='', version='1', action='vz_pol')