metal-stack-api 0.0.14__py3-none-any.whl → 0.0.16__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 (35) hide show
  1. {metal_stack_api-0.0.14.dist-info → metal_stack_api-0.0.16.dist-info}/METADATA +1 -1
  2. {metal_stack_api-0.0.14.dist-info → metal_stack_api-0.0.16.dist-info}/RECORD +35 -35
  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/tenant_pb2.py +10 -10
  12. metalstack/admin/v2/tenant_pb2.pyi +2 -4
  13. metalstack/admin/v2/token_connecpy.py +144 -118
  14. metalstack/api/v2/filesystem_connecpy.py +241 -197
  15. metalstack/api/v2/health_connecpy.py +93 -76
  16. metalstack/api/v2/image_connecpy.py +195 -160
  17. metalstack/api/v2/ip_connecpy.py +291 -238
  18. metalstack/api/v2/machine_connecpy.py +291 -238
  19. metalstack/api/v2/method_connecpy.py +144 -118
  20. metalstack/api/v2/network_connecpy.py +341 -279
  21. metalstack/api/v2/partition_connecpy.py +144 -118
  22. metalstack/api/v2/project_connecpy.py +654 -538
  23. metalstack/api/v2/project_pb2.py +51 -51
  24. metalstack/api/v2/project_pb2.pyi +12 -6
  25. metalstack/api/v2/size_connecpy.py +144 -118
  26. metalstack/api/v2/tenant_connecpy.py +654 -538
  27. metalstack/api/v2/tenant_pb2.py +46 -46
  28. metalstack/api/v2/tenant_pb2.pyi +8 -6
  29. metalstack/api/v2/token_connecpy.py +341 -279
  30. metalstack/api/v2/user_connecpy.py +93 -76
  31. metalstack/api/v2/version_connecpy.py +93 -76
  32. metalstack/infra/v2/bmc_connecpy.py +93 -76
  33. metalstack/infra/v2/switch_connecpy.py +93 -76
  34. {metal_stack_api-0.0.14.dist-info → metal_stack_api-0.0.16.dist-info}/WHEEL +0 -0
  35. {metal_stack_api-0.0.14.dist-info → metal_stack_api-0.0.16.dist-info}/top_level.txt +0 -0
@@ -1,158 +1,184 @@
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/admin/v2/ip.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.admin.v2.ip_pb2 as metalstack_dot_admin_dot_v2_dot_ip__pb2
15
16
 
16
17
 
17
18
  class IPService(Protocol):
