metal-stack-api 0.0.15__py3-none-any.whl → 0.0.17__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 (32) hide show
  1. {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.17.dist-info}/METADATA +1 -1
  2. {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.17.dist-info}/RECORD +32 -32
  3. metalstack/admin/v2/filesystem_connecpy.py +195 -160
  4. metalstack/admin/v2/image_connecpy.py +241 -197
  5. metalstack/admin/v2/ip_connecpy.py +144 -118
  6. metalstack/admin/v2/machine_connecpy.py +144 -118
  7. metalstack/admin/v2/network_connecpy.py +291 -238
  8. metalstack/admin/v2/partition_connecpy.py +241 -197
  9. metalstack/admin/v2/size_connecpy.py +195 -160
  10. metalstack/admin/v2/tenant_connecpy.py +144 -118
  11. metalstack/admin/v2/token_connecpy.py +144 -118
  12. metalstack/api/v2/filesystem_connecpy.py +195 -216
  13. metalstack/api/v2/filesystem_pb2.py +47 -47
  14. metalstack/api/v2/filesystem_pb2.pyi +10 -2
  15. metalstack/api/v2/filesystem_pb2_grpc.py +0 -44
  16. metalstack/api/v2/health_connecpy.py +93 -76
  17. metalstack/api/v2/image_connecpy.py +195 -160
  18. metalstack/api/v2/ip_connecpy.py +291 -238
  19. metalstack/api/v2/machine_connecpy.py +291 -238
  20. metalstack/api/v2/method_connecpy.py +144 -118
  21. metalstack/api/v2/network_connecpy.py +341 -279
  22. metalstack/api/v2/partition_connecpy.py +144 -118
  23. metalstack/api/v2/project_connecpy.py +654 -538
  24. metalstack/api/v2/size_connecpy.py +144 -118
  25. metalstack/api/v2/tenant_connecpy.py +654 -538
  26. metalstack/api/v2/token_connecpy.py +341 -279
  27. metalstack/api/v2/user_connecpy.py +93 -76
  28. metalstack/api/v2/version_connecpy.py +93 -76
  29. metalstack/infra/v2/bmc_connecpy.py +93 -76
  30. metalstack/infra/v2/switch_connecpy.py +93 -76
  31. {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.17.dist-info}/WHEEL +0 -0
  32. {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.17.dist-info}/top_level.txt +0 -0
@@ -1,102 +1,119 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT!
2
+ # Generated by https://github.com/i2y/connecpy/v2/protoc-gen-connecpy. DO NOT EDIT!
3
3
  # source: metalstack/infra/v2/switch.proto
4
4
 
5
- from typing import Optional, Protocol, Union
5
+ from collections.abc import AsyncIterator, Iterable, Iterator, Mapping
6
+ from typing import Protocol
6
7
 
7
- import httpx
8
-
9
- from connecpy.async_client import AsyncConnecpyClient
10
- from connecpy.base import Endpoint
11
- from connecpy.server import ConnecpyServer
12
- from connecpy.client import ConnecpyClient
13
- from connecpy.context import ClientContext, ServiceContext
8
+ from connecpy.client import ConnecpyClient, ConnecpyClientSync
9
+ from connecpy.code import Code
10
+ from connecpy.exceptions import ConnecpyException
11
+ from connecpy.interceptor import Interceptor, InterceptorSync
12
+ from connecpy.method import IdempotencyLevel, MethodInfo
13
+ from connecpy.request import Headers, RequestContext
14
+ from connecpy.server import ConnecpyASGIApplication, ConnecpyWSGIApplication, Endpoint, EndpointSync
14
15
  import metalstack.infra.v2.switch_pb2 as metalstack_dot_infra_dot_v2_dot_switch__pb2
15
16
 
16
17
 
17
18
  class SwitchService(Protocol):
