mgraph-ai-service-cache-client 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
Potentially problematic release.
This version of mgraph-ai-service-cache-client might be problematic. Click here for more details.
- mgraph_ai_service_cache_client/client/Cache__Client.py +6 -0
- mgraph_ai_service_cache_client/client/Cache__Client__Config.py +7 -0
- mgraph_ai_service_cache_client/client/Cache__Client__Health_Checks.py +38 -0
- mgraph_ai_service_cache_client/client/Cache__Client__Requests.py +50 -0
- mgraph_ai_service_cache_client/client_builder/Fast_API__Client__Builder.py +49 -0
- mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client.py +77 -0
- mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client__Config.py +14 -0
- mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client__Requests.py +146 -0
- mgraph_ai_service_cache_client/client_contract/__init__.py +1 -0
- mgraph_ai_service_cache_client/client_contract/admin_storage/Service__Fast_API__Client__Admin__Storage.py +113 -0
- mgraph_ai_service_cache_client/client_contract/auth/Service__Fast_API__Client__Set_Cookie.py +35 -0
- mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data.py +17 -0
- mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data__Delete.py +63 -0
- mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data__Retrieve.py +87 -0
- mgraph_ai_service_cache_client/client_contract/data_store/Service__Fast_API__Client__Data__Store.py +148 -0
- mgraph_ai_service_cache_client/client_contract/delete/Service__Fast_API__Client__File__Delete.py +22 -0
- mgraph_ai_service_cache_client/client_contract/exists/Service__Fast_API__Client__File__Exists.py +22 -0
- mgraph_ai_service_cache_client/client_contract/info/Service__Fast_API__Client__Info.py +64 -0
- mgraph_ai_service_cache_client/client_contract/namespace/Service__Fast_API__Client__Namespace.py +48 -0
- mgraph_ai_service_cache_client/client_contract/retrieve/Service__Fast_API__Client__File__Retrieve.py +169 -0
- mgraph_ai_service_cache_client/client_contract/server/Service__Fast_API__Client__Server.py +35 -0
- mgraph_ai_service_cache_client/client_contract/store/Service__Fast_API__Client__File__Store.py +104 -0
- mgraph_ai_service_cache_client/client_contract/zip/Service__Fast_API__Client__Zip.py +129 -0
- mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Exists__Response.py +1 -1
- mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__Store__Strategy.py +3 -0
- mgraph_ai_service_cache_client/schemas/client/Cache__Client__Requests__Result.py +26 -0
- mgraph_ai_service_cache_client/schemas/client/health_checks/Client__Check__Target_Server__Auth.py +7 -0
- mgraph_ai_service_cache_client/schemas/client/health_checks/Client__Check__Target_Server__Status.py +11 -0
- mgraph_ai_service_cache_client/schemas/client_builder/Schema__Fast_API__Client__Server__Details.py +9 -0
- mgraph_ai_service_cache_client/schemas/client_builder/__init__.py +0 -0
- mgraph_ai_service_cache_client/schemas/consts/consts__Cache_Client.py +3 -0
- mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Gone.py +2 -2
- mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Not_Found.py +4 -4
- mgraph_ai_service_cache_client/version +1 -1
- {mgraph_ai_service_cache_client-0.1.3.dist-info → mgraph_ai_service_cache_client-0.2.0.dist-info}/METADATA +3 -2
- {mgraph_ai_service_cache_client-0.1.3.dist-info → mgraph_ai_service_cache_client-0.2.0.dist-info}/RECORD +41 -22
- mgraph_ai_service_cache_client/config.py +0 -6
- mgraph_ai_service_cache_client/fast_api/Cache_Client__Fast_API.py +0 -15
- mgraph_ai_service_cache_client/fast_api/lambda_handler.py +0 -26
- mgraph_ai_service_cache_client/fast_api/routes/Routes__Info.py +0 -32
- mgraph_ai_service_cache_client/service/info/Service_Info.py +0 -23
- mgraph_ai_service_cache_client/service/info/schemas/Enum__Service_Environment.py +0 -6
- mgraph_ai_service_cache_client/service/info/schemas/Enum__Service_Status.py +0 -5
- mgraph_ai_service_cache_client/service/info/schemas/Schema__Server__Versions.py +0 -15
- mgraph_ai_service_cache_client/service/info/schemas/Schema__Service__Status.py +0 -14
- mgraph_ai_service_cache_client/utils/deploy/Deploy__Service.py +0 -20
- /mgraph_ai_service_cache_client/{fast_api → client}/__init__.py +0 -0
- /mgraph_ai_service_cache_client/{fast_api/routes → client_builder}/__init__.py +0 -0
- /mgraph_ai_service_cache_client/{service → schemas/client}/__init__.py +0 -0
- {mgraph_ai_service_cache_client-0.1.3.dist-info → mgraph_ai_service_cache_client-0.2.0.dist-info}/LICENSE +0 -0
- {mgraph_ai_service_cache_client-0.1.3.dist-info → mgraph_ai_service_cache_client-0.2.0.dist-info}/WHEEL +0 -0
mgraph_ai_service_cache_client/client_contract/store/Service__Fast_API__Client__File__Store.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from typing import Any, Optional, Dict
|
|
2
|
+
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
3
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
|
|
4
|
+
from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Service__Fast_API__Client__File__Store(Type_Safe):
|
|
8
|
+
_client: Any # Reference to main client
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def requests(self): # Access the unified request handler
|
|
12
|
+
return self._client.requests()
|
|
13
|
+
|
|
14
|
+
#def store__string(self, strategy: Enum__Cache__Store__Strategy, namespace: str) -> Dict: # todo: BUG, missing body in method param
|
|
15
|
+
def store__string(self, strategy : Enum__Cache__Store__Strategy,
|
|
16
|
+
#namespace : str, # todo: BUG namespace is Safe_Str__Id
|
|
17
|
+
namespace: Safe_Str__Id ,
|
|
18
|
+
body : str
|
|
19
|
+
) -> Dict: # Auto-generated from endpoint post__store__string
|
|
20
|
+
# Build path
|
|
21
|
+
#path = f"/{{namespace}}/{{strategy}}/store/string" # todo: BUG used {{namespace}} instead of {namespace}
|
|
22
|
+
path = f"/{namespace}/{strategy}/store/string"
|
|
23
|
+
|
|
24
|
+
#body = None # todo: BUG name was None
|
|
25
|
+
# Execute request
|
|
26
|
+
result = self.requests.execute(
|
|
27
|
+
method = "POST",
|
|
28
|
+
path = path,
|
|
29
|
+
body = body
|
|
30
|
+
)
|
|
31
|
+
# Return response data
|
|
32
|
+
return result.json if result.json else result.text
|
|
33
|
+
|
|
34
|
+
def store__string__cache_key(self, namespace: str, strategy: Enum__Cache__Store__Strategy, cache_key: str, file_id: Optional[str] = None) -> Dict: # Auto-generated from endpoint post__store__string__cache_key
|
|
35
|
+
# Build path
|
|
36
|
+
path = f"/{{namespace}}/{{strategy}}/store/string/{cache_key:path}"
|
|
37
|
+
body = None
|
|
38
|
+
# Execute request
|
|
39
|
+
result = self.requests.execute(
|
|
40
|
+
method = "POST",
|
|
41
|
+
path = path,
|
|
42
|
+
body = body
|
|
43
|
+
)
|
|
44
|
+
# Return response data
|
|
45
|
+
return result.json if result.json else result.text
|
|
46
|
+
|
|
47
|
+
#def store__json(self, strategy: Enum__Cache__Store__Strategy, namespace: str) -> Dict: # BUG: missing body, namespace should be Safe_Str__Id
|
|
48
|
+
def store__json(self, strategy : Enum__Cache__Store__Strategy,
|
|
49
|
+
namespace: Safe_Str__Id,
|
|
50
|
+
body : Dict
|
|
51
|
+
)-> Dict:
|
|
52
|
+
#path = f"/{{namespace}}/{{strategy}}/store/json" # BUG: used {{
|
|
53
|
+
path = f"/{namespace}/{strategy}/store/json" # Build path
|
|
54
|
+
#body = None # BUG: body was None
|
|
55
|
+
# Execute request
|
|
56
|
+
result = self.requests.execute(
|
|
57
|
+
method = "POST",
|
|
58
|
+
path = path,
|
|
59
|
+
body = body
|
|
60
|
+
)
|
|
61
|
+
# Return response data
|
|
62
|
+
return result.json if result.json else result.text
|
|
63
|
+
|
|
64
|
+
def store__json__cache_key(self, namespace: str, strategy: Enum__Cache__Store__Strategy, cache_key: str, file_id: Optional[str] = None) -> Dict: # Auto-generated from endpoint post__store__json__cache_key
|
|
65
|
+
# Build path
|
|
66
|
+
path = f"/{{namespace}}/{{strategy}}/store/json/{cache_key:path}"
|
|
67
|
+
body = None
|
|
68
|
+
# Execute request
|
|
69
|
+
result = self.requests.execute(
|
|
70
|
+
method = "POST",
|
|
71
|
+
path = path,
|
|
72
|
+
body = body
|
|
73
|
+
)
|
|
74
|
+
# Return response data
|
|
75
|
+
return result.json if result.json else result.text
|
|
76
|
+
|
|
77
|
+
#def store__binary(self, strategy: Enum__Cache__Store__Strategy, namespace: str) -> Dict: # todo: same prob as the store__string and store__json
|
|
78
|
+
def store__binary(self, strategy : Enum__Cache__Store__Strategy,
|
|
79
|
+
namespace: Safe_Str__Id ,
|
|
80
|
+
body : bytes
|
|
81
|
+
) -> Dict:
|
|
82
|
+
#path = f"/{{namespace}}/{{strategy}}/store/binary" # Build path
|
|
83
|
+
path = f"/{namespace}/{strategy}/store/binary" # Build path
|
|
84
|
+
#body = None
|
|
85
|
+
result = self.requests.execute( # Execute request
|
|
86
|
+
method = "POST",
|
|
87
|
+
path = path,
|
|
88
|
+
body = body
|
|
89
|
+
)
|
|
90
|
+
# Return response data
|
|
91
|
+
return result.json if result.json else result.text
|
|
92
|
+
|
|
93
|
+
def store__binary__cache_key(self, namespace: str, strategy: Enum__Cache__Store__Strategy, cache_key: str, file_id: Optional[str] = None) -> Dict: # Auto-generated from endpoint post__store__binary__cache_key
|
|
94
|
+
# Build path
|
|
95
|
+
path = f"/{{namespace}}/{{strategy}}/store/binary/{cache_key:path}"
|
|
96
|
+
body = None
|
|
97
|
+
# Execute request
|
|
98
|
+
result = self.requests.execute(
|
|
99
|
+
method = "POST",
|
|
100
|
+
path = path,
|
|
101
|
+
body = body
|
|
102
|
+
)
|
|
103
|
+
# Return response data
|
|
104
|
+
return result.json if result.json else result.text
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from typing import Any, Optional, Dict
|
|
2
|
+
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
3
|
+
|
|
4
|
+
from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Service__Fast_API__Client__Zip(Type_Safe):
|
|
8
|
+
_client: Any # Reference to main client
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def requests(self): # Access the unified request handler
|
|
12
|
+
return self._client.requests()
|
|
13
|
+
|
|
14
|
+
def zip_create(self, namespace: str, strategy: Enum__Cache__Store__Strategy, cache_key: str, file_id: str) -> Dict: # Auto-generated from endpoint post__zip_create
|
|
15
|
+
# Build path
|
|
16
|
+
path = f"/{{namespace}}/{{strategy}}/zip/create/{cache_key:path}/{{file_id}}"
|
|
17
|
+
body = None
|
|
18
|
+
# Execute request
|
|
19
|
+
result = self.requests.execute(
|
|
20
|
+
method = "POST",
|
|
21
|
+
path = path,
|
|
22
|
+
body = body
|
|
23
|
+
)
|
|
24
|
+
# Return response data
|
|
25
|
+
return result.json if result.json else result.text
|
|
26
|
+
|
|
27
|
+
def zip_store(self, namespace: str, strategy: Enum__Cache__Store__Strategy, cache_key: str, file_id: str) -> Dict: # Auto-generated from endpoint post__zip_store
|
|
28
|
+
# Build path
|
|
29
|
+
path = f"/{{namespace}}/{{strategy}}/zip/store/{cache_key:path}/{{file_id}}"
|
|
30
|
+
body = None
|
|
31
|
+
# Execute request
|
|
32
|
+
result = self.requests.execute(
|
|
33
|
+
method = "POST",
|
|
34
|
+
path = path,
|
|
35
|
+
body = body
|
|
36
|
+
)
|
|
37
|
+
# Return response data
|
|
38
|
+
return result.json if result.json else result.text
|
|
39
|
+
|
|
40
|
+
def zip_retrieve(self, cache_id: str, namespace: str) -> Dict: # Auto-generated from endpoint get__zip_retrieve
|
|
41
|
+
# Build path
|
|
42
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/retrieve"
|
|
43
|
+
body = None
|
|
44
|
+
# Execute request
|
|
45
|
+
result = self.requests.execute(
|
|
46
|
+
method = "GET",
|
|
47
|
+
path = path,
|
|
48
|
+
body = body
|
|
49
|
+
)
|
|
50
|
+
# Return response data
|
|
51
|
+
return result.json if result.json else result.text
|
|
52
|
+
|
|
53
|
+
def zip_files_list(self, cache_id: str, namespace: str) -> Dict: # Auto-generated from endpoint get__zip_files_list
|
|
54
|
+
# Build path
|
|
55
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/files/list"
|
|
56
|
+
body = None
|
|
57
|
+
# Execute request
|
|
58
|
+
result = self.requests.execute(
|
|
59
|
+
method = "GET",
|
|
60
|
+
path = path,
|
|
61
|
+
body = body
|
|
62
|
+
)
|
|
63
|
+
# Return response data
|
|
64
|
+
return result.json if result.json else result.text
|
|
65
|
+
|
|
66
|
+
def zip_file_retrieve(self, cache_id: str, file_path: str, namespace: str) -> Dict: # Auto-generated from endpoint get__zip_file_retrieve
|
|
67
|
+
# Build path
|
|
68
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/file/retrieve/{file_path:path}"
|
|
69
|
+
body = None
|
|
70
|
+
# Execute request
|
|
71
|
+
result = self.requests.execute(
|
|
72
|
+
method = "GET",
|
|
73
|
+
path = path,
|
|
74
|
+
body = body
|
|
75
|
+
)
|
|
76
|
+
# Return response data
|
|
77
|
+
return result.json if result.json else result.text
|
|
78
|
+
|
|
79
|
+
def zip_file_add_from_bytes(self, cache_id: str, file_path: str, namespace: str) -> Dict: # Auto-generated from endpoint post__zip_file_add_from_bytes
|
|
80
|
+
# Build path
|
|
81
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/file/add/from/bytes/{file_path:path}"
|
|
82
|
+
body = None
|
|
83
|
+
# Execute request
|
|
84
|
+
result = self.requests.execute(
|
|
85
|
+
method = "POST",
|
|
86
|
+
path = path,
|
|
87
|
+
body = body
|
|
88
|
+
)
|
|
89
|
+
# Return response data
|
|
90
|
+
return result.json if result.json else result.text
|
|
91
|
+
|
|
92
|
+
def zip_file_add_from_string(self, cache_id: str, file_path: str, namespace: str) -> Dict: # Auto-generated from endpoint post__zip_file_add_from_string
|
|
93
|
+
# Build path
|
|
94
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/file/add/from/string/{file_path:path}"
|
|
95
|
+
body = None
|
|
96
|
+
# Execute request
|
|
97
|
+
result = self.requests.execute(
|
|
98
|
+
method = "POST",
|
|
99
|
+
path = path,
|
|
100
|
+
body = body
|
|
101
|
+
)
|
|
102
|
+
# Return response data
|
|
103
|
+
return result.json if result.json else result.text
|
|
104
|
+
|
|
105
|
+
def zip_file_delete(self, cache_id: str, file_path: str, namespace: str) -> Dict: # Auto-generated from endpoint delete__zip_file_delete
|
|
106
|
+
# Build path
|
|
107
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/file/delete/{file_path:path}"
|
|
108
|
+
body = None
|
|
109
|
+
# Execute request
|
|
110
|
+
result = self.requests.execute(
|
|
111
|
+
method = "DELETE",
|
|
112
|
+
path = path,
|
|
113
|
+
body = body
|
|
114
|
+
)
|
|
115
|
+
# Return response data
|
|
116
|
+
return result.json if result.json else result.text
|
|
117
|
+
|
|
118
|
+
def batch_operations(self, cache_id: str, namespace: str) -> Dict: # Auto-generated from endpoint post__batch_operations
|
|
119
|
+
# Build path
|
|
120
|
+
path = f"/{{namespace}}/zip/{{cache_id}}/batch/operations"
|
|
121
|
+
body = None
|
|
122
|
+
# Execute request
|
|
123
|
+
result = self.requests.execute(
|
|
124
|
+
method = "POST",
|
|
125
|
+
path = path,
|
|
126
|
+
body = body
|
|
127
|
+
)
|
|
128
|
+
# Return response data
|
|
129
|
+
return result.json if result.json else result.text
|
|
@@ -2,7 +2,7 @@ from osbot_utils.type_safe.Type_Safe
|
|
|
2
2
|
from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid import Random_Guid
|
|
3
3
|
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
|
|
4
4
|
from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Cache_Hash import Safe_Str__Cache_Hash
|
|
5
|
-
from mgraph_ai_service_cache_client.schemas.cache.Schema__Cache__Metadata
|
|
5
|
+
from mgraph_ai_service_cache_client.schemas.cache.Schema__Cache__Metadata import Schema__Cache__Metadata
|
|
6
6
|
|
|
7
7
|
# todo: see refactoring opportunity for creating some base classes that have common fields like cache_id, cache_hash and metadata
|
|
8
8
|
# Response for checking if cache entry exists
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
3
|
+
from osbot_utils.type_safe.primitives.core.Safe_Float import Safe_Float
|
|
4
|
+
from osbot_utils.type_safe.primitives.core.Safe_UInt import Safe_UInt
|
|
5
|
+
from osbot_utils.type_safe.primitives.domains.common.safe_str.Safe_Str__Text import Safe_Str__Text
|
|
6
|
+
from osbot_utils.type_safe.primitives.domains.files.safe_str.Safe_Str__File__Path import Safe_Str__File__Path
|
|
7
|
+
from osbot_utils.type_safe.primitives.domains.http.safe_str.Safe_Str__Http__Content_Type import Safe_Str__Http__Content_Type
|
|
8
|
+
from osbot_utils.type_safe.primitives.domains.http.safe_str.Safe_Str__Http__Text import Safe_Str__Http__Text
|
|
9
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now import Timestamp_Now
|
|
10
|
+
from osbot_utils.type_safe.primitives.domains.web.safe_str.Safe_Str__Url import Safe_Str__Url
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Cache__Client__Requests__Result(Type_Safe):
|
|
14
|
+
content_type : Safe_Str__Http__Content_Type
|
|
15
|
+
content : bytes = None
|
|
16
|
+
duration : Safe_Float
|
|
17
|
+
error : Safe_Str__Text
|
|
18
|
+
json : Dict = None
|
|
19
|
+
path : Safe_Str__File__Path
|
|
20
|
+
status_code : Safe_UInt
|
|
21
|
+
target_server : Safe_Str__Url
|
|
22
|
+
text : Safe_Str__Http__Text = None # this has 1M limit, which should be ok for all use-cases (that return text)
|
|
23
|
+
timestamp : Timestamp_Now
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
mgraph_ai_service_cache_client/schemas/client/health_checks/Client__Check__Target_Server__Status.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
2
|
+
from osbot_utils.type_safe.primitives.core.Safe_Float import Safe_Float
|
|
3
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now import Timestamp_Now
|
|
4
|
+
from osbot_utils.type_safe.primitives.domains.web.safe_str.Safe_Str__Url import Safe_Str__Url
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Client__Check__Target_Server__Status(Type_Safe):
|
|
8
|
+
duration : Safe_Float
|
|
9
|
+
success : bool
|
|
10
|
+
target_server: Safe_Str__Url
|
|
11
|
+
timestamp : Timestamp_Now
|
mgraph_ai_service_cache_client/schemas/client_builder/Schema__Fast_API__Client__Server__Details.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
2
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
|
|
3
|
+
from osbot_utils.type_safe.primitives.domains.web.safe_str.Safe_Str__Url import Safe_Str__Url
|
|
4
|
+
|
|
5
|
+
class Schema__Fast_API__Client__Server__Details(Type_Safe):
|
|
6
|
+
api_key : Safe_Str__Id
|
|
7
|
+
api_key_header : Safe_Str__Id
|
|
8
|
+
base_url : Safe_Str__Url
|
|
9
|
+
configured : bool
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
ENV_VAR__AUTH__TARGET_SERVER__CACHE_SERVICE__KEY_NAME = "AUTH__TARGET_SERVER__CACHE_SERVICE__KEY_NAME"
|
|
2
|
+
ENV_VAR__AUTH__TARGET_SERVER__CACHE_SERVICE__KEY_VALUE = "AUTH__TARGET_SERVER__CACHE_SERVICE__KEY_VALUE"
|
|
3
|
+
ENV_VAR__URL__TARGET_SERVER__CACHE_SERVICE = "URL__TARGET_SERVER__CACHE_SERVICE"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from osbot_utils.type_safe.primitives.core.Safe_UInt import Safe_UInt
|
|
2
2
|
from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid import Random_Guid
|
|
3
|
-
from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now
|
|
3
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now import Timestamp_Now
|
|
4
4
|
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
|
|
5
|
-
from mgraph_ai_service_cache_client.schemas.errors.Schema__Cache__Error__Base
|
|
5
|
+
from mgraph_ai_service_cache_client.schemas.errors.Schema__Cache__Error__Base import Schema__Cache__Error__Base
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Schema__Cache__Error__Gone(Schema__Cache__Error__Base): # 410 Gone errors (expired entries)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid
|
|
2
|
-
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id
|
|
3
|
-
from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Cache_Hash
|
|
4
|
-
from mgraph_ai_service_cache_client.schemas.errors.Schema__Cache__Error__Base
|
|
1
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid import Random_Guid
|
|
2
|
+
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
|
|
3
|
+
from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Cache_Hash import Safe_Str__Cache_Hash
|
|
4
|
+
from mgraph_ai_service_cache_client.schemas.errors.Schema__Cache__Error__Base import Schema__Cache__Error__Base
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class Schema__Cache__Error__Not_Found(Schema__Cache__Error__Base): # 404 Not Found errors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.
|
|
1
|
+
v0.2.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mgraph_ai_service_cache__client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: MGraph-AI__Service__Cache__Client
|
|
5
5
|
Home-page: https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client
|
|
6
6
|
License: Apache 2.0
|
|
@@ -10,13 +10,14 @@ Requires-Python: >=3.12,<4.0
|
|
|
10
10
|
Classifier: License :: Other/Proprietary License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Requires-Dist: mgraph_ai_service_cache
|
|
13
14
|
Requires-Dist: osbot-fast-api-serverless
|
|
14
15
|
Project-URL: Repository, https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client
|
|
15
16
|
Description-Content-Type: text/markdown
|
|
16
17
|
|
|
17
18
|
# MGraph AI Service Cache Client
|
|
18
19
|
|
|
19
|
-
[](https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client/releases)
|
|
20
21
|
[](https://www.python.org/downloads/)
|
|
21
22
|
[](https://fastapi.tiangolo.com/)
|
|
22
23
|
[](https://aws.amazon.com/lambda/)
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
mgraph_ai_service_cache_client/__init__.py,sha256=vV-3_LTA0gOaz_M_rug9AA7UQ6vMFo35MolQSywHS-4,74
|
|
2
|
-
mgraph_ai_service_cache_client/
|
|
3
|
-
mgraph_ai_service_cache_client/
|
|
4
|
-
mgraph_ai_service_cache_client/
|
|
5
|
-
mgraph_ai_service_cache_client/
|
|
6
|
-
mgraph_ai_service_cache_client/
|
|
7
|
-
mgraph_ai_service_cache_client/
|
|
2
|
+
mgraph_ai_service_cache_client/client/Cache__Client.py,sha256=fdfMSe86BzcNMmPIWalAeQUCdWgHa_dho0xEJ4c2tGY,244
|
|
3
|
+
mgraph_ai_service_cache_client/client/Cache__Client__Config.py,sha256=HY9ZwlQUR562l_SMeZSEd3G48TB9M-k4AdN81Nbrtjw,341
|
|
4
|
+
mgraph_ai_service_cache_client/client/Cache__Client__Health_Checks.py,sha256=9Al7pvFeowkfifAPezBS2bYzIt2GssSMrokqXLZkeio,2610
|
|
5
|
+
mgraph_ai_service_cache_client/client/Cache__Client__Requests.py,sha256=sPDqLu9POzJ9vwD-MgYf-U4SzSqavTnRqgcA1T136sQ,2521
|
|
6
|
+
mgraph_ai_service_cache_client/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
mgraph_ai_service_cache_client/client_builder/Fast_API__Client__Builder.py,sha256=fDlEKF4BTPKbDSRbDDri6YqHpiRhf_KR0fh3bynEbdc,2960
|
|
8
|
+
mgraph_ai_service_cache_client/client_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client.py,sha256=3HTrg5tkshmjhAcmXsPc6lNxQl-SFpLWwV86RZiFNtU,4782
|
|
10
|
+
mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client__Config.py,sha256=MB0eVlBCbmF3D6I7lgG2Hmdk2zd4ONp35cQxIk7sIiM,1103
|
|
11
|
+
mgraph_ai_service_cache_client/client_contract/Service__Fast_API__Client__Requests.py,sha256=uNQ6z7TPYvw_HTrOG4WLvJ53goGvzUUhSbbdn7NXJHE,9204
|
|
12
|
+
mgraph_ai_service_cache_client/client_contract/__init__.py,sha256=PGyZ2OTqIaTITx85nRqQzwToIqGkQJpqFvQyu94Fgj4,26
|
|
13
|
+
mgraph_ai_service_cache_client/client_contract/admin_storage/Service__Fast_API__Client__Admin__Storage.py,sha256=TltZTWVR9waCVC_yO0VO88LbqttrVpQc7zkD6LP0O8U,6090
|
|
14
|
+
mgraph_ai_service_cache_client/client_contract/auth/Service__Fast_API__Client__Set_Cookie.py,sha256=ZGy4SpcKJcoKRfzeqnrjNEh7r5qOTSlDrNWdu9ywmh8,1789
|
|
15
|
+
mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data.py,sha256=0Z2HkcyXInbsH5zX6YYhCXP69hLa5EcO39SbJHZEWlA,1020
|
|
16
|
+
mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data__Delete.py,sha256=wuMXXKHYcF6Du-81P6DxqWRtsLlyBDF2Nmha0pHiKD8,3964
|
|
17
|
+
mgraph_ai_service_cache_client/client_contract/data/Service__Fast_API__Client__Data__Retrieve.py,sha256=YTTsssNEJZX3zlRVDpq5r8JE5sYBtlVz_gfCLodffzY,5166
|
|
18
|
+
mgraph_ai_service_cache_client/client_contract/data_store/Service__Fast_API__Client__Data__Store.py,sha256=vZD23PIS-EYWhROyNXt_eH8RAXZm2icsNn21sWVsq5w,9246
|
|
19
|
+
mgraph_ai_service_cache_client/client_contract/delete/Service__Fast_API__Client__File__Delete.py,sha256=64QH_lDUSLMqCPO5PM4X7lE1aUdxbLMwwRXgeYcuiwo,1166
|
|
20
|
+
mgraph_ai_service_cache_client/client_contract/exists/Service__Fast_API__Client__File__Exists.py,sha256=0LQ0FT98--Q9hJDi6WzCKXP2B9oMJgnEpSSyPMgXuKE,1185
|
|
21
|
+
mgraph_ai_service_cache_client/client_contract/info/Service__Fast_API__Client__Info.py,sha256=oK0DonONJhWiqtUdH54ETXqHf3v0Rt-k_BfpzirWDmw,3305
|
|
22
|
+
mgraph_ai_service_cache_client/client_contract/namespace/Service__Fast_API__Client__Namespace.py,sha256=RbYDhi7MpCPQj2JZS4VaJ4Rn-90sx4na9ZVpt5z-p_I,2477
|
|
23
|
+
mgraph_ai_service_cache_client/client_contract/retrieve/Service__Fast_API__Client__File__Retrieve.py,sha256=OjPNZ_i1d8iwqhWromodLxBknXee2gF9TLh1BKvOgLg,10010
|
|
24
|
+
mgraph_ai_service_cache_client/client_contract/server/Service__Fast_API__Client__Server.py,sha256=o6hD0utM9n48BLW0I1mVdGcCIyODywKm4dnTlfL6uXE,1797
|
|
25
|
+
mgraph_ai_service_cache_client/client_contract/store/Service__Fast_API__Client__File__Store.py,sha256=fDUYs_zXSlT6rbbVixmZj2PYQKpuvQKaQ7_oyrwlbY8,6725
|
|
26
|
+
mgraph_ai_service_cache_client/client_contract/zip/Service__Fast_API__Client__Zip.py,sha256=vDlvGIk_p0TIrDq0ElWN4r2ijD2oExWWTdrZawwKOdM,7456
|
|
8
27
|
mgraph_ai_service_cache_client/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
28
|
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Binary__Reference.py,sha256=7k4etDRNSXwOzf5KLYC9Ygo5vor8yx_fmc5sJCLF0Dk,1766
|
|
10
29
|
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Delete__Success.py,sha256=rFatFDk9lbR9Hqe1VQ4zkyleHPVsiKj2Io3TJmV-LXw,1395
|
|
11
|
-
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Exists__Response.py,sha256=
|
|
30
|
+
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Exists__Response.py,sha256=rLKF2a6RpDk7o2uKh_2bVuT2VpJ0cA53wjCOZSqZOeU,1405
|
|
12
31
|
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Metadata.py,sha256=2YIv0L9Yok2ygcejDLY3-M0DUSiSVfiq3w5iaR94Plw,2299
|
|
13
32
|
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Namespace__Stats.py,sha256=54AgnlwZEZM7yhr7exJpckoYKSrihhqa2_sGFVifgl0,1782
|
|
14
33
|
mgraph_ai_service_cache_client/schemas/cache/Schema__Cache__Namespaces__List.py,sha256=hVGvkBwp0IPje_KrYLzROgj0Yev7_0mxPpr5Sdz9Pwk,519
|
|
@@ -28,7 +47,7 @@ mgraph_ai_service_cache_client/schemas/cache/data/__init__.py,sha256=47DEQpj8HBS
|
|
|
28
47
|
mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__Data_Type.py,sha256=0j9tpRd5sRpKfUwikMC_phPTo2bxL9yznQj5_0r9O-k,127
|
|
29
48
|
mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__File_Type.py,sha256=tn5RRk7ahe9CTmFFXtpec82rhrSMlkav3RIbxBUEzZg,105
|
|
30
49
|
mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__Storage_Mode.py,sha256=1e5-7PNjuIVDznLnqmtbZIf3vttYti6ysYRPwDFW8hY,376
|
|
31
|
-
mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__Store__Strategy.py,sha256=
|
|
50
|
+
mgraph_ai_service_cache_client/schemas/cache/enums/Enum__Cache__Store__Strategy.py,sha256=CtGrMmldwMmLkoCI_Sq2PEadSELHTVVuNN-lJt9Yqog,328
|
|
32
51
|
mgraph_ai_service_cache_client/schemas/cache/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
52
|
mgraph_ai_service_cache_client/schemas/cache/file/Schema__Cache__File__Paths.py,sha256=8MuRXyOtcWMcJ1z9SFesB5-vgoACDxkEpgeeR3S5tFU,506
|
|
34
53
|
mgraph_ai_service_cache_client/schemas/cache/file/Schema__Cache__File__Refs.py,sha256=3k2tJPeHcK0dyoBs2HNev-dVAQG4fKPpxMFMff5WImQ,1901
|
|
@@ -54,28 +73,28 @@ mgraph_ai_service_cache_client/schemas/cache/zip/enums/__init__.py,sha256=47DEQp
|
|
|
54
73
|
mgraph_ai_service_cache_client/schemas/cache/zip/safe_str/Safe_Str__Cache__Zip__Operation__Message.py,sha256=-suUNhS4cDSG1yxo3xfIsyEspAi-aCAxe0w5zh9gHfE,186
|
|
55
74
|
mgraph_ai_service_cache_client/schemas/cache/zip/safe_str/Safe_Str__Cache__Zip__Operation__Pattern.py,sha256=f1eRRvKBfb2JWVTWKMZGdhDDh2Kp0XsGcUoYu05165I,183
|
|
56
75
|
mgraph_ai_service_cache_client/schemas/cache/zip/safe_str/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
+
mgraph_ai_service_cache_client/schemas/client/Cache__Client__Requests__Result.py,sha256=2G40_hgXF1a3qGMoy_iVNOFBngfITyujU5qhtwI39r0,1688
|
|
77
|
+
mgraph_ai_service_cache_client/schemas/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
+
mgraph_ai_service_cache_client/schemas/client/health_checks/Client__Check__Target_Server__Auth.py,sha256=Jb5Gg6qWouqMME2ykNpM2sDXu3AkaFgQL07BZceCnAg,219
|
|
79
|
+
mgraph_ai_service_cache_client/schemas/client/health_checks/Client__Check__Target_Server__Status.py,sha256=NPEzJeRXwIWFBX1O_AQ7Xfv-_B7rs7v_maeYtVPTKP0,578
|
|
80
|
+
mgraph_ai_service_cache_client/schemas/client_builder/Schema__Fast_API__Client__Server__Details.py,sha256=D_fRDqRkkNAEBJii3hK-BOunO0yPhuh7BE5-SreUfCE,487
|
|
81
|
+
mgraph_ai_service_cache_client/schemas/client_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
82
|
mgraph_ai_service_cache_client/schemas/consts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
83
|
mgraph_ai_service_cache_client/schemas/consts/const__Fast_API.py,sha256=XMS7VWZJ1gAspr7ZtTS0eIcGG96P6LFyxuqA7skTxfQ,890
|
|
59
84
|
mgraph_ai_service_cache_client/schemas/consts/const__Storage.py,sha256=hZMbog7F2273BuCkG3apFU7U1vuZylThmrUcXHapQG0,302
|
|
85
|
+
mgraph_ai_service_cache_client/schemas/consts/consts__Cache_Client.py,sha256=_Z6ZqVbbimENvzp3zD4ehsDZENNcu4b4Nko5E5rnmM4,301
|
|
60
86
|
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Base.py,sha256=KLxodtsKWXSgvIaoPoOPYLr8OvuTQjmGN4l7orHBqxE,1060
|
|
61
87
|
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Conflict.py,sha256=xAv0HfJ0Y6BhGsEPWgzRqulSSni5tBDGnGrQtXRmY68,950
|
|
62
|
-
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Gone.py,sha256=
|
|
88
|
+
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Gone.py,sha256=pj-aeVI_RGMKKY95GRngDKjU1aTL0qZa1N57JzyFcGs,1068
|
|
63
89
|
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Invalid_Input.py,sha256=cX2RT9yN7TrkOvitLRXbUauRC5ZROP89uIjM3Agw8-A,1035
|
|
64
|
-
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Not_Found.py,sha256=
|
|
90
|
+
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Not_Found.py,sha256=2wY3q8mmFgBroXVORK90l5TsqD5baTwlrpNBVRHyLPU,1087
|
|
65
91
|
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Service_Unavailable.py,sha256=702J_ax38PweqZb9LSpy5KjxhjbC7aalPcagpAIYtkY,823
|
|
66
92
|
mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Unsupported_Media_Type.py,sha256=DMtj63CGMG3UV2nCdcMx0ANDDspRAr8FaDpLDCuSPXU,1073
|
|
67
93
|
mgraph_ai_service_cache_client/schemas/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
mgraph_ai_service_cache_client/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
|
-
mgraph_ai_service_cache_client/service/info/Service_Info.py,sha256=lTTZcqJ2cKjmtc1nulNKk77A1xz3zQWUG7EQsfh0ApQ,1154
|
|
70
|
-
mgraph_ai_service_cache_client/service/info/schemas/Enum__Service_Environment.py,sha256=x4B6kDwncyklQaEFf0kAGyY5LE0r9Ch3ww_EZmBUDP8,129
|
|
71
|
-
mgraph_ai_service_cache_client/service/info/schemas/Enum__Service_Status.py,sha256=15PehXAEwdvlG-axvTF-p8XYWklscLPucH1Ki2UrwTQ,129
|
|
72
|
-
mgraph_ai_service_cache_client/service/info/schemas/Schema__Server__Versions.py,sha256=SGXNdZT_hrel-QV0AoNBsP4D42vGHgVNijiwb9RmZGw,1384
|
|
73
|
-
mgraph_ai_service_cache_client/service/info/schemas/Schema__Service__Status.py,sha256=jlmwi37c1m_aDnKG7VMFzjoNbeb9AZNX45nVNksROrk,1127
|
|
74
94
|
mgraph_ai_service_cache_client/utils/Version.py,sha256=-iKgWjUzrm9eGMdLFsvKPuxZFckmfNE5Y5bw6vSydhY,797
|
|
75
95
|
mgraph_ai_service_cache_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
-
mgraph_ai_service_cache_client/
|
|
77
|
-
mgraph_ai_service_cache_client/
|
|
78
|
-
mgraph_ai_service_cache_client-0.
|
|
79
|
-
mgraph_ai_service_cache_client-0.
|
|
80
|
-
mgraph_ai_service_cache_client-0.
|
|
81
|
-
mgraph_ai_service_cache_client-0.1.3.dist-info/RECORD,,
|
|
96
|
+
mgraph_ai_service_cache_client/version,sha256=-zFmPoQ9UG8sK7N1uxJbjpnoaSSC2QPn_c9arR9fcrI,7
|
|
97
|
+
mgraph_ai_service_cache_client-0.2.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
98
|
+
mgraph_ai_service_cache_client-0.2.0.dist-info/METADATA,sha256=NLZX0FmMfcce_xFsuG6-pyA4Fjf6dts1Jp4NTRqk_p4,9885
|
|
99
|
+
mgraph_ai_service_cache_client-0.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
100
|
+
mgraph_ai_service_cache_client-0.2.0.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
from mgraph_ai_service_cache_client import package_name
|
|
2
|
-
|
|
3
|
-
SERVICE_NAME = package_name
|
|
4
|
-
FAST_API__TITLE = "MGraph AI Service Cache Client"
|
|
5
|
-
FAST_API__DESCRIPTION = "Base template for MGraph-AI microservices"
|
|
6
|
-
LAMBDA_DEPENDENCIES__FAST_API_SERVERLESS = ['osbot-fast-api-serverless==v1.2.0']
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from osbot_fast_api_serverless.fast_api.Serverless__Fast_API import Serverless__Fast_API
|
|
2
|
-
from mgraph_ai_service_cache_client.fast_api.routes.Routes__Info import Routes__Info
|
|
3
|
-
from mgraph_ai_service_cache_client.utils.Version import version__mgraph_ai_service_cache_client
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Cache_Client__Fast_API(Serverless__Fast_API):
|
|
8
|
-
title = "ASd" # FAST_API__TITLE
|
|
9
|
-
version = version__mgraph_ai_service_cache_client
|
|
10
|
-
|
|
11
|
-
def setup_routes(self):
|
|
12
|
-
self.add_routes(Routes__Info )
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
if os.getenv('AWS_REGION'): # only execute if we are not running inside an AWS Lambda function
|
|
4
|
-
|
|
5
|
-
from osbot_aws.aws.lambda_.boto3__lambda import load_dependencies # using the lightweight file (which only has the boto3 calls required to load_dependencies)
|
|
6
|
-
LAMBDA_DEPENDENCIES = ['osbot-fast-api-serverless==v1.2.0']
|
|
7
|
-
|
|
8
|
-
load_dependencies(LAMBDA_DEPENDENCIES)
|
|
9
|
-
|
|
10
|
-
def clear_osbot_modules(): # todo: add this to load_dependencies method, since after it runs we don't need the osbot_aws.aws.lambda_.boto3__lambda
|
|
11
|
-
import sys
|
|
12
|
-
for module in list(sys.modules):
|
|
13
|
-
if module.startswith('osbot_aws'):
|
|
14
|
-
del sys.modules[module]
|
|
15
|
-
|
|
16
|
-
clear_osbot_modules()
|
|
17
|
-
|
|
18
|
-
from mgraph_ai_service_cache_client.fast_api.Cache_Client__Fast_API import Cache_Client__Fast_API
|
|
19
|
-
|
|
20
|
-
with Cache_Client__Fast_API() as _:
|
|
21
|
-
_.setup()
|
|
22
|
-
handler = _.handler()
|
|
23
|
-
app = _.app()
|
|
24
|
-
|
|
25
|
-
def run(event, context=None):
|
|
26
|
-
return handler(event, context)
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from osbot_fast_api.api.routes.Fast_API__Routes import Fast_API__Routes
|
|
2
|
-
from mgraph_ai_service_cache_client.service.info.Service_Info import Service_Info
|
|
3
|
-
|
|
4
|
-
TAG__ROUTES_INFO = 'info'
|
|
5
|
-
ROUTES_PATHS__INFO = [ f'/{TAG__ROUTES_INFO}/health' ,
|
|
6
|
-
f'/{TAG__ROUTES_INFO}/server' ,
|
|
7
|
-
f'/{TAG__ROUTES_INFO}/status' ,
|
|
8
|
-
f'/{TAG__ROUTES_INFO}/versions']
|
|
9
|
-
ROUTES_INFO__HEALTH__RETURN_VALUE = {'status': 'ok'}
|
|
10
|
-
|
|
11
|
-
class Routes__Info(Fast_API__Routes):
|
|
12
|
-
tag : str = 'info'
|
|
13
|
-
service_info: Service_Info
|
|
14
|
-
|
|
15
|
-
def health(self):
|
|
16
|
-
return ROUTES_INFO__HEALTH__RETURN_VALUE
|
|
17
|
-
|
|
18
|
-
def server(self): # Get service versions
|
|
19
|
-
return self.service_info.server_info()
|
|
20
|
-
|
|
21
|
-
def status(self): # Get service status information
|
|
22
|
-
return self.service_info.service_info()
|
|
23
|
-
|
|
24
|
-
def versions(self): # Get service versions
|
|
25
|
-
return self.service_info.versions()
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def setup_routes(self):
|
|
29
|
-
self.add_route_get(self.health )
|
|
30
|
-
self.add_route_get(self.server )
|
|
31
|
-
self.add_route_get(self.status )
|
|
32
|
-
self.add_route_get(self.versions)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from osbot_fast_api.utils.Fast_API__Server_Info import fast_api__server_info, Fast_API__Server_Info
|
|
2
|
-
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
3
|
-
from mgraph_ai_service_cache_client.service.info.schemas.Schema__Service__Status import Schema__Service__Status, Enum__Service_Environment
|
|
4
|
-
from mgraph_ai_service_cache_client.service.info.schemas.Schema__Server__Versions import Schema__Server__Versions
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Service_Info(Type_Safe):
|
|
8
|
-
|
|
9
|
-
def environment(self): # Determine current environment
|
|
10
|
-
import os
|
|
11
|
-
if os.getenv('AWS_REGION'):
|
|
12
|
-
return Enum__Service_Environment.aws_lambda
|
|
13
|
-
else:
|
|
14
|
-
return Enum__Service_Environment.local
|
|
15
|
-
|
|
16
|
-
def service_info(self) -> Schema__Service__Status: # Get current service status
|
|
17
|
-
return Schema__Service__Status(environment = self.environment())
|
|
18
|
-
|
|
19
|
-
def versions(self):
|
|
20
|
-
return Schema__Server__Versions()
|
|
21
|
-
|
|
22
|
-
def server_info(self) -> Fast_API__Server_Info:
|
|
23
|
-
return fast_api__server_info
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from osbot_utils.type_safe.Type_Safe import Type_Safe
|
|
2
|
-
from osbot_utils.type_safe.primitives.domains.common.safe_str.Safe_Str__Version import Safe_Str__Version
|
|
3
|
-
from osbot_utils.utils.Version import Version as Version__OSBot_Utils
|
|
4
|
-
from osbot_aws.utils.Version import Version as Version__OSBot_AWS
|
|
5
|
-
from osbot_fast_api.utils.Version import version__osbot_fast_api
|
|
6
|
-
from osbot_fast_api_serverless.utils.Version import version__osbot_fast_api_serverless
|
|
7
|
-
from mgraph_ai_service_cache_client.utils.Version import version__mgraph_ai_service_cache_client
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Schema__Server__Versions(Type_Safe):
|
|
11
|
-
mgraph_ai_service_cache_client : Safe_Str__Version = version__mgraph_ai_service_cache_client
|
|
12
|
-
osbot_utils : Safe_Str__Version = Safe_Str__Version(Version__OSBot_Utils().value() )
|
|
13
|
-
osbot_aws : Safe_Str__Version = Safe_Str__Version(Version__OSBot_AWS ().value() )
|
|
14
|
-
osbot_fast_api : Safe_Str__Version = Safe_Str__Version(version__osbot_fast_api )
|
|
15
|
-
osbot_fast_api_serverless : Safe_Str__Version = Safe_Str__Version(version__osbot_fast_api_serverless)
|