18
- async def List(self, req: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: ...
19
- async def Issues(self, req: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse: ...
20
-
21
-
22
- class IPServiceServer(ConnecpyServer):
23
- def __init__(self, *, service: IPService, server_path_prefix=""):
24
- super().__init__()
25
- self._prefix = f"{server_path_prefix}/metalstack.admin.v2.IPService"
26
- self._endpoints = {
27
- "List": Endpoint[metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse](
28
- service_name="IPService",
29
- name="List",
30
- function=getattr(service, "List"),
31
- input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
32
- output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
33
- allowed_methods=("POST",),
34
- ),
35
- "Issues": Endpoint[metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse](
36
- service_name="IPService",
37
- name="Issues",
38
- function=getattr(service, "Issues"),
39
- input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
40
- output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
41
- allowed_methods=("POST",),
42
- ),
43
- }
44
-
45
- def serviceName(self):
46
- return "metalstack.admin.v2.IPService"
47
-
48
-
49
- class IPServiceSync(Protocol):
50
- def List(self, req: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: ...
51
- def Issues(self, req: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse: ...
52
-
53
-
54
- class IPServiceServerSync(ConnecpyServer):
55
- def __init__(self, *, service: IPServiceSync, server_path_prefix=""):
56
- super().__init__()
57
- self._prefix = f"{server_path_prefix}/metalstack.admin.v2.IPService"
58
- self._endpoints = {
59
- "List": Endpoint[metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse](
60
- service_name="IPService",
61
- name="List",
62
- function=getattr(service, "List"),
63
- input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
64
- output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
65
- allowed_methods=("POST",),
66
- ),
67
- "Issues": Endpoint[metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse](
68
- service_name="IPService",
69
- name="Issues",
70
- function=getattr(service, "Issues"),
71
- input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
72
- output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
73
- allowed_methods=("POST",),
74
- ),
75
- }
19
+ async def list(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse:
20
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+ async def issues(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse:
23
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
24
+
25
+
26
+ class IPServiceASGIApplication(ConnecpyASGIApplication):
27
+ def __init__(self, service: IPService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
28
+ super().__init__(
29
+ endpoints={
30
+ "/metalstack.admin.v2.IPService/List": Endpoint.unary(
31
+ method=MethodInfo(
32
+ name="List",
33
+ service_name="metalstack.admin.v2.IPService",
34
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
35
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
36
+ idempotency_level=IdempotencyLevel.UNKNOWN,
37
+ ),
38
+ function=service.list,
39
+ ),
40
+ "/metalstack.admin.v2.IPService/Issues": Endpoint.unary(
41
+ method=MethodInfo(
42
+ name="Issues",
43
+ service_name="metalstack.admin.v2.IPService",
44
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
45
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
46
+ idempotency_level=IdempotencyLevel.UNKNOWN,
47
+ ),
48
+ function=service.issues,
49
+ ),
50
+ },
51
+ interceptors=interceptors,
52
+ read_max_bytes=read_max_bytes,
53
+ )
76
54
 
77
- def serviceName(self):
78
- return "metalstack.admin.v2.IPService"
55
+ @property
56
+ def path(self):
57
+ """Returns the URL path to mount the application to when serving multiple applications."""
58
+ return "/metalstack.admin.v2.IPService"
79
59
 
80
60
 
81
61
  class IPServiceClient(ConnecpyClient):
82
- def List(
62
+ async def list(
83
63
  self,
84
64
  request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
85
65
  *,
86
- ctx: Optional[ClientContext] = None,
87
- server_path_prefix: str = "",
88
- **kwargs,
66
+ headers: Headers | Mapping[str, str] | None = None,
67
+ timeout_ms: int | None = None,
89
68
  ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse:
90
- method = "POST"
91
- return self._make_request(
92
- url=f"{server_path_prefix}/metalstack.admin.v2.IPService/List",
93
- ctx=ctx,
69
+ return await self.execute_unary(
94
70
  request=request,
95
- response_class=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
96
- method=method,
97
- **kwargs,
71
+ method=MethodInfo(
72
+ name="List",
73
+ service_name="metalstack.admin.v2.IPService",
74
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
75
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
76
+ idempotency_level=IdempotencyLevel.UNKNOWN,
77
+ ),
78
+ headers=headers,
79
+ timeout_ms=timeout_ms,
98
80
  )
99
81
 
100
- def Issues(
82
+ async def issues(
101
83
  self,
102
84
  request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
103
85
  *,
104
- ctx: Optional[ClientContext] = None,
105
- server_path_prefix: str = "",
106
- **kwargs,
86
+ headers: Headers | Mapping[str, str] | None = None,
87
+ timeout_ms: int | None = None,
107
88
  ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse:
108
- method = "POST"
109
- return self._make_request(
110
- url=f"{server_path_prefix}/metalstack.admin.v2.IPService/Issues",
111
- ctx=ctx,
89
+ return await self.execute_unary(
112
90
  request=request,
113
- response_class=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
114
- method=method,
115
- **kwargs,
91
+ method=MethodInfo(
92
+ name="Issues",
93
+ service_name="metalstack.admin.v2.IPService",
94
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
95
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
96
+ idempotency_level=IdempotencyLevel.UNKNOWN,
97
+ ),
98
+ headers=headers,
99
+ timeout_ms=timeout_ms,
116
100
  )
117
101
 
118
102
 
119
- class AsyncIPServiceClient(AsyncConnecpyClient):
120
- async def List(
103
+ class IPServiceSync(Protocol):
104
+ def list(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse:
105
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
106
+ def issues(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse:
107
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
108
+
109
+
110
+ class IPServiceWSGIApplication(ConnecpyWSGIApplication):
111
+ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
112
+ super().__init__(
113
+ endpoints={
114
+ "/metalstack.admin.v2.IPService/List": EndpointSync.unary(
115
+ method=MethodInfo(
116
+ name="List",
117
+ service_name="metalstack.admin.v2.IPService",
118
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
119
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
120
+ idempotency_level=IdempotencyLevel.UNKNOWN,
121
+ ),
122
+ function=service.list,
123
+ ),
124
+ "/metalstack.admin.v2.IPService/Issues": EndpointSync.unary(
125
+ method=MethodInfo(
126
+ name="Issues",
127
+ service_name="metalstack.admin.v2.IPService",
128
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
129
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
130
+ idempotency_level=IdempotencyLevel.UNKNOWN,
131
+ ),
132
+ function=service.issues,
133
+ ),
134
+ },
135
+ interceptors=interceptors,
136
+ read_max_bytes=read_max_bytes,
137
+ )
138
+
139
+ @property
140
+ def path(self):
141
+ """Returns the URL path to mount the application to when serving multiple applications."""
142
+ return "/metalstack.admin.v2.IPService"
143
+
144
+
145
+ class IPServiceClientSync(ConnecpyClientSync):
146
+ def list(
121
147
  self,
122
148
  request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
123
149
  *,
124
- ctx: Optional[ClientContext] = None,
125
- server_path_prefix: str = "",
126
- session: Union[httpx.AsyncClient, None] = None,
127
- **kwargs,
150
+ headers: Headers | Mapping[str, str] | None = None,
151
+ timeout_ms: int | None = None,
128
152
  ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse:
129
- method = "POST"
130
- return await self._make_request(
131
- url=f"{server_path_prefix}/metalstack.admin.v2.IPService/List",
132
- ctx=ctx,
153
+ return self.execute_unary(
133
154
  request=request,
134
- response_class=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
135
- method=method,
136
- session=session,
137
- **kwargs,
155
+ method=MethodInfo(
156
+ name="List",
157
+ service_name="metalstack.admin.v2.IPService",
158
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest,
159
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse,
160
+ idempotency_level=IdempotencyLevel.UNKNOWN,
161
+ ),
162
+ headers=headers,
163
+ timeout_ms=timeout_ms,
138
164
  )
139
165
 
140
- async def Issues(
166
+ def issues(
141
167
  self,
142
168
  request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
143
169
  *,
144
- ctx: Optional[ClientContext] = None,
145
- server_path_prefix: str = "",
146
- session: Union[httpx.AsyncClient, None] = None,
147
- **kwargs,
170
+ headers: Headers | Mapping[str, str] | None = None,
171
+ timeout_ms: int | None = None,
148
172
  ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse:
149
- method = "POST"
150
- return await self._make_request(
151
- url=f"{server_path_prefix}/metalstack.admin.v2.IPService/Issues",
152
- ctx=ctx,
173
+ return self.execute_unary(
153
174
  request=request,
154
- response_class=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
155
- method=method,
156
- session=session,
157
- **kwargs,
175
+ method=MethodInfo(
176
+ name="Issues",
177
+ service_name="metalstack.admin.v2.IPService",
178
+ input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesRequest,
179
+ output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceIssuesResponse,
180
+ idempotency_level=IdempotencyLevel.UNKNOWN,
181
+ ),
182
+ headers=headers,
183
+ timeout_ms=timeout_ms,
158
184
  )
@@ -1,158 +1,184 @@
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/admin/v2/machine.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.admin.v2.machine_pb2 as metalstack_dot_admin_dot_v2_dot_machine__pb2
15
16
 
16
17
 
17
18
  class MachineService(Protocol):
18
- async def Get(self, req: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: ...
19
- async def List(self, req: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: ...
20
-
21
-
22
- class MachineServiceServer(ConnecpyServer):
23
- def __init__(self, *, service: MachineService, server_path_prefix=""):
24
- super().__init__()
25
- self._prefix = f"{server_path_prefix}/metalstack.admin.v2.MachineService"
26
- self._endpoints = {
27
- "Get": Endpoint[metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse](
28
- service_name="MachineService",
29
- name="Get",
30
- function=getattr(service, "Get"),
31
- input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
32
- output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
33
- allowed_methods=("POST",),
34
- ),
35
- "List": Endpoint[metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse](
36
- service_name="MachineService",
37
- name="List",
38
- function=getattr(service, "List"),
39
- input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
40
- output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
41
- allowed_methods=("POST",),
42
- ),
43
- }
44
-
45
- def serviceName(self):
46
- return "metalstack.admin.v2.MachineService"
47
-
48
-
49
- class MachineServiceSync(Protocol):
50
- def Get(self, req: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: ...
51
- def List(self, req: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: ...
52
-
53
-
54
- class MachineServiceServerSync(ConnecpyServer):
55
- def __init__(self, *, service: MachineServiceSync, server_path_prefix=""):
56
- super().__init__()
57
- self._prefix = f"{server_path_prefix}/metalstack.admin.v2.MachineService"
58
- self._endpoints = {
59
- "Get": Endpoint[metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse](
60
- service_name="MachineService",
61
- name="Get",
62
- function=getattr(service, "Get"),
63
- input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
64
- output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
65
- allowed_methods=("POST",),
66
- ),
67
- "List": Endpoint[metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse](
68
- service_name="MachineService",
69
- name="List",
70
- function=getattr(service, "List"),
71
- input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
72
- output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
73
- allowed_methods=("POST",),
74
- ),
75
- }
19
+ async def get(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse:
20
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+ async def list(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse:
23
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
24
+
25
+
26
+ class MachineServiceASGIApplication(ConnecpyASGIApplication):
27
+ def __init__(self, service: MachineService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
28
+ super().__init__(
29
+ endpoints={
30
+ "/metalstack.admin.v2.MachineService/Get": Endpoint.unary(
31
+ method=MethodInfo(
32
+ name="Get",
33
+ service_name="metalstack.admin.v2.MachineService",
34
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
35
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
36
+ idempotency_level=IdempotencyLevel.UNKNOWN,
37
+ ),
38
+ function=service.get,
39
+ ),
40
+ "/metalstack.admin.v2.MachineService/List": Endpoint.unary(
41
+ method=MethodInfo(
42
+ name="List",
43
+ service_name="metalstack.admin.v2.MachineService",
44
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
45
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
46
+ idempotency_level=IdempotencyLevel.UNKNOWN,
47
+ ),
48
+ function=service.list,
49
+ ),
50
+ },
51
+ interceptors=interceptors,
52
+ read_max_bytes=read_max_bytes,
53
+ )
76
54
 
77
- def serviceName(self):
78
- return "metalstack.admin.v2.MachineService"
55
+ @property
56
+ def path(self):
57
+ """Returns the URL path to mount the application to when serving multiple applications."""
58
+ return "/metalstack.admin.v2.MachineService"
79
59
 
80
60
 
81
61
  class MachineServiceClient(ConnecpyClient):
82
- def Get(
62
+ async def get(
83
63
  self,
84
64
  request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
85
65
  *,
86
- ctx: Optional[ClientContext] = None,
87
- server_path_prefix: str = "",
88
- **kwargs,
66
+ headers: Headers | Mapping[str, str] | None = None,
67
+ timeout_ms: int | None = None,
89
68
  ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse:
90
- method = "POST"
91
- return self._make_request(
92
- url=f"{server_path_prefix}/metalstack.admin.v2.MachineService/Get",
93
- ctx=ctx,
69
+ return await self.execute_unary(
94
70
  request=request,
95
- response_class=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
96
- method=method,
97
- **kwargs,
71
+ method=MethodInfo(
72
+ name="Get",
73
+ service_name="metalstack.admin.v2.MachineService",
74
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
75
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
76
+ idempotency_level=IdempotencyLevel.UNKNOWN,
77
+ ),
78
+ headers=headers,
79
+ timeout_ms=timeout_ms,
98
80
  )
99
81
 
100
- def List(
82
+ async def list(
101
83
  self,
102
84
  request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
103
85
  *,
104
- ctx: Optional[ClientContext] = None,
105
- server_path_prefix: str = "",
106
- **kwargs,
86
+ headers: Headers | Mapping[str, str] | None = None,
87
+ timeout_ms: int | None = None,
107
88
  ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse:
108
- method = "POST"
109
- return self._make_request(
110
- url=f"{server_path_prefix}/metalstack.admin.v2.MachineService/List",
111
- ctx=ctx,
89
+ return await self.execute_unary(
112
90
  request=request,
113
- response_class=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
114
- method=method,
115
- **kwargs,
91
+ method=MethodInfo(
92
+ name="List",
93
+ service_name="metalstack.admin.v2.MachineService",
94
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
95
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
96
+ idempotency_level=IdempotencyLevel.UNKNOWN,
97
+ ),
98
+ headers=headers,
99
+ timeout_ms=timeout_ms,
116
100
  )
117
101
 
118
102
 
119
- class AsyncMachineServiceClient(AsyncConnecpyClient):
120
- async def Get(
103
+ class MachineServiceSync(Protocol):
104
+ def get(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse:
105
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
106
+ def list(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse:
107
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
108
+
109
+
110
+ class MachineServiceWSGIApplication(ConnecpyWSGIApplication):
111
+ def __init__(self, service: MachineServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
112
+ super().__init__(
113
+ endpoints={
114
+ "/metalstack.admin.v2.MachineService/Get": EndpointSync.unary(
115
+ method=MethodInfo(
116
+ name="Get",
117
+ service_name="metalstack.admin.v2.MachineService",
118
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
119
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
120
+ idempotency_level=IdempotencyLevel.UNKNOWN,
121
+ ),
122
+ function=service.get,
123
+ ),
124
+ "/metalstack.admin.v2.MachineService/List": EndpointSync.unary(
125
+ method=MethodInfo(
126
+ name="List",
127
+ service_name="metalstack.admin.v2.MachineService",
128
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
129
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
130
+ idempotency_level=IdempotencyLevel.UNKNOWN,
131
+ ),
132
+ function=service.list,
133
+ ),
134
+ },
135
+ interceptors=interceptors,
136
+ read_max_bytes=read_max_bytes,
137
+ )
138
+
139
+ @property
140
+ def path(self):
141
+ """Returns the URL path to mount the application to when serving multiple applications."""
142
+ return "/metalstack.admin.v2.MachineService"
143
+
144
+
145
+ class MachineServiceClientSync(ConnecpyClientSync):
146
+ def get(
121
147
  self,
122
148
  request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
123
149
  *,
124
- ctx: Optional[ClientContext] = None,
125
- server_path_prefix: str = "",
126
- session: Union[httpx.AsyncClient, None] = None,
127
- **kwargs,
150
+ headers: Headers | Mapping[str, str] | None = None,
151
+ timeout_ms: int | None = None,
128
152
  ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse:
129
- method = "POST"
130
- return await self._make_request(
131
- url=f"{server_path_prefix}/metalstack.admin.v2.MachineService/Get",
132
- ctx=ctx,
153
+ return self.execute_unary(
133
154
  request=request,
134
- response_class=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
135
- method=method,
136
- session=session,
137
- **kwargs,
155
+ method=MethodInfo(
156
+ name="Get",
157
+ service_name="metalstack.admin.v2.MachineService",
158
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest,
159
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse,
160
+ idempotency_level=IdempotencyLevel.UNKNOWN,
161
+ ),
162
+ headers=headers,
163
+ timeout_ms=timeout_ms,
138
164
  )
139
165
 
140
- async def List(
166
+ def list(
141
167
  self,
142
168
  request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
143
169
  *,
144
- ctx: Optional[ClientContext] = None,
145
- server_path_prefix: str = "",
146
- session: Union[httpx.AsyncClient, None] = None,
147
- **kwargs,
170
+ headers: Headers | Mapping[str, str] | None = None,
171
+ timeout_ms: int | None = None,
148
172
  ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse:
149
- method = "POST"
150
- return await self._make_request(
151
- url=f"{server_path_prefix}/metalstack.admin.v2.MachineService/List",
152
- ctx=ctx,
173
+ return self.execute_unary(
153
174
  request=request,
154
- response_class=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
155
- method=method,
156
- session=session,
157
- **kwargs,
175
+ method=MethodInfo(
176
+ name="List",
177
+ service_name="metalstack.admin.v2.MachineService",
178
+ input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest,
179
+ output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse,
180
+ idempotency_level=IdempotencyLevel.UNKNOWN,
181
+ ),
182
+ headers=headers,
183
+ timeout_ms=timeout_ms,
158
184
  )