-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3bb5ef
commit 96e7816
Showing
4 changed files
with
111 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,44 @@ | ||
|
||
import websocket | ||
import time | ||
import json | ||
import os | ||
import subprocess | ||
import _thread | ||
|
||
import rel | ||
import argparse | ||
from argparse import ArgumentParser | ||
import websocket | ||
|
||
|
||
|
||
def on_error(ws, error): | ||
print(error) | ||
|
||
|
||
def on_close(ws, close_status_code, close_msg): | ||
print("### Connection closed ###") | ||
|
||
|
||
def on_open(ws): | ||
print("### Connection established ###") | ||
|
||
|
||
def publish(): | ||
ws = websocket.WebSocketApp("ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close) | ||
ws = websocket.WebSocketApp( | ||
"ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close, | ||
) | ||
|
||
ws.run_forever(dispatcher=rel) # Set dispatcher to automatic reconnection | ||
rel.signal(2, rel.abort) # Keyboard Interrupt | ||
|
||
|
||
|
||
ws_req = { | ||
"RequestPostTopicUUID": { | ||
"RequestPostTopicUUID": { | ||
"topic_name": "SIFIS:app_manager", | ||
"topic_uuid": "application_manager_uuid", | ||
"value": { | ||
"operation": "list_containers", | ||
"requestor_id": "1", | ||
"request_id": "1", | ||
} | ||
} | ||
}, | ||
} | ||
} | ||
ws.send(json.dumps(ws_req)) | ||
|
||
publish() | ||
|
||
|
||
|
||
publish() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,45 @@ | ||
|
||
|
||
import websocket | ||
import time | ||
import json | ||
import os | ||
import subprocess | ||
import _thread | ||
|
||
import rel | ||
import argparse | ||
from argparse import ArgumentParser | ||
import websocket | ||
|
||
|
||
|
||
def on_error(ws, error): | ||
print(error) | ||
|
||
|
||
def on_close(ws, close_status_code, close_msg): | ||
print("### Connection closed ###") | ||
|
||
|
||
def on_open(ws): | ||
print("### Connection established ###") | ||
|
||
|
||
def publish(): | ||
ws = websocket.WebSocketApp("ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close) | ||
ws = websocket.WebSocketApp( | ||
"ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close, | ||
) | ||
|
||
ws.run_forever(dispatcher=rel) # Set dispatcher to automatic reconnection | ||
rel.signal(2, rel.abort) # Keyboard Interrupt | ||
|
||
|
||
|
||
ws_req = { | ||
"RequestPostTopicUUID": { | ||
"RequestPostTopicUUID": { | ||
"topic_name": "SIFIS:app_manager", | ||
"topic_uuid": "application_manager_uuid", | ||
"value": { | ||
"operation": "pull_image", | ||
"requestor_id": "1", | ||
"request_id": "1", | ||
"image_name": "ghcr.io/sifis-home/application-manager:latest", | ||
} | ||
} | ||
}, | ||
} | ||
} | ||
ws.send(json.dumps(ws_req)) | ||
|
||
publish() | ||
|
||
|
||
publish() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,45 @@ | ||
|
||
|
||
import websocket | ||
import time | ||
import json | ||
import os | ||
import subprocess | ||
import _thread | ||
|
||
import rel | ||
import argparse | ||
from argparse import ArgumentParser | ||
import websocket | ||
|
||
|
||
|
||
def on_error(ws, error): | ||
print(error) | ||
|
||
|
||
def on_close(ws, close_status_code, close_msg): | ||
print("### Connection closed ###") | ||
|
||
|
||
def on_open(ws): | ||
print("### Connection established ###") | ||
|
||
|
||
def publish(): | ||
ws = websocket.WebSocketApp("ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close) | ||
ws = websocket.WebSocketApp( | ||
"ws://localhost:3000/ws", | ||
on_open=on_open, | ||
on_error=on_error, | ||
on_close=on_close, | ||
) | ||
|
||
ws.run_forever(dispatcher=rel) # Set dispatcher to automatic reconnection | ||
rel.signal(2, rel.abort) # Keyboard Interrupt | ||
|
||
|
||
|
||
ws_req = { | ||
"RequestPostTopicUUID": { | ||
"RequestPostTopicUUID": { | ||
"topic_name": "SIFIS:app_manager", | ||
"topic_uuid": "application_manager_uuid", | ||
"value": { | ||
"operation": "remove_image", | ||
"requestor_id": "1", | ||
"request_id": "1", | ||
"image_name": "ghcr.io/sifis-home/application-manager:latest", | ||
} | ||
} | ||
}, | ||
} | ||
} | ||
ws.send(json.dumps(ws_req)) | ||
|
||
publish() | ||
|
||
|
||
publish() |