ActionStreamer 1.2.44__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/PKG-INFO +1 -1
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/README.md +3 -3
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/CommonFunctions.py +6 -6
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Config/Config.py +3 -2
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Device/Device.py +4 -4
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Device/__init__.py +3 -3
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Model/Model.py +28 -1
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/API/API.py +4 -4
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Event/Event.py +8 -6
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/File/File.py +8 -8
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Health/Health.py +6 -4
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/LogMessage/LogMessage.py +1 -1
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/LogMessage/__init__.py +4 -4
- actionstreamer-1.3.0/actionstreamer/WebService/Notification/Notification.py +44 -0
- actionstreamer-1.3.0/actionstreamer/WebService/Notification/__init.py__ +4 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Patch/__init__.py +4 -4
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/VideoClip/VideoClip.py +9 -9
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/__init__.py +7 -7
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/pyproject.toml +1 -1
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/Wifi/Wifi.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/Wifi/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Config/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/Model/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/API/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Event/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/EventPreset/EventPreset.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/EventPreset/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/File/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Health/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Package/Package.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Package/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Patch/Patch.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Tag/Tag.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Tag/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/VideoClip/__init__.py +0 -0
- {actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/__init__.py +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# ActionStreamer
|
|
2
|
-
|
|
3
|
-
A library for the ActionStreamer API.
|
|
1
|
+
# ActionStreamer
|
|
2
|
+
|
|
3
|
+
A library for the ActionStreamer API.
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/CommonFunctions.py
RENAMED
|
@@ -13,7 +13,7 @@ import re
|
|
|
13
13
|
import glob
|
|
14
14
|
from typing import NamedTuple
|
|
15
15
|
from concurrent.futures import ThreadPoolExecutor
|
|
16
|
-
|
|
16
|
+
from typing import Dict
|
|
17
17
|
import pytz
|
|
18
18
|
import requests
|
|
19
19
|
|
|
@@ -92,7 +92,7 @@ def log_to_console(message: str, agent_name: str = '') -> None:
|
|
|
92
92
|
sys.stdout.flush()
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
def send_signed_request(ws_config: WebServiceConfig, method: str, url: str, path: str, headers:
|
|
95
|
+
def send_signed_request(ws_config: WebServiceConfig, method: str, url: str, path: str, headers: Dict[str, str] = None, parameters: Dict[str, str] = None, body: str = None) -> tuple[int, str]:
|
|
96
96
|
|
|
97
97
|
try:
|
|
98
98
|
if headers is None:
|
|
@@ -141,14 +141,14 @@ def send_signed_request(ws_config: WebServiceConfig, method: str, url: str, path
|
|
|
141
141
|
return status_code, response_string
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
def get_hmac_signature(secret_key: str, method: str, path: str, headers, parameters:
|
|
144
|
+
def get_hmac_signature(secret_key: str, method: str, path: str, headers: Dict[str, str] = None, parameters: Dict[str, str] = None, body: str = None)-> tuple[str, str] | None:
|
|
145
145
|
|
|
146
146
|
try:
|
|
147
147
|
if 'Content-Type' in headers:
|
|
148
148
|
del headers['Content-Type']
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
header_string = dictionary_to_string(headers)
|
|
151
|
+
parameter_string = dictionary_to_string(parameters)
|
|
152
152
|
|
|
153
153
|
# Path should be in the format /v1/event
|
|
154
154
|
if not path.startswith('/'):
|
|
@@ -157,7 +157,7 @@ def get_hmac_signature(secret_key: str, method: str, path: str, headers, paramet
|
|
|
157
157
|
if path.endswith('/') and len(path) > 1:
|
|
158
158
|
path = path[:-1]
|
|
159
159
|
|
|
160
|
-
string_to_sign = '\n'.join([method, path,
|
|
160
|
+
string_to_sign = '\n'.join([method, path, header_string, parameter_string, body if body else ''])
|
|
161
161
|
|
|
162
162
|
string_to_sign = string_to_sign.strip()
|
|
163
163
|
#log_to_console("stringToSign: " + string_to_sign)
|
|
@@ -32,9 +32,10 @@ class WebServiceConfig:
|
|
|
32
32
|
|
|
33
33
|
class LogConfig:
|
|
34
34
|
|
|
35
|
-
def __init__(self, ws_config: WebServiceConfig,
|
|
35
|
+
def __init__(self, ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int, device_name: str):
|
|
36
36
|
self.ws_config = ws_config
|
|
37
|
-
self.device_name =
|
|
37
|
+
self.device_name = device_serial
|
|
38
|
+
self.device_serial = device_serial
|
|
38
39
|
self.agent_type = agent_type
|
|
39
40
|
self.agent_version = agent_version
|
|
40
41
|
self.agent_index = agent_index
|
|
@@ -11,7 +11,7 @@ from actionstreamer.Config import WebServiceConfig
|
|
|
11
11
|
|
|
12
12
|
def process_cpuinfo() -> str:
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
device_serial = "0000000000000000"
|
|
15
15
|
|
|
16
16
|
try:
|
|
17
17
|
optlist, args = getopt.getopt(sys.argv[1:], 'm:')
|
|
@@ -19,13 +19,13 @@ def process_cpuinfo() -> str:
|
|
|
19
19
|
except getopt.GetoptError as err:
|
|
20
20
|
# Print help information and exit:
|
|
21
21
|
print(str(err)) # This will print something like "option -a not recognized"
|
|
22
|
-
return
|
|
22
|
+
return device_serial
|
|
23
23
|
|
|
24
24
|
for option, argument in optlist:
|
|
25
25
|
if option == "-m":
|
|
26
|
-
|
|
26
|
+
device_serial = argument
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return device_serial
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
def get_serial_number() -> str:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .Device import get_serial_number, get_ip_address, get_manufacturer
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
from .Device import get_serial_number, get_ip_address, get_manufacturer
|
|
2
|
+
|
|
3
|
+
|
|
4
4
|
__all__ = ['get_serial_number', 'get_ip_address', 'get_manufacturer']
|
|
@@ -2,6 +2,8 @@ from dataclasses import dataclass
|
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from enum import Enum
|
|
4
4
|
import json
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class EventStatus(Enum):
|
|
7
9
|
|
|
@@ -731,4 +733,29 @@ class Package:
|
|
|
731
733
|
|
|
732
734
|
# Warn or log if there are unexpected keyword arguments
|
|
733
735
|
if kwargs:
|
|
734
|
-
print(f"Warning: Ignoring unexpected arguments: {kwargs}")
|
|
736
|
+
print(f"Warning: Ignoring unexpected arguments: {kwargs}")
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
class Notification:
|
|
740
|
+
|
|
741
|
+
def __init__(self, key: int = 0, notificationStatusID: int = 0, userID: int = 0, message: str = '', seenInApp: bool = False, seenDate: Optional[datetime] = None, sentAsEmail: bool = False, sentAsEmailDate: Optional[datetime] = None, guid: str = '', isArchived: bool = False, creationDate: Optional[datetime] = None, createdBy: int = 0, lastModifiedDate: Optional[datetime] = None, lastModifiedBy: int = 0, **kwargs):
|
|
742
|
+
self.notificationID = key
|
|
743
|
+
self.notificationStatusID = notificationStatusID
|
|
744
|
+
self.userID = userID
|
|
745
|
+
self.message = message
|
|
746
|
+
self.seenInApp = seenInApp
|
|
747
|
+
self.seenDate = seenDate
|
|
748
|
+
self.sentAsEmail = sentAsEmail
|
|
749
|
+
self.sentAsEmailDate = sentAsEmailDate
|
|
750
|
+
self.guid = guid
|
|
751
|
+
self.isArchived = isArchived
|
|
752
|
+
self.creationDate = creationDate
|
|
753
|
+
self.createdBy = createdBy
|
|
754
|
+
self.lastModifiedDate = lastModifiedDate
|
|
755
|
+
self.lastModifiedBy = lastModifiedBy
|
|
756
|
+
# Optionally store any extra fields
|
|
757
|
+
self.extra_fields = kwargs
|
|
758
|
+
|
|
759
|
+
# Warn or log if there are unexpected keyword arguments
|
|
760
|
+
if kwargs:
|
|
761
|
+
print(f"Warning: Ignoring unexpected arguments: {kwargs}")
|
|
@@ -28,10 +28,10 @@ class DateTimeEncoder(JSONEncoder):
|
|
|
28
28
|
return obj.isoformat()
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def register_agent(ws_config: WebServiceConfig,
|
|
31
|
+
def register_agent(ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int) -> tuple[int, str]:
|
|
32
32
|
|
|
33
33
|
try:
|
|
34
|
-
jsonPostData = {"deviceName":
|
|
34
|
+
jsonPostData = {"deviceName":device_serial, "agentType":agent_type, "agentVersion":agent_version, "agentIndex":agent_index, "processID":process_id}
|
|
35
35
|
|
|
36
36
|
method = "POST"
|
|
37
37
|
path = 'v1/agent'
|
|
@@ -55,10 +55,10 @@ def register_agent(ws_config: WebServiceConfig, device_name: str, agent_type: st
|
|
|
55
55
|
return response_code, response_string
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def device_ready(ws_config: WebServiceConfig,
|
|
58
|
+
def device_ready(ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int) -> tuple[int, str]:
|
|
59
59
|
|
|
60
60
|
try:
|
|
61
|
-
jsonPostData = {"deviceName":
|
|
61
|
+
jsonPostData = {"deviceName":device_serial, "agentType":agent_type, "agentVersion":agent_version, "agentIndex":agent_index, "processID":process_id, "deviceSerial":device_serial}
|
|
62
62
|
|
|
63
63
|
method = "POST"
|
|
64
64
|
path = 'v1/device/ready'
|
|
@@ -4,7 +4,7 @@ from actionstreamer import CommonFunctions
|
|
|
4
4
|
from actionstreamer.WebService.API import WebServiceResult
|
|
5
5
|
from actionstreamer.Config import WebServiceConfig
|
|
6
6
|
|
|
7
|
-
def get_pending_event_list(ws_config: WebServiceConfig,
|
|
7
|
+
def get_pending_event_list(ws_config: WebServiceConfig, device_serial: str) -> WebServiceResult:
|
|
8
8
|
|
|
9
9
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ def get_pending_event_list(ws_config: WebServiceConfig, device_name: str) -> Web
|
|
|
16
16
|
parameters = ''
|
|
17
17
|
|
|
18
18
|
json_post_data = {
|
|
19
|
-
"deviceName":
|
|
19
|
+
"deviceName": device_serial
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
body = json.dumps(json_post_data)
|
|
@@ -38,7 +38,7 @@ def get_pending_event_list(ws_config: WebServiceConfig, device_name: str) -> Web
|
|
|
38
38
|
return ws_result
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def dequeue_event(ws_config: WebServiceConfig,
|
|
41
|
+
def dequeue_event(ws_config: WebServiceConfig, device_serial: str, agent_type: str) -> WebServiceResult:
|
|
42
42
|
|
|
43
43
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
44
44
|
|
|
@@ -50,7 +50,8 @@ def dequeue_event(ws_config: WebServiceConfig, device_name: str, agent_type: str
|
|
|
50
50
|
parameters = ''
|
|
51
51
|
|
|
52
52
|
json_post_data = {
|
|
53
|
-
"deviceName":
|
|
53
|
+
"deviceName": device_serial,
|
|
54
|
+
"deviceSerial": device_serial,
|
|
54
55
|
"agentType": agent_type
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -147,7 +148,7 @@ def get_event_details(ws_config: WebServiceConfig, event_id: int) -> WebServiceR
|
|
|
147
148
|
return ws_result
|
|
148
149
|
|
|
149
150
|
|
|
150
|
-
def update_event_progress(ws_config: WebServiceConfig, event_id: int,
|
|
151
|
+
def update_event_progress(ws_config: WebServiceConfig, event_id: int, device_serial: str, percent_complete: float) -> WebServiceResult:
|
|
151
152
|
|
|
152
153
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
153
154
|
|
|
@@ -159,7 +160,8 @@ def update_event_progress(ws_config: WebServiceConfig, event_id: int, device_nam
|
|
|
159
160
|
parameters = ''
|
|
160
161
|
|
|
161
162
|
json_post_data = {
|
|
162
|
-
"deviceName":
|
|
163
|
+
"deviceName": device_serial,
|
|
164
|
+
"deviceSerial": device_serial,
|
|
163
165
|
"percentComplete": percent_complete
|
|
164
166
|
}
|
|
165
167
|
|
|
@@ -5,14 +5,14 @@ import actionstreamer.WebService.API
|
|
|
5
5
|
from actionstreamer.WebService.API import WebServiceResult
|
|
6
6
|
from actionstreamer.Config import WebServiceConfig
|
|
7
7
|
|
|
8
|
-
def create_file(ws_config: actionstreamer.Config.WebServiceConfig,
|
|
8
|
+
def create_file(ws_config: actionstreamer.Config.WebServiceConfig, device_serial: str, filename: str, file_size: int, sha256_hash: str) -> tuple[int, str, str, int]:
|
|
9
9
|
|
|
10
10
|
"""
|
|
11
11
|
Create a file.
|
|
12
12
|
|
|
13
13
|
Parameters:
|
|
14
14
|
ws_config (Config.WebServiceConfig): The web service configuration.
|
|
15
|
-
|
|
15
|
+
device_serial (string): The device name.
|
|
16
16
|
filename (string): The filename (no path information, just the name).
|
|
17
17
|
file_size (int): The file size in bytes.
|
|
18
18
|
sha256_hash (string): The SHA256 hash for the file.
|
|
@@ -25,7 +25,7 @@ def create_file(ws_config: actionstreamer.Config.WebServiceConfig, device_name:
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
try:
|
|
28
|
-
json_post_data = {"deviceName":
|
|
28
|
+
json_post_data = {"deviceName":device_serial, "filename":filename, "fileSize":file_size, "sHA256Hash":sha256_hash, "deviceSerial":device_serial}
|
|
29
29
|
|
|
30
30
|
method = "POST"
|
|
31
31
|
path = 'v1/file'
|
|
@@ -63,14 +63,14 @@ def create_file(ws_config: actionstreamer.Config.WebServiceConfig, device_name:
|
|
|
63
63
|
return response_code, response_string, signed_url, file_id
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
def create_temp_file(ws_config: actionstreamer.Config.WebServiceConfig,
|
|
66
|
+
def create_temp_file(ws_config: actionstreamer.Config.WebServiceConfig, device_serial: str, filename: str, file_size: int, sha256_hash: str) -> tuple[int, str, str, int]:
|
|
67
67
|
|
|
68
68
|
"""
|
|
69
69
|
Create a temp file. This file will be deleted from S3 after 24 hours.
|
|
70
70
|
|
|
71
71
|
Parameters:
|
|
72
72
|
ws_config (Config.WebServiceConfig): The web service configuration.
|
|
73
|
-
|
|
73
|
+
device_serial (string): The device serial number.
|
|
74
74
|
filename (string): The filename (no path information, just the name).
|
|
75
75
|
file_size (int): The file size in bytes.
|
|
76
76
|
sha256_hash (string): The SHA256 hash for the file.
|
|
@@ -83,7 +83,7 @@ def create_temp_file(ws_config: actionstreamer.Config.WebServiceConfig, device_n
|
|
|
83
83
|
"""
|
|
84
84
|
|
|
85
85
|
try:
|
|
86
|
-
json_post_data = {"deviceName":
|
|
86
|
+
json_post_data = {"deviceName":device_serial, "filename":filename, "fileSize":file_size, "sHA256Hash":sha256_hash, "deviceSerial":device_serial}
|
|
87
87
|
|
|
88
88
|
method = "POST"
|
|
89
89
|
path = 'v1/file/temp'
|
|
@@ -121,12 +121,12 @@ def create_temp_file(ws_config: actionstreamer.Config.WebServiceConfig, device_n
|
|
|
121
121
|
return response_code, response_string, signed_url, file_id
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
def update_file_upload_success(ws_config: WebServiceConfig,
|
|
124
|
+
def update_file_upload_success(ws_config: WebServiceConfig, device_serial: str, file_id: int) -> WebServiceResult:
|
|
125
125
|
|
|
126
126
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
127
127
|
|
|
128
128
|
try:
|
|
129
|
-
json_post_data = {'deviceSerial':
|
|
129
|
+
json_post_data = {'deviceSerial':device_serial}
|
|
130
130
|
|
|
131
131
|
method = "POST"
|
|
132
132
|
path = 'v1/file/success/' + str(file_id)
|
|
@@ -5,7 +5,7 @@ from actionstreamer.WebService.API import WebServiceResult
|
|
|
5
5
|
from actionstreamer.Config import WebServiceConfig
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def create_health(ws_config: WebServiceConfig,
|
|
8
|
+
def create_health(ws_config: WebServiceConfig, device_serial: str, health_json: str) -> WebServiceResult:
|
|
9
9
|
|
|
10
10
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
11
11
|
|
|
@@ -17,7 +17,8 @@ def create_health(ws_config: WebServiceConfig, device_name: str, health_json: st
|
|
|
17
17
|
parameters = ''
|
|
18
18
|
|
|
19
19
|
json_post_data = {
|
|
20
|
-
"deviceName":
|
|
20
|
+
"deviceName": device_serial,
|
|
21
|
+
"deviceSerial": device_serial,
|
|
21
22
|
"healthJSON": health_json
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -39,7 +40,7 @@ def create_health(ws_config: WebServiceConfig, device_name: str, health_json: st
|
|
|
39
40
|
return ws_result
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
def update_health(ws_config: WebServiceConfig,
|
|
43
|
+
def update_health(ws_config: WebServiceConfig, device_serial: str, health_json: str) -> WebServiceResult:
|
|
43
44
|
|
|
44
45
|
ws_result = WebServiceResult(0, '', '', '', None)
|
|
45
46
|
|
|
@@ -51,7 +52,8 @@ def update_health(ws_config: WebServiceConfig, device_name: str, health_json: st
|
|
|
51
52
|
parameters = ''
|
|
52
53
|
|
|
53
54
|
json_post_data = {
|
|
54
|
-
"deviceName":
|
|
55
|
+
"deviceName": device_serial,
|
|
56
|
+
"deviceSerial": device_serial,
|
|
55
57
|
"healthJSON": health_json
|
|
56
58
|
}
|
|
57
59
|
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/LogMessage/LogMessage.py
RENAMED
|
@@ -13,7 +13,7 @@ def create_log_message(log_config: LogConfig, message: str, log_to_console=True)
|
|
|
13
13
|
CommonFunctions.log_to_console(message, agent_name)
|
|
14
14
|
|
|
15
15
|
utc_now = datetime.datetime.now(datetime.timezone.utc)
|
|
16
|
-
post_data = {"deviceName": log_config.
|
|
16
|
+
post_data = {"deviceName": log_config.device_serial, "agentType": log_config.agent_type, "agentVersion": log_config.agent_version, "agentIndex": log_config.agent_index, "processID": log_config.process_id, "message": message, "logDate": str(utc_now), "deviceSerial": log_config.device_serial}
|
|
17
17
|
|
|
18
18
|
method = "POST"
|
|
19
19
|
path = 'v1/logmessage'
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/LogMessage/__init__.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .LogMessage import create_log_message
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__all__ = ['create_log_message']
|
|
1
|
+
from .LogMessage import create_log_message
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
__all__ = ['create_log_message']
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import urllib
|
|
3
|
+
from typing import List
|
|
4
|
+
from actionstreamer import CommonFunctions
|
|
5
|
+
from actionstreamer.Config import WebServiceConfig
|
|
6
|
+
from actionstreamer.WebService.API import WebServiceResult
|
|
7
|
+
from actionstreamer.WebService.Patch import *
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_notification_list(ws_config: WebServiceConfig, last_epoch_time: int, seen_in_app: bool = False, sent_as_email: bool = False) -> WebServiceResult:
|
|
11
|
+
|
|
12
|
+
ws_result = WebServiceResult(0, '', '', '', None)
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
|
|
16
|
+
method = "GET"
|
|
17
|
+
path = 'v1/notification/list'
|
|
18
|
+
url = ws_config.base_url + path
|
|
19
|
+
headers = {"Content-Type": "application/json"}
|
|
20
|
+
|
|
21
|
+
parameters = {
|
|
22
|
+
"last_epoch_time": str(last_epoch_time),
|
|
23
|
+
"seen_in_app": str(seen_in_app).lower(),
|
|
24
|
+
"sent_as_email": str(sent_as_email).lower()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body = '' #json.dumps(json_post_data)
|
|
28
|
+
|
|
29
|
+
response_code, response_string = CommonFunctions.send_signed_request(ws_config, method, url, path, headers, parameters, body)
|
|
30
|
+
|
|
31
|
+
ws_result.http_response_code = response_code
|
|
32
|
+
ws_result.http_response_string = response_string
|
|
33
|
+
ws_result.json_data = json.loads(response_string)
|
|
34
|
+
|
|
35
|
+
except Exception as ex:
|
|
36
|
+
|
|
37
|
+
ws_result.code = -1
|
|
38
|
+
filename, line_number = CommonFunctions.get_exception_info()
|
|
39
|
+
if filename is not None and line_number is not None:
|
|
40
|
+
print(f"Exception occurred in get_video_clip_list at line {line_number} in {filename}")
|
|
41
|
+
print(ex)
|
|
42
|
+
ws_result.description = str(ex)
|
|
43
|
+
|
|
44
|
+
return ws_result
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .Patch import add_patch_operation, generate_patch_json
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__all__ = ['add_patch_operation', 'generate_patch_json']
|
|
1
|
+
from .Patch import add_patch_operation, generate_patch_json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
__all__ = ['add_patch_operation', 'generate_patch_json']
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/VideoClip/VideoClip.py
RENAMED
|
@@ -7,14 +7,14 @@ from actionstreamer.WebService.API import WebServiceResult
|
|
|
7
7
|
from actionstreamer.WebService.Patch import *
|
|
8
8
|
from actionstreamer.Model import CreateVideoClip
|
|
9
9
|
|
|
10
|
-
def create_video_clip(ws_config: WebServiceConfig,
|
|
10
|
+
def create_video_clip(ws_config: WebServiceConfig, device_serial: str, create_video_clip: CreateVideoClip) -> tuple[int, str]:
|
|
11
11
|
|
|
12
12
|
try:
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
device_serial = device_serial.replace(" ", "")
|
|
14
|
+
device_serial = urllib.parse.quote(device_serial)
|
|
15
15
|
|
|
16
16
|
method = "POST"
|
|
17
|
-
path = 'v1/videoclip/' +
|
|
17
|
+
path = 'v1/videoclip/' + device_serial
|
|
18
18
|
url = ws_config.base_url + path
|
|
19
19
|
headers = {"Content-Type": "application/json"}
|
|
20
20
|
parameters = ''
|
|
@@ -35,15 +35,15 @@ def create_video_clip(ws_config: WebServiceConfig, device_name: str, create_vide
|
|
|
35
35
|
return response_code, response_string
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def create_video_clip_list(ws_config: WebServiceConfig,
|
|
38
|
+
def create_video_clip_list(ws_config: WebServiceConfig, device_serial: str, create_video_clips: List[CreateVideoClip]) -> tuple[int, str]:
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
|
-
# Clean and encode
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
# Clean and encode device_serial
|
|
42
|
+
device_serial = device_serial.replace(" ", "")
|
|
43
|
+
device_serial = urllib.parse.quote(device_serial)
|
|
44
44
|
|
|
45
45
|
method = "POST"
|
|
46
|
-
path = 'v1/videoclip/createlist/' +
|
|
46
|
+
path = 'v1/videoclip/createlist/' + device_serial
|
|
47
47
|
url = ws_config.base_url + path
|
|
48
48
|
headers = {"Content-Type": "application/json"}
|
|
49
49
|
parameters = ''
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from .CommonFunctions import *
|
|
2
|
-
from .WebService import *
|
|
3
|
-
from .Config import *
|
|
4
|
-
from .Device import *
|
|
5
|
-
from .Model import *
|
|
6
|
-
|
|
7
|
-
__all__ = ['CommonFunctions', 'WebService', 'Config', 'Device', 'Model']
|
|
1
|
+
from .CommonFunctions import *
|
|
2
|
+
from .WebService import *
|
|
3
|
+
from .Config import *
|
|
4
|
+
from .Device import *
|
|
5
|
+
from .Model import *
|
|
6
|
+
|
|
7
|
+
__all__ = ['CommonFunctions', 'WebService', 'Config', 'Device', 'Model']
|
|
File without changes
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/CommonFunctions/Wifi/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/EventPreset/EventPreset.py
RENAMED
|
File without changes
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/EventPreset/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/Package/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{actionstreamer-1.2.44 → actionstreamer-1.3.0}/actionstreamer/WebService/VideoClip/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|