sift-stack-py 0.3.2__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 (291) hide show
  1. google/__init__.py +1 -0
  2. google/api/__init__.py +0 -0
  3. google/api/annotations_pb2.py +27 -0
  4. google/api/annotations_pb2.pyi +29 -0
  5. google/api/annotations_pb2_grpc.py +4 -0
  6. google/api/annotations_pb2_grpc.pyi +30 -0
  7. google/api/field_behavior_pb2.py +30 -0
  8. google/api/field_behavior_pb2.pyi +175 -0
  9. google/api/field_behavior_pb2_grpc.py +4 -0
  10. google/api/field_behavior_pb2_grpc.pyi +30 -0
  11. google/api/http_pb2.py +31 -0
  12. google/api/http_pb2.pyi +433 -0
  13. google/api/http_pb2_grpc.py +4 -0
  14. google/api/http_pb2_grpc.pyi +30 -0
  15. protoc_gen_openapiv2/__init__.py +0 -0
  16. protoc_gen_openapiv2/options/__init__.py +0 -0
  17. protoc_gen_openapiv2/options/annotations_pb2.py +27 -0
  18. protoc_gen_openapiv2/options/annotations_pb2.pyi +48 -0
  19. protoc_gen_openapiv2/options/annotations_pb2_grpc.py +4 -0
  20. protoc_gen_openapiv2/options/annotations_pb2_grpc.pyi +17 -0
  21. protoc_gen_openapiv2/options/openapiv2_pb2.py +132 -0
  22. protoc_gen_openapiv2/options/openapiv2_pb2.pyi +1533 -0
  23. protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py +4 -0
  24. protoc_gen_openapiv2/options/openapiv2_pb2_grpc.pyi +17 -0
  25. sift/__init__.py +0 -0
  26. sift/annotation_logs/__init__.py +0 -0
  27. sift/annotation_logs/v1/__init__.py +0 -0
  28. sift/annotation_logs/v1/annotation_logs_pb2.py +115 -0
  29. sift/annotation_logs/v1/annotation_logs_pb2.pyi +370 -0
  30. sift/annotation_logs/v1/annotation_logs_pb2_grpc.py +135 -0
  31. sift/annotation_logs/v1/annotation_logs_pb2_grpc.pyi +84 -0
  32. sift/annotations/__init__.py +0 -0
  33. sift/annotations/v1/__init__.py +0 -0
  34. sift/annotations/v1/annotations_pb2.py +180 -0
  35. sift/annotations/v1/annotations_pb2.pyi +539 -0
  36. sift/annotations/v1/annotations_pb2_grpc.py +237 -0
  37. sift/annotations/v1/annotations_pb2_grpc.pyi +144 -0
  38. sift/assets/__init__.py +0 -0
  39. sift/assets/v1/__init__.py +0 -0
  40. sift/assets/v1/assets_pb2.py +90 -0
  41. sift/assets/v1/assets_pb2.pyi +235 -0
  42. sift/assets/v1/assets_pb2_grpc.py +168 -0
  43. sift/assets/v1/assets_pb2_grpc.pyi +101 -0
  44. sift/calculated_channels/__init__.py +0 -0
  45. sift/calculated_channels/v1/__init__.py +0 -0
  46. sift/calculated_channels/v1/calculated_channels_pb2.py +99 -0
  47. sift/calculated_channels/v1/calculated_channels_pb2.pyi +280 -0
  48. sift/calculated_channels/v1/calculated_channels_pb2_grpc.py +101 -0
  49. sift/calculated_channels/v1/calculated_channels_pb2_grpc.pyi +64 -0
  50. sift/campaigns/__init__.py +0 -0
  51. sift/campaigns/v1/__init__.py +0 -0
  52. sift/campaigns/v1/campaigns_pb2.py +144 -0
  53. sift/campaigns/v1/campaigns_pb2.pyi +383 -0
  54. sift/campaigns/v1/campaigns_pb2_grpc.py +169 -0
  55. sift/campaigns/v1/campaigns_pb2_grpc.pyi +104 -0
  56. sift/channel_schemas/__init__.py +0 -0
  57. sift/channel_schemas/v1/__init__.py +0 -0
  58. sift/channel_schemas/v1/channel_schemas_pb2.py +69 -0
  59. sift/channel_schemas/v1/channel_schemas_pb2.pyi +117 -0
  60. sift/channel_schemas/v1/channel_schemas_pb2_grpc.py +101 -0
  61. sift/channel_schemas/v1/channel_schemas_pb2_grpc.pyi +64 -0
  62. sift/channels/__init__.py +0 -0
  63. sift/channels/v2/__init__.py +0 -0
  64. sift/channels/v2/channels_pb2.py +88 -0
  65. sift/channels/v2/channels_pb2.pyi +183 -0
  66. sift/channels/v2/channels_pb2_grpc.py +101 -0
  67. sift/channels/v2/channels_pb2_grpc.pyi +64 -0
  68. sift/common/__init__.py +0 -0
  69. sift/common/type/__init__.py +0 -0
  70. sift/common/type/v1/__init__.py +0 -0
  71. sift/common/type/v1/channel_bit_field_element_pb2.py +34 -0
  72. sift/common/type/v1/channel_bit_field_element_pb2.pyi +33 -0
  73. sift/common/type/v1/channel_bit_field_element_pb2_grpc.py +4 -0
  74. sift/common/type/v1/channel_bit_field_element_pb2_grpc.pyi +17 -0
  75. sift/common/type/v1/channel_data_type_pb2.py +29 -0
  76. sift/common/type/v1/channel_data_type_pb2.pyi +50 -0
  77. sift/common/type/v1/channel_data_type_pb2_grpc.py +4 -0
  78. sift/common/type/v1/channel_data_type_pb2_grpc.pyi +17 -0
  79. sift/common/type/v1/channel_enum_type_pb2.py +32 -0
  80. sift/common/type/v1/channel_enum_type_pb2.pyi +29 -0
  81. sift/common/type/v1/channel_enum_type_pb2_grpc.py +4 -0
  82. sift/common/type/v1/channel_enum_type_pb2_grpc.pyi +17 -0
  83. sift/common/type/v1/organization_pb2.py +27 -0
  84. sift/common/type/v1/organization_pb2.pyi +29 -0
  85. sift/common/type/v1/organization_pb2_grpc.py +4 -0
  86. sift/common/type/v1/organization_pb2_grpc.pyi +17 -0
  87. sift/common/type/v1/resource_identifier_pb2.py +46 -0
  88. sift/common/type/v1/resource_identifier_pb2.pyi +145 -0
  89. sift/common/type/v1/resource_identifier_pb2_grpc.py +4 -0
  90. sift/common/type/v1/resource_identifier_pb2_grpc.pyi +17 -0
  91. sift/common/type/v1/user_pb2.py +33 -0
  92. sift/common/type/v1/user_pb2.pyi +36 -0
  93. sift/common/type/v1/user_pb2_grpc.py +4 -0
  94. sift/common/type/v1/user_pb2_grpc.pyi +17 -0
  95. sift/data/__init__.py +0 -0
  96. sift/data/v1/__init__.py +0 -0
  97. sift/data/v1/data_pb2.py +212 -0
  98. sift/data/v1/data_pb2.pyi +745 -0
  99. sift/data/v1/data_pb2_grpc.py +67 -0
  100. sift/data/v1/data_pb2_grpc.pyi +44 -0
  101. sift/ingest/__init__.py +0 -0
  102. sift/ingest/v1/__init__.py +0 -0
  103. sift/ingest/v1/ingest_pb2.py +35 -0
  104. sift/ingest/v1/ingest_pb2.pyi +118 -0
  105. sift/ingest/v1/ingest_pb2_grpc.py +66 -0
  106. sift/ingest/v1/ingest_pb2_grpc.pyi +41 -0
  107. sift/ingestion_configs/__init__.py +0 -0
  108. sift/ingestion_configs/v1/__init__.py +0 -0
  109. sift/ingestion_configs/v1/ingestion_configs_pb2.py +115 -0
  110. sift/ingestion_configs/v1/ingestion_configs_pb2.pyi +332 -0
  111. sift/ingestion_configs/v1/ingestion_configs_pb2_grpc.py +203 -0
  112. sift/ingestion_configs/v1/ingestion_configs_pb2_grpc.pyi +124 -0
  113. sift/notifications/__init__.py +0 -0
  114. sift/notifications/v1/__init__.py +0 -0
  115. sift/notifications/v1/notifications_pb2.py +64 -0
  116. sift/notifications/v1/notifications_pb2.pyi +225 -0
  117. sift/notifications/v1/notifications_pb2_grpc.py +101 -0
  118. sift/notifications/v1/notifications_pb2_grpc.pyi +64 -0
  119. sift/ping/__init__.py +0 -0
  120. sift/ping/v1/__init__.py +0 -0
  121. sift/ping/v1/ping_pb2.py +38 -0
  122. sift/ping/v1/ping_pb2.pyi +36 -0
  123. sift/ping/v1/ping_pb2_grpc.py +66 -0
  124. sift/ping/v1/ping_pb2_grpc.pyi +41 -0
  125. sift/remote_files/__init__.py +0 -0
  126. sift/remote_files/v1/__init__.py +0 -0
  127. sift/remote_files/v1/remote_files_pb2.py +174 -0
  128. sift/remote_files/v1/remote_files_pb2.pyi +472 -0
  129. sift/remote_files/v1/remote_files_pb2_grpc.py +271 -0
  130. sift/remote_files/v1/remote_files_pb2_grpc.pyi +164 -0
  131. sift/report_templates/__init__.py +0 -0
  132. sift/report_templates/v1/__init__.py +0 -0
  133. sift/report_templates/v1/report_templates_pb2.py +146 -0
  134. sift/report_templates/v1/report_templates_pb2.pyi +381 -0
  135. sift/report_templates/v1/report_templates_pb2_grpc.py +169 -0
  136. sift/report_templates/v1/report_templates_pb2_grpc.pyi +104 -0
  137. sift/reports/__init__.py +0 -0
  138. sift/reports/v1/__init__.py +0 -0
  139. sift/reports/v1/reports_pb2.py +193 -0
  140. sift/reports/v1/reports_pb2.pyi +562 -0
  141. sift/reports/v1/reports_pb2_grpc.py +205 -0
  142. sift/reports/v1/reports_pb2_grpc.pyi +136 -0
  143. sift/rule_evaluation/__init__.py +0 -0
  144. sift/rule_evaluation/v1/__init__.py +0 -0
  145. sift/rule_evaluation/v1/rule_evaluation_pb2.py +89 -0
  146. sift/rule_evaluation/v1/rule_evaluation_pb2.pyi +263 -0
  147. sift/rule_evaluation/v1/rule_evaluation_pb2_grpc.py +101 -0
  148. sift/rule_evaluation/v1/rule_evaluation_pb2_grpc.pyi +64 -0
  149. sift/rules/__init__.py +0 -0
  150. sift/rules/v1/__init__.py +0 -0
  151. sift/rules/v1/rules_pb2.py +420 -0
  152. sift/rules/v1/rules_pb2.pyi +1355 -0
  153. sift/rules/v1/rules_pb2_grpc.py +577 -0
  154. sift/rules/v1/rules_pb2_grpc.pyi +351 -0
  155. sift/runs/__init__.py +0 -0
  156. sift/runs/v2/__init__.py +0 -0
  157. sift/runs/v2/runs_pb2.py +150 -0
  158. sift/runs/v2/runs_pb2.pyi +413 -0
  159. sift/runs/v2/runs_pb2_grpc.py +271 -0
  160. sift/runs/v2/runs_pb2_grpc.pyi +164 -0
  161. sift/saved_searches/__init__.py +0 -0
  162. sift/saved_searches/v1/__init__.py +0 -0
  163. sift/saved_searches/v1/saved_searches_pb2.py +144 -0
  164. sift/saved_searches/v1/saved_searches_pb2.pyi +385 -0
  165. sift/saved_searches/v1/saved_searches_pb2_grpc.py +237 -0
  166. sift/saved_searches/v1/saved_searches_pb2_grpc.pyi +144 -0
  167. sift/tags/__init__.py +0 -0
  168. sift/tags/v1/__init__.py +0 -0
  169. sift/tags/v1/tags_pb2.py +49 -0
  170. sift/tags/v1/tags_pb2.pyi +71 -0
  171. sift/tags/v1/tags_pb2_grpc.py +4 -0
  172. sift/tags/v1/tags_pb2_grpc.pyi +17 -0
  173. sift/users/__init__.py +0 -0
  174. sift/users/v2/__init__.py +0 -0
  175. sift/users/v2/users_pb2.py +61 -0
  176. sift/users/v2/users_pb2.pyi +142 -0
  177. sift/users/v2/users_pb2_grpc.py +135 -0
  178. sift/users/v2/users_pb2_grpc.pyi +84 -0
  179. sift/views/__init__.py +0 -0
  180. sift/views/v1/__init__.py +0 -0
  181. sift/views/v1/views_pb2.py +130 -0
  182. sift/views/v1/views_pb2.pyi +466 -0
  183. sift/views/v1/views_pb2_grpc.py +305 -0
  184. sift/views/v1/views_pb2_grpc.pyi +184 -0
  185. sift_grafana/py.typed +0 -0
  186. sift_grafana/sift_query_model.py +64 -0
  187. sift_py/__init__.py +923 -0
  188. sift_py/_internal/__init__.py +5 -0
  189. sift_py/_internal/cel.py +18 -0
  190. sift_py/_internal/channel.py +42 -0
  191. sift_py/_internal/convert/__init__.py +3 -0
  192. sift_py/_internal/convert/json.py +24 -0
  193. sift_py/_internal/convert/protobuf.py +34 -0
  194. sift_py/_internal/convert/timestamp.py +9 -0
  195. sift_py/_internal/test_util/__init__.py +0 -0
  196. sift_py/_internal/test_util/channel.py +136 -0
  197. sift_py/_internal/test_util/fn.py +14 -0
  198. sift_py/_internal/test_util/server_interceptor.py +62 -0
  199. sift_py/_internal/time.py +48 -0
  200. sift_py/_internal/user.py +39 -0
  201. sift_py/data/__init__.py +171 -0
  202. sift_py/data/_channel.py +38 -0
  203. sift_py/data/_deserialize.py +208 -0
  204. sift_py/data/_deserialize_test.py +134 -0
  205. sift_py/data/_service_test.py +276 -0
  206. sift_py/data/_validate.py +10 -0
  207. sift_py/data/error.py +5 -0
  208. sift_py/data/query.py +299 -0
  209. sift_py/data/service.py +497 -0
  210. sift_py/data_import/__init__.py +130 -0
  211. sift_py/data_import/_config.py +167 -0
  212. sift_py/data_import/_config_test.py +166 -0
  213. sift_py/data_import/_csv_test.py +395 -0
  214. sift_py/data_import/_status_test.py +176 -0
  215. sift_py/data_import/_tdms_test.py +238 -0
  216. sift_py/data_import/ch10.py +157 -0
  217. sift_py/data_import/config.py +19 -0
  218. sift_py/data_import/csv.py +259 -0
  219. sift_py/data_import/status.py +113 -0
  220. sift_py/data_import/tdms.py +206 -0
  221. sift_py/data_import/tempfile.py +30 -0
  222. sift_py/data_import/time_format.py +39 -0
  223. sift_py/error.py +11 -0
  224. sift_py/file_attachment/__init__.py +88 -0
  225. sift_py/file_attachment/_internal/__init__.py +0 -0
  226. sift_py/file_attachment/_internal/download.py +13 -0
  227. sift_py/file_attachment/_internal/upload.py +100 -0
  228. sift_py/file_attachment/_service_test.py +161 -0
  229. sift_py/file_attachment/entity.py +30 -0
  230. sift_py/file_attachment/metadata.py +107 -0
  231. sift_py/file_attachment/service.py +142 -0
  232. sift_py/grpc/__init__.py +15 -0
  233. sift_py/grpc/_async_interceptors/__init__.py +0 -0
  234. sift_py/grpc/_async_interceptors/base.py +72 -0
  235. sift_py/grpc/_async_interceptors/metadata.py +36 -0
  236. sift_py/grpc/_interceptors/__init__.py +0 -0
  237. sift_py/grpc/_interceptors/base.py +61 -0
  238. sift_py/grpc/_interceptors/context.py +25 -0
  239. sift_py/grpc/_interceptors/metadata.py +33 -0
  240. sift_py/grpc/_retry.py +70 -0
  241. sift_py/grpc/keepalive.py +34 -0
  242. sift_py/grpc/transport.py +250 -0
  243. sift_py/grpc/transport_test.py +170 -0
  244. sift_py/ingestion/__init__.py +6 -0
  245. sift_py/ingestion/_internal/__init__.py +6 -0
  246. sift_py/ingestion/_internal/channel.py +12 -0
  247. sift_py/ingestion/_internal/error.py +10 -0
  248. sift_py/ingestion/_internal/ingest.py +350 -0
  249. sift_py/ingestion/_internal/ingest_test.py +357 -0
  250. sift_py/ingestion/_internal/ingestion_config.py +130 -0
  251. sift_py/ingestion/_internal/run.py +46 -0
  252. sift_py/ingestion/_service_test.py +478 -0
  253. sift_py/ingestion/buffer.py +189 -0
  254. sift_py/ingestion/channel.py +422 -0
  255. sift_py/ingestion/config/__init__.py +3 -0
  256. sift_py/ingestion/config/telemetry.py +281 -0
  257. sift_py/ingestion/config/telemetry_test.py +405 -0
  258. sift_py/ingestion/config/yaml/__init__.py +0 -0
  259. sift_py/ingestion/config/yaml/error.py +44 -0
  260. sift_py/ingestion/config/yaml/load.py +126 -0
  261. sift_py/ingestion/config/yaml/spec.py +58 -0
  262. sift_py/ingestion/config/yaml/test_load.py +25 -0
  263. sift_py/ingestion/flow.py +73 -0
  264. sift_py/ingestion/manager.py +99 -0
  265. sift_py/ingestion/rule/__init__.py +4 -0
  266. sift_py/ingestion/rule/config.py +11 -0
  267. sift_py/ingestion/service.py +237 -0
  268. sift_py/py.typed +0 -0
  269. sift_py/report_templates/__init__.py +0 -0
  270. sift_py/report_templates/_config_test.py +34 -0
  271. sift_py/report_templates/_service_test.py +94 -0
  272. sift_py/report_templates/config.py +36 -0
  273. sift_py/report_templates/service.py +171 -0
  274. sift_py/rest.py +29 -0
  275. sift_py/rule/__init__.py +0 -0
  276. sift_py/rule/_config_test.py +109 -0
  277. sift_py/rule/_service_test.py +168 -0
  278. sift_py/rule/config.py +229 -0
  279. sift_py/rule/service.py +484 -0
  280. sift_py/yaml/__init__.py +0 -0
  281. sift_py/yaml/_channel_test.py +169 -0
  282. sift_py/yaml/_rule_test.py +207 -0
  283. sift_py/yaml/channel.py +224 -0
  284. sift_py/yaml/report_templates.py +73 -0
  285. sift_py/yaml/rule.py +321 -0
  286. sift_py/yaml/utils.py +15 -0
  287. sift_stack_py-0.3.2.dist-info/LICENSE +7 -0
  288. sift_stack_py-0.3.2.dist-info/METADATA +109 -0
  289. sift_stack_py-0.3.2.dist-info/RECORD +291 -0
  290. sift_stack_py-0.3.2.dist-info/WHEEL +5 -0
  291. sift_stack_py-0.3.2.dist-info/top_level.txt +5 -0