18
- async def Register(self, req: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: ...
19
-
20
-
21
- class SwitchServiceServer(ConnecpyServer):
22
- def __init__(self, *, service: SwitchService, server_path_prefix=""):
23
- super().__init__()
24
- self._prefix = f"{server_path_prefix}/metalstack.infra.v2.SwitchService"
25
- self._endpoints = {
26
- "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse](
27
- service_name="SwitchService",
28
- name="Register",
29
- function=getattr(service, "Register"),
30
- input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
31
- output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
32
- allowed_methods=("POST",),
33
- ),
34
- }
35
-
36
- def serviceName(self):
37
- return "metalstack.infra.v2.SwitchService"
38
-
39
-
40
- class SwitchServiceSync(Protocol):
41
- def Register(self, req: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: ...
42
-
43
-
44
- class SwitchServiceServerSync(ConnecpyServer):
45
- def __init__(self, *, service: SwitchServiceSync, server_path_prefix=""):
46
- super().__init__()
47
- self._prefix = f"{server_path_prefix}/metalstack.infra.v2.SwitchService"
48
- self._endpoints = {
49
- "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse](
50
- service_name="SwitchService",
51
- name="Register",
52
- function=getattr(service, "Register"),
53
- input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
54
- output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
55
- allowed_methods=("POST",),
56
- ),
57
- }
19
+ async def register(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
20
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+
23
+ class SwitchServiceASGIApplication(ConnecpyASGIApplication):
24
+ def __init__(self, service: SwitchService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
25
+ super().__init__(
26
+ endpoints={
27
+ "/metalstack.infra.v2.SwitchService/Register": Endpoint.unary(
28
+ method=MethodInfo(
29
+ name="Register",
30
+ service_name="metalstack.infra.v2.SwitchService",
31
+ input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
32
+ output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
33
+ idempotency_level=IdempotencyLevel.UNKNOWN,
34
+ ),
35
+ function=service.register,
36
+ ),
37
+ },
38
+ interceptors=interceptors,
39
+ read_max_bytes=read_max_bytes,
40
+ )
58
41
 
59
- def serviceName(self):
60
- return "metalstack.infra.v2.SwitchService"
42
+ @property
43
+ def path(self):
44
+ """Returns the URL path to mount the application to when serving multiple applications."""
45
+ return "/metalstack.infra.v2.SwitchService"
61
46
 
62
47
 
63
48
  class SwitchServiceClient(ConnecpyClient):
64
- def Register(
49
+ async def register(
65
50
  self,
66
51
  request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
67
52
  *,
68
- ctx: Optional[ClientContext] = None,
69
- server_path_prefix: str = "",
70
- **kwargs,
53
+ headers: Headers | Mapping[str, str] | None = None,
54
+ timeout_ms: int | None = None,
71
55
  ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
72
- method = "POST"
73
- return self._make_request(
74
- url=f"{server_path_prefix}/metalstack.infra.v2.SwitchService/Register",
75
- ctx=ctx,
56
+ return await self.execute_unary(
76
57
  request=request,
77
- response_class=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
78
- method=method,
79
- **kwargs,
58
+ method=MethodInfo(
59
+ name="Register",
60
+ service_name="metalstack.infra.v2.SwitchService",
61
+ input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
62
+ output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
63
+ idempotency_level=IdempotencyLevel.UNKNOWN,
64
+ ),
65
+ headers=headers,
66
+ timeout_ms=timeout_ms,
80
67
  )
81
68
 
82
69
 
83
- class AsyncSwitchServiceClient(AsyncConnecpyClient):
84
- async def Register(
70
+ class SwitchServiceSync(Protocol):
71
+ def register(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
72
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
73
+
74
+
75
+ class SwitchServiceWSGIApplication(ConnecpyWSGIApplication):
76
+ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
77
+ super().__init__(
78
+ endpoints={
79
+ "/metalstack.infra.v2.SwitchService/Register": EndpointSync.unary(
80
+ method=MethodInfo(
81
+ name="Register",
82
+ service_name="metalstack.infra.v2.SwitchService",
83
+ input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
84
+ output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
85
+ idempotency_level=IdempotencyLevel.UNKNOWN,
86
+ ),
87
+ function=service.register,
88
+ ),
89
+ },
90
+ interceptors=interceptors,
91
+ read_max_bytes=read_max_bytes,
92
+ )
93
+
94
+ @property
95
+ def path(self):
96
+ """Returns the URL path to mount the application to when serving multiple applications."""
97
+ return "/metalstack.infra.v2.SwitchService"
98
+
99
+
100
+ class SwitchServiceClientSync(ConnecpyClientSync):
101
+ def register(
85
102
  self,
86
103
  request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
87
104
  *,
88
- ctx: Optional[ClientContext] = None,
89
- server_path_prefix: str = "",
90
- session: Union[httpx.AsyncClient, None] = None,
91
- **kwargs,
105
+ headers: Headers | Mapping[str, str] | None = None,
106
+ timeout_ms: int | None = None,
92
107
  ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
93
- method = "POST"
94
- return await self._make_request(
95
- url=f"{server_path_prefix}/metalstack.infra.v2.SwitchService/Register",
96
- ctx=ctx,
108
+ return self.execute_unary(
97
109
  request=request,
98
- response_class=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
99
- method=method,
100
- session=session,
101
- **kwargs,
110
+ method=MethodInfo(
111
+ name="Register",
112
+ service_name="metalstack.infra.v2.SwitchService",
113
+ input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
114
+ output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
115
+ idempotency_level=IdempotencyLevel.UNKNOWN,
116
+ ),
117
+ headers=headers,
118
+ timeout_ms=timeout_ms,
102
119
  )