Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
3125ed93
Commit
3125ed93
authored
Sep 16, 2019
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New network locations
parent
7b6acafd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
11 deletions
+40
-11
network_constants.py
modules/network_constants.py
+2
-2
main.py
tools/ping-tool/main.py
+18
-7
consumer.py
tools/rabbit-mq-test/consumer.py
+11
-1
read-mongo-db.py
tools/read-mongo-db.py
+9
-1
No files found.
modules/network_constants.py
View file @
3125ed93
...
@@ -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_HOST
NAME
= HOST_IP
# MONGO_DB_PORT = 30003
# MONGO_DB_PORT = 30003
# TRACE_RETRIEVAL_HOSTNAME = HOST_IP
# TRACE_RETRIEVAL_HOSTNAME = HOST_IP
...
...
tools/ping-tool/main.py
View file @
3125ed93
# 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
tools/rabbit-mq-test/consumer.py
View file @
3125ed93
# 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
)
...
...
tools/read-mongo-db.py
View file @
3125ed93
# 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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment