qwak-core 0.6.6__py3-none-any.whl → 0.6.7__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.
Files changed (23) hide show
  1. _qwak_proto/qwak/administration/cluster/v2/cluster_service_pb2.py +52 -0
  2. _qwak_proto/qwak/administration/cluster/v2/cluster_service_pb2.pyi +198 -0
  3. _qwak_proto/qwak/administration/cluster/v2/cluster_service_pb2_grpc.py +237 -0
  4. _qwak_proto/qwak/administration/v1/environments/environment_pb2.py +29 -0
  5. _qwak_proto/qwak/administration/v1/environments/environment_pb2.pyi +38 -0
  6. _qwak_proto/qwak/administration/v1/environments/environment_pb2_grpc.py +4 -0
  7. _qwak_proto/qwak/administration/v1/environments/environment_service_pb2.py +33 -0
  8. _qwak_proto/qwak/administration/v1/environments/environment_service_pb2.pyi +59 -0
  9. _qwak_proto/qwak/administration/v1/environments/environment_service_pb2_grpc.py +67 -0
  10. qwak/__init__.py +1 -1
  11. qwak/clients/administration/cluster_v2/__init__.py +1 -0
  12. qwak/clients/administration/cluster_v2/client.py +122 -0
  13. qwak/clients/administration/environment/client.py +28 -0
  14. qwak/clients/administration/environment_v1/__init__.py +1 -0
  15. qwak/clients/administration/environment_v1/client.py +53 -0
  16. {qwak_core-0.6.6.dist-info → qwak_core-0.6.7.dist-info}/METADATA +1 -1
  17. {qwak_core-0.6.6.dist-info → qwak_core-0.6.7.dist-info}/RECORD +23 -7
  18. qwak_services_mock/mocks/cluster_v2_service.py +146 -0
  19. qwak_services_mock/mocks/environment_v0_service.py +175 -0
  20. qwak_services_mock/mocks/environment_v1_service.py +37 -0
  21. qwak_services_mock/mocks/qwak_mocks.py +6 -0
  22. qwak_services_mock/services_mock.py +38 -1
  23. {qwak_core-0.6.6.dist-info → qwak_core-0.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,175 @@
1
+ from typing import Optional
2
+
3
+ import grpc
4
+
5
+ from _qwak_proto.qwak.administration.v0.environments.environment_pb2 import (
6
+ QwakEnvironment,
7
+ )
8
+ from _qwak_proto.qwak.administration.v0.environments.environment_service_pb2 import (
9
+ CreateEnvironmentResponse,
10
+ GetEnvironmentApplicationUserCredentialsResponse,
11
+ GetEnvironmentResponse,
12
+ ListEnvironmentsResponse,
13
+ SetEnvironmentApplicationUserCredentialsResponse,
14
+ UpdateEnvironmentConfigurationResponse,
15
+ UpdateEnvironmentPersonalizationResponse,
16
+ )
17
+ from _qwak_proto.qwak.administration.v0.environments.environment_service_pb2_grpc import (
18
+ EnvironmentServiceServicer,
19
+ )
20
+
21
+
22
+ class EnvironmentV0ServiceMock(EnvironmentServiceServicer):
23
+ def __init__(self):
24
+ super().__init__()
25
+ self.__create_environment_response: Optional[CreateEnvironmentResponse] = None
26
+ self.__create_environment_error: Optional[grpc.StatusCode] = None
27
+
28
+ self.__get_environment_response: Optional[GetEnvironmentResponse] = None
29
+ self.__get_environment_error: Optional[grpc.StatusCode] = None
30
+
31
+ self.__update_environment_configuration_response: Optional[
32
+ UpdateEnvironmentConfigurationResponse
33
+ ] = None
34
+ self.__update_environment_configuration_error: Optional[grpc.StatusCode] = None
35
+
36
+ self.__update_environment_personalization_response: Optional[
37
+ UpdateEnvironmentPersonalizationResponse
38
+ ] = None
39
+ self.__update_environment_personalization_error: Optional[grpc.StatusCode] = (
40
+ None
41
+ )
42
+
43
+ self.__list_environments_response: Optional[ListEnvironmentsResponse] = None
44
+ self.__list_environments_error: Optional[grpc.StatusCode] = None
45
+
46
+ self.__get_credentials_response: Optional[
47
+ GetEnvironmentApplicationUserCredentialsResponse
48
+ ] = None
49
+ self.__get_credentials_error: Optional[grpc.StatusCode] = None
50
+
51
+ self.__set_credentials_response: Optional[
52
+ SetEnvironmentApplicationUserCredentialsResponse
53
+ ] = None
54
+ self.__set_credentials_error: Optional[grpc.StatusCode] = None
55
+
56
+ def given_create_environment(
57
+ self,
58
+ response: Optional[CreateEnvironmentResponse] = None,
59
+ error_code: Optional[grpc.StatusCode] = None,
60
+ ):
61
+ self.__create_environment_response = response
62
+ self.__create_environment_error = error_code
63
+
64
+ def given_get_environment(
65
+ self,
66
+ response: Optional[GetEnvironmentResponse] = None,
67
+ error_code: Optional[grpc.StatusCode] = None,
68
+ ):
69
+ self.__get_environment_response = response
70
+ self.__get_environment_error = error_code
71
+
72
+ def given_update_environment_configuration(
73
+ self,
74
+ response: Optional[UpdateEnvironmentConfigurationResponse] = None,
75
+ error_code: Optional[grpc.StatusCode] = None,
76
+ ):
77
+ self.__update_environment_configuration_response = response
78
+ self.__update_environment_configuration_error = error_code
79
+
80
+ def given_update_environment_personalization(
81
+ self,
82
+ response: Optional[UpdateEnvironmentPersonalizationResponse] = None,
83
+ error_code: Optional[grpc.StatusCode] = None,
84
+ ):
85
+ self.__update_environment_personalization_response = response
86
+ self.__update_environment_personalization_error = error_code
87
+
88
+ def given_list_environments(
89
+ self,
90
+ response: Optional[ListEnvironmentsResponse] = None,
91
+ error_code: Optional[grpc.StatusCode] = None,
92
+ ):
93
+ self.__list_environments_response = response
94
+ self.__list_environments_error = error_code
95
+
96
+ def given_get_credentials(
97
+ self,
98
+ response: Optional[GetEnvironmentApplicationUserCredentialsResponse] = None,
99
+ error_code: Optional[grpc.StatusCode] = None,
100
+ ):
101
+ self.__get_credentials_response = response
102
+ self.__get_credentials_error = error_code
103
+
104
+ def given_set_credentials(
105
+ self,
106
+ response: Optional[SetEnvironmentApplicationUserCredentialsResponse] = None,
107
+ error_code: Optional[grpc.StatusCode] = None,
108
+ ):
109
+ self.__set_credentials_response = response
110
+ self.__set_credentials_error = error_code
111
+
112
+ def CreateEnvironment(self, request, context):
113
+ if self.__create_environment_error:
114
+ context.set_code(self.__create_environment_error)
115
+ context.set_details("Failed to create environment")
116
+ return CreateEnvironmentResponse()
117
+ if self.__create_environment_response:
118
+ return self.__create_environment_response
119
+ return CreateEnvironmentResponse(environment=QwakEnvironment(id="mock-env-id"))
120
+
121
+ def GetEnvironment(self, request, context):
122
+ if self.__get_environment_error:
123
+ context.set_code(self.__get_environment_error)
124
+ context.set_details("Failed to get environment")
125
+ return GetEnvironmentResponse()
126
+ if self.__get_environment_response:
127
+ return self.__get_environment_response
128
+ return GetEnvironmentResponse(
129
+ environment=QwakEnvironment(id=request.environment_id)
130
+ )
131
+
132
+ def UpdateEnvironmentConfiguration(self, request, context):
133
+ if self.__update_environment_configuration_error:
134
+ context.set_code(self.__update_environment_configuration_error)
135
+ context.set_details("Failed to update environment configuration")
136
+ return UpdateEnvironmentConfigurationResponse()
137
+ if self.__update_environment_configuration_response:
138
+ return self.__update_environment_configuration_response
139
+ return UpdateEnvironmentConfigurationResponse()
140
+
141
+ def UpdateEnvironmentPersonalization(self, request, context):
142
+ if self.__update_environment_personalization_error:
143
+ context.set_code(self.__update_environment_personalization_error)
144
+ context.set_details("Failed to update environment personalization")
145
+ return UpdateEnvironmentPersonalizationResponse()
146
+ if self.__update_environment_personalization_response:
147
+ return self.__update_environment_personalization_response
148
+ return UpdateEnvironmentPersonalizationResponse()
149
+
150
+ def ListEnvironments(self, request, context):
151
+ if self.__list_environments_error:
152
+ context.set_code(self.__list_environments_error)
153
+ context.set_details("Failed to list environments")
154
+ return ListEnvironmentsResponse()
155
+ if self.__list_environments_response:
156
+ return self.__list_environments_response
157
+ return ListEnvironmentsResponse()
158
+
159
+ def GetEnvironmentApplicationUserCredentials(self, request, context):
160
+ if self.__get_credentials_error:
161
+ context.set_code(self.__get_credentials_error)
162
+ context.set_details("Failed to get credentials")
163
+ return GetEnvironmentApplicationUserCredentialsResponse()
164
+ if self.__get_credentials_response:
165
+ return self.__get_credentials_response
166
+ return GetEnvironmentApplicationUserCredentialsResponse()
167
+
168
+ def SetEnvironmentApplicationUserCredentials(self, request, context):
169
+ if self.__set_credentials_error:
170
+ context.set_code(self.__set_credentials_error)
171
+ context.set_details("Failed to set credentials")
172
+ return SetEnvironmentApplicationUserCredentialsResponse()
173
+ if self.__set_credentials_response:
174
+ return self.__set_credentials_response
175
+ return SetEnvironmentApplicationUserCredentialsResponse()
@@ -0,0 +1,37 @@
1
+ from typing import Optional
2
+
3
+ import grpc
4
+
5
+ from _qwak_proto.qwak.administration.v0.environments.environment_pb2 import (
6
+ QwakEnvironment,
7
+ )
8
+ from _qwak_proto.qwak.administration.v1.environments.environment_service_pb2 import (
9
+ CreateEnvironmentResponse,
10
+ )
11
+ from _qwak_proto.qwak.administration.v1.environments.environment_service_pb2_grpc import (
12
+ EnvironmentServiceServicer,
13
+ )
14
+
15
+
16
+ class EnvironmentV1ServiceMock(EnvironmentServiceServicer):
17
+ def __init__(self):
18
+ super().__init__()
19
+ self.__create_environment_response: Optional[CreateEnvironmentResponse] = None
20
+ self.__create_environment_error: Optional[grpc.StatusCode] = None
21
+
22
+ def given_create_environment(
23
+ self,
24
+ response: Optional[CreateEnvironmentResponse] = None,
25
+ error_code: Optional[grpc.StatusCode] = None,
26
+ ):
27
+ self.__create_environment_response = response
28
+ self.__create_environment_error = error_code
29
+
30
+ def CreateEnvironment(self, request, context):
31
+ if self.__create_environment_error:
32
+ context.set_code(self.__create_environment_error)
33
+ context.set_details("Failed to create environment")
34
+ return CreateEnvironmentResponse()
35
+ if self.__create_environment_response:
36
+ return self.__create_environment_response
37
+ return CreateEnvironmentResponse(environment=QwakEnvironment(id="mock-env-id"))
@@ -24,11 +24,14 @@ from qwak_services_mock.mocks.build_orchestrator_build_settings_api import (
24
24
  from qwak_services_mock.mocks.build_orchestrator_service_api import (
25
25
  BuildOrchestratorServiceApiMock,
26
26
  )
27
+ from qwak_services_mock.mocks.cluster_v2_service import ClusterV2ServiceMock
27
28
  from qwak_services_mock.mocks.data_versioning_service import DataVersioningServiceMock
28
29
  from qwak_services_mock.mocks.deployment_management_service import (
29
30
  DeploymentManagementServiceMock,
30
31
  )
31
32
  from qwak_services_mock.mocks.ecosystem_service_api import EcoSystemServiceMock
33
+ from qwak_services_mock.mocks.environment_v0_service import EnvironmentV0ServiceMock
34
+ from qwak_services_mock.mocks.environment_v1_service import EnvironmentV1ServiceMock
32
35
  from qwak_services_mock.mocks.execution_management_service import (
33
36
  ExecutionManagementServiceMock,
34
37
  )
@@ -123,3 +126,6 @@ class QwakMocks:
123
126
  integration_management_service: IntegrationManagementServiceMock
124
127
  prompt_manager_service: PromptManagerServiceMock
125
128
  location_discovery_service: LocationDiscoveryServiceApiMock
129
+ cluster_v2_service_mock: ClusterV2ServiceMock
130
+ environment_v0_service_mock: EnvironmentV0ServiceMock
131
+ environment_v1_service_mock: EnvironmentV1ServiceMock
@@ -4,9 +4,18 @@ from typing import Any, Generator, List, Tuple
4
4
  import grpc
5
5
  import pytest
6
6
 
7
+ from _qwak_proto.qwak.administration.cluster.v2.cluster_service_pb2_grpc import (
8
+ add_ClusterServiceServicer_to_server,
9
+ )
7
10
  from _qwak_proto.qwak.administration.v0.authentication.authentication_service_pb2_grpc import (
8
11
  add_AuthenticationServiceServicer_to_server,
9
12
  )
13
+ from _qwak_proto.qwak.administration.v0.environments.environment_service_pb2_grpc import (
14
+ add_EnvironmentServiceServicer_to_server as add_EnvironmentV0ServiceServicer_to_server,
15
+ )
16
+ from _qwak_proto.qwak.administration.v1.environments.environment_service_pb2_grpc import (
17
+ add_EnvironmentServiceServicer_to_server as add_EnvironmentV1ServiceServicer_to_server,
18
+ )
10
19
  from _qwak_proto.qwak.admiral.secret.v0.system_secret_service_pb2_grpc import (
11
20
  add_SystemSecretServiceServicer_to_server,
12
21
  )
@@ -140,11 +149,14 @@ from qwak_services_mock.mocks.build_orchestrator_build_settings_api import (
140
149
  from qwak_services_mock.mocks.build_orchestrator_service_api import (
141
150
  BuildOrchestratorServiceApiMock,
142
151
  )
152
+ from qwak_services_mock.mocks.cluster_v2_service import ClusterV2ServiceMock
143
153
  from qwak_services_mock.mocks.data_versioning_service import DataVersioningServiceMock
144
154
  from qwak_services_mock.mocks.deployment_management_service import (
145
155
  DeploymentManagementServiceMock,
146
156
  )
147
157
  from qwak_services_mock.mocks.ecosystem_service_api import EcoSystemServiceMock
158
+ from qwak_services_mock.mocks.environment_v0_service import EnvironmentV0ServiceMock
159
+ from qwak_services_mock.mocks.environment_v1_service import EnvironmentV1ServiceMock
148
160
  from qwak_services_mock.mocks.execution_management_service import (
149
161
  ExecutionManagementServiceMock,
150
162
  )
@@ -246,7 +258,14 @@ def qwak_container():
246
258
  vector_store,
247
259
  workspace_manager,
248
260
  )
249
- from qwak.clients.administration import authentication, eco_system, self_service
261
+ from qwak.clients.administration import (
262
+ authentication,
263
+ cluster_v2,
264
+ eco_system,
265
+ environment,
266
+ environment_v1,
267
+ self_service,
268
+ )
250
269
  from qwak.clients.integration_management import integration_manager_client
251
270
  from qwak.clients.prompt_manager import prompt_manager_client
252
271
  from qwak.clients.system_secret import system_secret_client
@@ -262,8 +281,11 @@ def qwak_container():
262
281
  analytics,
263
282
  batch_job_management,
264
283
  build_orchestrator,
284
+ cluster_v2,
265
285
  data_versioning,
266
286
  deployment,
287
+ environment,
288
+ environment_v1,
267
289
  instance_template,
268
290
  feature_store,
269
291
  file_versioning,
@@ -495,6 +517,21 @@ def attach_servicers(free_port, server):
495
517
  LocationDiscoveryServiceApiMock,
496
518
  add_LocationDiscoveryServiceServicer_to_server,
497
519
  ),
520
+ (
521
+ "cluster_v2_service_mock",
522
+ ClusterV2ServiceMock,
523
+ add_ClusterServiceServicer_to_server,
524
+ ),
525
+ (
526
+ "environment_v0_service_mock",
527
+ EnvironmentV0ServiceMock,
528
+ add_EnvironmentV0ServiceServicer_to_server,
529
+ ),
530
+ (
531
+ "environment_v1_service_mock",
532
+ EnvironmentV1ServiceMock,
533
+ add_EnvironmentV1ServiceServicer_to_server,
534
+ ),
498
535
  ("port", free_port, None),
499
536
  ],
500
537
  )