@@ -0,0 +1,305 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
5
+ from sift.views.v1 import views_pb2 as sift_dot_views_dot_v1_dot_views__pb2
6
+
7
+
8
+ class ViewServiceStub(object):
9
+ """Missing associated documentation comment in .proto file."""
10
+
11
+ def __init__(self, channel):
12
+ """Constructor.
13
+
14
+ Args:
15
+ channel: A grpc.Channel.
16
+ """
17
+ self.GetView = channel.unary_unary(
18
+ '/sift.views.v1.ViewService/GetView',
19
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.GetViewRequest.SerializeToString,
20
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.GetViewResponse.FromString,
21
+ )
22
+ self.CreateView = channel.unary_unary(
23
+ '/sift.views.v1.ViewService/CreateView',
24
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.CreateViewRequest.SerializeToString,
25
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.CreateViewResponse.FromString,
26
+ )
27
+ self.UpdateView = channel.unary_unary(
28
+ '/sift.views.v1.ViewService/UpdateView',
29
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.UpdateViewRequest.SerializeToString,
30
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.UpdateViewResponse.FromString,
31
+ )
32
+ self.ListViews = channel.unary_unary(
33
+ '/sift.views.v1.ViewService/ListViews',
34
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.ListViewsRequest.SerializeToString,
35
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.ListViewsResponse.FromString,
36
+ )
37
+ self.ListApplicableViews = channel.unary_unary(
38
+ '/sift.views.v1.ViewService/ListApplicableViews',
39
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsRequest.SerializeToString,
40
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsResponse.FromString,
41
+ )
42
+ self.DeleteView = channel.unary_unary(
43
+ '/sift.views.v1.ViewService/DeleteView',
44
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.DeleteViewRequest.SerializeToString,
45
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.DeleteViewResponse.FromString,
46
+ )
47
+ self.PinView = channel.unary_unary(
48
+ '/sift.views.v1.ViewService/PinView',
49
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.PinViewRequest.SerializeToString,
50
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.PinViewResponse.FromString,
51
+ )
52
+ self.UnpinView = channel.unary_unary(
53
+ '/sift.views.v1.ViewService/UnpinView',
54
+ request_serializer=sift_dot_views_dot_v1_dot_views__pb2.UnpinViewRequest.SerializeToString,
55
+ response_deserializer=sift_dot_views_dot_v1_dot_views__pb2.UnpinViewResponse.FromString,
56
+ )
57
+
58
+
59
+ class ViewServiceServicer(object):
60
+ """Missing associated documentation comment in .proto file."""
61
+
62
+ def GetView(self, request, context):
63
+ """Retrieves a view.
64
+ """
65
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
66
+ context.set_details('Method not implemented!')
67
+ raise NotImplementedError('Method not implemented!')
68
+
69
+ def CreateView(self, request, context):
70
+ """Creates a view.
71
+ """
72
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
73
+ context.set_details('Method not implemented!')
74
+ raise NotImplementedError('Method not implemented!')
75
+
76
+ def UpdateView(self, request, context):
77
+ """Updates an existing view using using the list of fields specified in `update_mask`.
78
+ """
79
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
80
+ context.set_details('Method not implemented!')
81
+ raise NotImplementedError('Method not implemented!')
82
+
83
+ def ListViews(self, request, context):
84
+ """Retrieves views using an optional filter.
85
+ """
86
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
87
+ context.set_details('Method not implemented!')
88
+ raise NotImplementedError('Method not implemented!')
89
+
90
+ def ListApplicableViews(self, request, context):
91
+ """Lists views that apply to assets/runs.
92
+ """
93
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
94
+ context.set_details('Method not implemented!')
95
+ raise NotImplementedError('Method not implemented!')
96
+
97
+ def DeleteView(self, request, context):
98
+ """Deletes a view.
99
+ """
100
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
101
+ context.set_details('Method not implemented!')
102
+ raise NotImplementedError('Method not implemented!')
103
+
104
+ def PinView(self, request, context):
105
+ """Pins a view.
106
+ """
107
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
108
+ context.set_details('Method not implemented!')
109
+ raise NotImplementedError('Method not implemented!')
110
+
111
+ def UnpinView(self, request, context):
112
+ """Unpins a view.
113
+ """
114
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
115
+ context.set_details('Method not implemented!')
116
+ raise NotImplementedError('Method not implemented!')
117
+
118
+
119
+ def add_ViewServiceServicer_to_server(servicer, server):
120
+ rpc_method_handlers = {
121
+ 'GetView': grpc.unary_unary_rpc_method_handler(
122
+ servicer.GetView,
123
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.GetViewRequest.FromString,
124
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.GetViewResponse.SerializeToString,
125
+ ),
126
+ 'CreateView': grpc.unary_unary_rpc_method_handler(
127
+ servicer.CreateView,
128
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.CreateViewRequest.FromString,
129
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.CreateViewResponse.SerializeToString,
130
+ ),
131
+ 'UpdateView': grpc.unary_unary_rpc_method_handler(
132
+ servicer.UpdateView,
133
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.UpdateViewRequest.FromString,
134
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.UpdateViewResponse.SerializeToString,
135
+ ),
136
+ 'ListViews': grpc.unary_unary_rpc_method_handler(
137
+ servicer.ListViews,
138
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.ListViewsRequest.FromString,
139
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.ListViewsResponse.SerializeToString,
140
+ ),
141
+ 'ListApplicableViews': grpc.unary_unary_rpc_method_handler(
142
+ servicer.ListApplicableViews,
143
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsRequest.FromString,
144
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsResponse.SerializeToString,
145
+ ),
146
+ 'DeleteView': grpc.unary_unary_rpc_method_handler(
147
+ servicer.DeleteView,
148
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.DeleteViewRequest.FromString,
149
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.DeleteViewResponse.SerializeToString,
150
+ ),
151
+ 'PinView': grpc.unary_unary_rpc_method_handler(
152
+ servicer.PinView,
153
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.PinViewRequest.FromString,
154
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.PinViewResponse.SerializeToString,
155
+ ),
156
+ 'UnpinView': grpc.unary_unary_rpc_method_handler(
157
+ servicer.UnpinView,
158
+ request_deserializer=sift_dot_views_dot_v1_dot_views__pb2.UnpinViewRequest.FromString,
159
+ response_serializer=sift_dot_views_dot_v1_dot_views__pb2.UnpinViewResponse.SerializeToString,
160
+ ),
161
+ }
162
+ generic_handler = grpc.method_handlers_generic_handler(
163
+ 'sift.views.v1.ViewService', rpc_method_handlers)
164
+ server.add_generic_rpc_handlers((generic_handler,))
165
+
166
+
167
+ # This class is part of an EXPERIMENTAL API.
168
+ class ViewService(object):
169
+ """Missing associated documentation comment in .proto file."""
170
+
171
+ @staticmethod
172
+ def GetView(request,
173
+ target,
174
+ options=(),
175
+ channel_credentials=None,
176
+ call_credentials=None,
177
+ insecure=False,
178
+ compression=None,
179
+ wait_for_ready=None,
180
+ timeout=None,
181
+ metadata=None):
182
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/GetView',
183
+ sift_dot_views_dot_v1_dot_views__pb2.GetViewRequest.SerializeToString,
184
+ sift_dot_views_dot_v1_dot_views__pb2.GetViewResponse.FromString,
185
+ options, channel_credentials,
186
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
187
+
188
+ @staticmethod
189
+ def CreateView(request,
190
+ target,
191
+ options=(),
192
+ channel_credentials=None,
193
+ call_credentials=None,
194
+ insecure=False,
195
+ compression=None,
196
+ wait_for_ready=None,
197
+ timeout=None,
198
+ metadata=None):
199
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/CreateView',
200
+ sift_dot_views_dot_v1_dot_views__pb2.CreateViewRequest.SerializeToString,
201
+ sift_dot_views_dot_v1_dot_views__pb2.CreateViewResponse.FromString,
202
+ options, channel_credentials,
203
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
204
+
205
+ @staticmethod
206
+ def UpdateView(request,
207
+ target,
208
+ options=(),
209
+ channel_credentials=None,
210
+ call_credentials=None,
211
+ insecure=False,
212
+ compression=None,
213
+ wait_for_ready=None,
214
+ timeout=None,
215
+ metadata=None):
216
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/UpdateView',
217
+ sift_dot_views_dot_v1_dot_views__pb2.UpdateViewRequest.SerializeToString,
218
+ sift_dot_views_dot_v1_dot_views__pb2.UpdateViewResponse.FromString,
219
+ options, channel_credentials,
220
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
221
+
222
+ @staticmethod
223
+ def ListViews(request,
224
+ target,
225
+ options=(),
226
+ channel_credentials=None,
227
+ call_credentials=None,
228
+ insecure=False,
229
+ compression=None,
230
+ wait_for_ready=None,
231
+ timeout=None,
232
+ metadata=None):
233
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/ListViews',
234
+ sift_dot_views_dot_v1_dot_views__pb2.ListViewsRequest.SerializeToString,
235
+ sift_dot_views_dot_v1_dot_views__pb2.ListViewsResponse.FromString,
236
+ options, channel_credentials,
237
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
238
+
239
+ @staticmethod
240
+ def ListApplicableViews(request,
241
+ target,
242
+ options=(),
243
+ channel_credentials=None,
244
+ call_credentials=None,
245
+ insecure=False,
246
+ compression=None,
247
+ wait_for_ready=None,
248
+ timeout=None,
249
+ metadata=None):
250
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/ListApplicableViews',
251
+ sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsRequest.SerializeToString,
252
+ sift_dot_views_dot_v1_dot_views__pb2.ListApplicableViewsResponse.FromString,
253
+ options, channel_credentials,
254
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
255
+
256
+ @staticmethod
257
+ def DeleteView(request,
258
+ target,
259
+ options=(),
260
+ channel_credentials=None,
261
+ call_credentials=None,
262
+ insecure=False,
263
+ compression=None,
264
+ wait_for_ready=None,
265
+ timeout=None,
266
+ metadata=None):
267
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/DeleteView',
268
+ sift_dot_views_dot_v1_dot_views__pb2.DeleteViewRequest.SerializeToString,
269
+ sift_dot_views_dot_v1_dot_views__pb2.DeleteViewResponse.FromString,
270
+ options, channel_credentials,
271
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
272
+
273
+ @staticmethod
274
+ def PinView(request,
275
+ target,
276
+ options=(),
277
+ channel_credentials=None,
278
+ call_credentials=None,
279
+ insecure=False,
280
+ compression=None,
281
+ wait_for_ready=None,
282
+ timeout=None,
283
+ metadata=None):
284
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/PinView',
285
+ sift_dot_views_dot_v1_dot_views__pb2.PinViewRequest.SerializeToString,
286
+ sift_dot_views_dot_v1_dot_views__pb2.PinViewResponse.FromString,
287
+ options, channel_credentials,
288
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
289
+
290
+ @staticmethod
291
+ def UnpinView(request,
292
+ target,
293
+ options=(),
294
+ channel_credentials=None,
295
+ call_credentials=None,
296
+ insecure=False,
297
+ compression=None,
298
+ wait_for_ready=None,
299
+ timeout=None,
300
+ metadata=None):
301
+ return grpc.experimental.unary_unary(request, target, '/sift.views.v1.ViewService/UnpinView',
302
+ sift_dot_views_dot_v1_dot_views__pb2.UnpinViewRequest.SerializeToString,
303
+ sift_dot_views_dot_v1_dot_views__pb2.UnpinViewResponse.FromString,
304
+ options, channel_credentials,
305
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -0,0 +1,184 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import abc
7
+ import collections.abc
8
+ import grpc
9
+ import grpc.aio
10
+ import sift.views.v1.views_pb2
11
+ import typing
12
+
13
+ _T = typing.TypeVar("_T")
14
+
15
+ class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
16
+
17
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
18
+ ...
19
+
20
+ class ViewServiceStub:
21
+ def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
22
+ GetView: grpc.UnaryUnaryMultiCallable[
23
+ sift.views.v1.views_pb2.GetViewRequest,
24
+ sift.views.v1.views_pb2.GetViewResponse,
25
+ ]
26
+ """Retrieves a view."""
27
+
28
+ CreateView: grpc.UnaryUnaryMultiCallable[
29
+ sift.views.v1.views_pb2.CreateViewRequest,
30
+ sift.views.v1.views_pb2.CreateViewResponse,
31
+ ]
32
+ """Creates a view."""
33
+
34
+ UpdateView: grpc.UnaryUnaryMultiCallable[
35
+ sift.views.v1.views_pb2.UpdateViewRequest,
36
+ sift.views.v1.views_pb2.UpdateViewResponse,
37
+ ]
38
+ """Updates an existing view using using the list of fields specified in `update_mask`."""
39
+
40
+ ListViews: grpc.UnaryUnaryMultiCallable[
41
+ sift.views.v1.views_pb2.ListViewsRequest,
42
+ sift.views.v1.views_pb2.ListViewsResponse,
43
+ ]
44
+ """Retrieves views using an optional filter."""
45
+
46
+ ListApplicableViews: grpc.UnaryUnaryMultiCallable[
47
+ sift.views.v1.views_pb2.ListApplicableViewsRequest,
48
+ sift.views.v1.views_pb2.ListApplicableViewsResponse,
49
+ ]
50
+ """Lists views that apply to assets/runs."""
51
+
52
+ DeleteView: grpc.UnaryUnaryMultiCallable[
53
+ sift.views.v1.views_pb2.DeleteViewRequest,
54
+ sift.views.v1.views_pb2.DeleteViewResponse,
55
+ ]
56
+ """Deletes a view."""
57
+
58
+ PinView: grpc.UnaryUnaryMultiCallable[
59
+ sift.views.v1.views_pb2.PinViewRequest,
60
+ sift.views.v1.views_pb2.PinViewResponse,
61
+ ]
62
+ """Pins a view."""
63
+
64
+ UnpinView: grpc.UnaryUnaryMultiCallable[
65
+ sift.views.v1.views_pb2.UnpinViewRequest,
66
+ sift.views.v1.views_pb2.UnpinViewResponse,
67
+ ]
68
+ """Unpins a view."""
69
+
70
+ class ViewServiceAsyncStub:
71
+ GetView: grpc.aio.UnaryUnaryMultiCallable[
72
+ sift.views.v1.views_pb2.GetViewRequest,
73
+ sift.views.v1.views_pb2.GetViewResponse,
74
+ ]
75
+ """Retrieves a view."""
76
+
77
+ CreateView: grpc.aio.UnaryUnaryMultiCallable[
78
+ sift.views.v1.views_pb2.CreateViewRequest,
79
+ sift.views.v1.views_pb2.CreateViewResponse,
80
+ ]
81
+ """Creates a view."""
82
+
83
+ UpdateView: grpc.aio.UnaryUnaryMultiCallable[
84
+ sift.views.v1.views_pb2.UpdateViewRequest,
85
+ sift.views.v1.views_pb2.UpdateViewResponse,
86
+ ]
87
+ """Updates an existing view using using the list of fields specified in `update_mask`."""
88
+
89
+ ListViews: grpc.aio.UnaryUnaryMultiCallable[
90
+ sift.views.v1.views_pb2.ListViewsRequest,
91
+ sift.views.v1.views_pb2.ListViewsResponse,
92
+ ]
93
+ """Retrieves views using an optional filter."""
94
+
95
+ ListApplicableViews: grpc.aio.UnaryUnaryMultiCallable[
96
+ sift.views.v1.views_pb2.ListApplicableViewsRequest,
97
+ sift.views.v1.views_pb2.ListApplicableViewsResponse,
98
+ ]
99
+ """Lists views that apply to assets/runs."""
100
+
101
+ DeleteView: grpc.aio.UnaryUnaryMultiCallable[
102
+ sift.views.v1.views_pb2.DeleteViewRequest,
103
+ sift.views.v1.views_pb2.DeleteViewResponse,
104
+ ]
105
+ """Deletes a view."""
106
+
107
+ PinView: grpc.aio.UnaryUnaryMultiCallable[
108
+ sift.views.v1.views_pb2.PinViewRequest,
109
+ sift.views.v1.views_pb2.PinViewResponse,
110
+ ]
111
+ """Pins a view."""
112
+
113
+ UnpinView: grpc.aio.UnaryUnaryMultiCallable[
114
+ sift.views.v1.views_pb2.UnpinViewRequest,
115
+ sift.views.v1.views_pb2.UnpinViewResponse,
116
+ ]
117
+ """Unpins a view."""
118
+
119
+ class ViewServiceServicer(metaclass=abc.ABCMeta):
120
+ @abc.abstractmethod
121
+ def GetView(
122
+ self,
123
+ request: sift.views.v1.views_pb2.GetViewRequest,
124
+ context: _ServicerContext,
125
+ ) -> typing.Union[sift.views.v1.views_pb2.GetViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.GetViewResponse]]:
126
+ """Retrieves a view."""
127
+
128
+ @abc.abstractmethod
129
+ def CreateView(
130
+ self,
131
+ request: sift.views.v1.views_pb2.CreateViewRequest,
132
+ context: _ServicerContext,
133
+ ) -> typing.Union[sift.views.v1.views_pb2.CreateViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.CreateViewResponse]]:
134
+ """Creates a view."""
135
+
136
+ @abc.abstractmethod
137
+ def UpdateView(
138
+ self,
139
+ request: sift.views.v1.views_pb2.UpdateViewRequest,
140
+ context: _ServicerContext,
141
+ ) -> typing.Union[sift.views.v1.views_pb2.UpdateViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.UpdateViewResponse]]:
142
+ """Updates an existing view using using the list of fields specified in `update_mask`."""
143
+
144
+ @abc.abstractmethod
145
+ def ListViews(
146
+ self,
147
+ request: sift.views.v1.views_pb2.ListViewsRequest,
148
+ context: _ServicerContext,
149
+ ) -> typing.Union[sift.views.v1.views_pb2.ListViewsResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.ListViewsResponse]]:
150
+ """Retrieves views using an optional filter."""
151
+
152
+ @abc.abstractmethod
153
+ def ListApplicableViews(
154
+ self,
155
+ request: sift.views.v1.views_pb2.ListApplicableViewsRequest,
156
+ context: _ServicerContext,
157
+ ) -> typing.Union[sift.views.v1.views_pb2.ListApplicableViewsResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.ListApplicableViewsResponse]]:
158
+ """Lists views that apply to assets/runs."""
159
+
160
+ @abc.abstractmethod
161
+ def DeleteView(
162
+ self,
163
+ request: sift.views.v1.views_pb2.DeleteViewRequest,
164
+ context: _ServicerContext,
165
+ ) -> typing.Union[sift.views.v1.views_pb2.DeleteViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.DeleteViewResponse]]:
166
+ """Deletes a view."""
167
+
168
+ @abc.abstractmethod
169
+ def PinView(
170
+ self,
171
+ request: sift.views.v1.views_pb2.PinViewRequest,
172
+ context: _ServicerContext,
173
+ ) -> typing.Union[sift.views.v1.views_pb2.PinViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.PinViewResponse]]:
174
+ """Pins a view."""
175
+
176
+ @abc.abstractmethod
177
+ def UnpinView(
178
+ self,
179
+ request: sift.views.v1.views_pb2.UnpinViewRequest,
180
+ context: _ServicerContext,
181
+ ) -> typing.Union[sift.views.v1.views_pb2.UnpinViewResponse, collections.abc.Awaitable[sift.views.v1.views_pb2.UnpinViewResponse]]:
182
+ """Unpins a view."""
183
+
184
+ def add_ViewServiceServicer_to_server(servicer: ViewServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
sift_grafana/py.typed ADDED
File without changes
@@ -0,0 +1,64 @@
1
+ from typing import List, Optional
2
+
3
+ from pydantic import BaseModel, Field, model_validator
4
+ from typing_extensions import Self
5
+
6
+ """
7
+ These are the models that are used to validate the input data for the Sift Grafana Plugin queries
8
+ """
9
+
10
+
11
+ class Channel(BaseModel):
12
+ channelId: Optional[str] = None # noqa: N815
13
+ channelIdentifier: Optional[str] = None # noqa: N815
14
+
15
+ @model_validator(mode="after")
16
+ def check_passwords_match(self) -> Self:
17
+ channel_id = self.channelId
18
+ channel_identifier = self.channelIdentifier
19
+ if channel_id is None and channel_identifier is None:
20
+ raise ValueError("channelId or channelIdentifier must be provided")
21
+ return self
22
+
23
+
24
+ class Asset(BaseModel):
25
+ assetId: Optional[str] = None # noqa: N815
26
+ assetName: Optional[str] = None # noqa: N815
27
+
28
+ @model_validator(mode="after")
29
+ def check_passwords_match(self) -> Self:
30
+ asset_id = self.assetId
31
+ asset_name = self.assetName
32
+ if asset_id is None and asset_name is None:
33
+ raise ValueError("assetId or assetName must be provided")
34
+ return self
35
+
36
+
37
+ class ChannelReference(Channel):
38
+ # Enforce format "${number}"
39
+ channelReference: str = Field(..., pattern=r"^\$\d+$") # noqa: N815
40
+
41
+
42
+ class AssetChannelQuery(Asset, Channel):
43
+ pass
44
+
45
+
46
+ class CalculatedChannelQuery(BaseModel):
47
+ name: str
48
+ asset: Asset
49
+ channelReferences: List[ChannelReference] # noqa: N815
50
+ expression: str
51
+
52
+
53
+ class SiftQuery(BaseModel):
54
+ queries: List[AssetChannelQuery]
55
+ calculatedChannelQuery: Optional[CalculatedChannelQuery] = None # noqa: N815
56
+ groupByRun: bool # noqa: N815
57
+
58
+ @model_validator(mode="after")
59
+ def check_passwords_match(self) -> Self:
60
+ queries = self.queries
61
+ calculated_channel_query = self.calculatedChannelQuery
62
+ if len(queries) > 0 and calculated_channel_query is not None:
63
+ raise ValueError("queries and calculatedChannelQuery cannot both be provided")
64
+ return self