Commit 3125ed93 authored by Alexander Lercher's avatar Alexander Lercher

New network locations

parent 7b6acafd
...@@ -9,12 +9,12 @@ TRACE_RETRIEVAL_HOSTNAME = 'trace-retrieval' ...@@ -9,12 +9,12 @@ TRACE_RETRIEVAL_HOSTNAME = 'trace-retrieval'
TRACE_RETRIEVAL_REST_PORT = 80 TRACE_RETRIEVAL_REST_PORT = 80
### outside k8s ### outside k8s
# HOST_IP = '143.205.173.36' # HOST_IP = '143.205.173.102'
# RABBIT_MQ_HOSTNAME = HOST_IP # RABBIT_MQ_HOSTNAME = HOST_IP
# RABBIT_MQ_PORT = 30302 # RABBIT_MQ_PORT = 30302
# MONGO_DB_HOST = HOST_IP # MONGO_DB_HOSTNAME = HOST_IP
# MONGO_DB_PORT = 30003 # MONGO_DB_PORT = 30003
# TRACE_RETRIEVAL_HOSTNAME = HOST_IP # TRACE_RETRIEVAL_HOSTNAME = HOST_IP
......
# add modules folder to interpreter path
import sys
import os
modules_path = '../../modules/'
if os.path.exists(modules_path):
sys.path.insert(1, modules_path)
import requests import requests
import random import random
import json import json
import network_constants
ports = [] ports = []
# transaction hub in # transaction hub in
...@@ -12,15 +20,18 @@ ports.extend(range(30201, 30205)) ...@@ -12,15 +20,18 @@ ports.extend(range(30201, 30205))
print(f"Checking {len(ports)} ports") print(f"Checking {len(ports)} ports")
network_constants.HOST_IP
home_url = 'http://143.205.173.36:{port}/' home_url = 'http://' + str(network_constants.HOST_IP) + ':{port}/'
debug_url = home_url + 'api/debug' debug_url = home_url + 'api/debug'
print(debug_url) print(debug_url)
for port in ports: for port in ports:
try:
response = requests.get(home_url.replace("{port}", str(port))) response = requests.get(home_url.replace("{port}", str(port)))
print(response.text) print(response.text)
data = {'data': f"Echo {str(random.random())}"} data = {'data': f"Echo {str(random.random())}"}
response = requests.post(debug_url.replace("{port}", str(port)), json=data) response = requests.post(debug_url.replace("{port}", str(port)), json=data)
print(response.text) # print(response.text)
\ No newline at end of file except:
print(f"Didnt work for port {port}")
\ No newline at end of file
# add modules folder to interpreter path
import sys
import os
modules_path = '../../modules/'
if os.path.exists(modules_path):
sys.path.insert(1, modules_path)
import pika import pika
import network_constants
EXCHANGE_NAME = 'inhub' EXCHANGE_NAME = 'inhub'
EXCHANGE_TYPE = 'direct' EXCHANGE_TYPE = 'direct'
ROUTING_KEY = 'trace-retrieval' ROUTING_KEY = 'trace-retrieval'
connection = pika.BlockingConnection(pika.ConnectionParameters('143.205.173.36', 30302, heartbeat=60, blocked_connection_timeout=30)) HOST = network_constants.HOST_IP
connection = pika.BlockingConnection(pika.ConnectionParameters(HOST, 30302, heartbeat=60, blocked_connection_timeout=30))
channel = connection.channel() channel = connection.channel()
channel.exchange_declare(exchange=EXCHANGE_NAME, exchange_type=EXCHANGE_TYPE) channel.exchange_declare(exchange=EXCHANGE_NAME, exchange_type=EXCHANGE_TYPE)
......
# add modules folder to interpreter path
import sys
import os
modules_path = '../modules/'
if os.path.exists(modules_path):
sys.path.insert(1, modules_path)
import pymongo import pymongo
import network_constants
MONGO_DB_HOST = '143.205.173.36' MONGO_DB_HOST = network_constants.HOST_IP
MONGO_DB_PORT = '30003' MONGO_DB_PORT = '30003'
class MongoRepository: class MongoRepository:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment