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

New network locations

parent 7b6acafd
......@@ -9,12 +9,12 @@ TRACE_RETRIEVAL_HOSTNAME = 'trace-retrieval'
TRACE_RETRIEVAL_REST_PORT = 80
### outside k8s
# HOST_IP = '143.205.173.36'
# HOST_IP = '143.205.173.102'
# RABBIT_MQ_HOSTNAME = HOST_IP
# RABBIT_MQ_PORT = 30302
# MONGO_DB_HOST = HOST_IP
# MONGO_DB_HOSTNAME = HOST_IP
# MONGO_DB_PORT = 30003
# 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 random
import json
import network_constants
ports = []
# transaction hub in
......@@ -12,15 +20,18 @@ ports.extend(range(30201, 30205))
print(f"Checking {len(ports)} ports")
home_url = 'http://143.205.173.36:{port}/'
network_constants.HOST_IP
home_url = 'http://' + str(network_constants.HOST_IP) + ':{port}/'
debug_url = home_url + 'api/debug'
print(debug_url)
for port in ports:
response = requests.get(home_url.replace("{port}", str(port)))
print(response.text)
try:
response = requests.get(home_url.replace("{port}", str(port)))
print(response.text)
data = {'data': f"Echo {str(random.random())}"}
response = requests.post(debug_url.replace("{port}", str(port)), json=data)
print(response.text)
\ No newline at end of file
data = {'data': f"Echo {str(random.random())}"}
response = requests.post(debug_url.replace("{port}", str(port)), json=data)
# print(response.text)
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 network_constants
EXCHANGE_NAME = 'inhub'
EXCHANGE_TYPE = 'direct'
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.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 network_constants
MONGO_DB_HOST = '143.205.173.36'
MONGO_DB_HOST = network_constants.HOST_IP
MONGO_DB_PORT = '30003'
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