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
@@ -83,7 +83,15 @@ class FilesystemServiceListResponse(_message.Message):
83
83
  filesystem_layouts: _containers.RepeatedCompositeFieldContainer[FilesystemLayout]
84
84
  def __init__(self, filesystem_layouts: _Optional[_Iterable[_Union[FilesystemLayout, _Mapping]]] = ...) -> None: ...
85
85
 
86
- class FilesystemServiceTryRequest(_message.Message):
86
+ class FilesystemServiceMatchRequest(_message.Message):
87
+ __slots__ = ("size_and_image", "machine_and_filesystemlayout")
88
+ SIZE_AND_IMAGE_FIELD_NUMBER: _ClassVar[int]
89
+ MACHINE_AND_FILESYSTEMLAYOUT_FIELD_NUMBER: _ClassVar[int]
90
+ size_and_image: MatchImageAndSize
91
+ machine_and_filesystemlayout: MatchMachine
92
+ def __init__(self, size_and_image: _Optional[_Union[MatchImageAndSize, _Mapping]] = ..., machine_and_filesystemlayout: _Optional[_Union[MatchMachine, _Mapping]] = ...) -> None: ...
93
+
94
+ class MatchImageAndSize(_message.Message):
87
95
  __slots__ = ("size", "image")
88
96
  SIZE_FIELD_NUMBER: _ClassVar[int]
89
97
  IMAGE_FIELD_NUMBER: _ClassVar[int]
@@ -91,7 +99,7 @@ class FilesystemServiceTryRequest(_message.Message):
91
99
  image: str
92
100
  def __init__(self, size: _Optional[str] = ..., image: _Optional[str] = ...) -> None: ...
93
101
 
94
- class FilesystemServiceMatchRequest(_message.Message):
102
+ class MatchMachine(_message.Message):
95
103
  __slots__ = ("machine", "filesystem_layout")
96
104
  MACHINE_FIELD_NUMBER: _ClassVar[int]
97
105
  FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int]
@@ -25,11 +25,6 @@ class FilesystemServiceStub(object):
25
25
  request_serializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest.SerializeToString,
26
26
  response_deserializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse.FromString,
27
27
  _registered_method=True)
28
- self.Try = channel.unary_unary(
29
- '/metalstack.api.v2.FilesystemService/Try',
30
- request_serializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryRequest.SerializeToString,
31
- response_deserializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryResponse.FromString,
32
- _registered_method=True)
33
28
  self.Match = channel.unary_unary(
34
29
  '/metalstack.api.v2.FilesystemService/Match',
35
30
  request_serializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest.SerializeToString,
@@ -55,13 +50,6 @@ class FilesystemServiceServicer(object):
55
50
  context.set_details('Method not implemented!')
56
51
  raise NotImplementedError('Method not implemented!')
57
52
 
58
- def Try(self, request, context):
59
- """Try a filesystems
60
- """
61
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
62
- context.set_details('Method not implemented!')
63
- raise NotImplementedError('Method not implemented!')
64
-
65
53
  def Match(self, request, context):
66
54
  """Match a filesystems
67
55
  """
@@ -82,11 +70,6 @@ def add_FilesystemServiceServicer_to_server(servicer, server):
82
70
  request_deserializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest.FromString,
83
71
  response_serializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse.SerializeToString,
84
72
  ),
85
- 'Try': grpc.unary_unary_rpc_method_handler(
86
- servicer.Try,
87
- request_deserializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryRequest.FromString,
88
- response_serializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryResponse.SerializeToString,
89
- ),
90
73
  'Match': grpc.unary_unary_rpc_method_handler(
91
74
  servicer.Match,
92
75
  request_deserializer=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest.FromString,
@@ -158,33 +141,6 @@ class FilesystemService(object):
158
141
  metadata,
159
142
  _registered_method=True)
160
143
 
161
- @staticmethod
162
- def Try(request,
163
- target,
164
- options=(),
165
- channel_credentials=None,
166
- call_credentials=None,
167
- insecure=False,
168
- compression=None,
169
- wait_for_ready=None,
170
- timeout=None,
171
- metadata=None):
172
- return grpc.experimental.unary_unary(
173
- request,
174
- target,
175
- '/metalstack.api.v2.FilesystemService/Try',
176
- metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryRequest.SerializeToString,
177
- metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceTryResponse.FromString,
178
- options,
179
- channel_credentials,
180
- insecure,
181
- call_credentials,
182
- compression,
183
- wait_for_ready,
184
- timeout,
185
- metadata,
186
- _registered_method=True)
187
-
188
144
  @staticmethod
189
145
  def Match(request,
190
146
  target,
@@ -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/api/v2/health.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.api.v2.health_pb2 as metalstack_dot_api_dot_v2_dot_health__pb2
15
16
 
16
17
 
17
18
  class HealthService(Protocol):
18
- async def Get(self, req: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: ...
19
-
20
-
21
- class HealthServiceServer(ConnecpyServer):
22
- def __init__(self, *, service: HealthService, server_path_prefix=""):
23
- super().__init__()
24
- self._prefix = f"{server_path_prefix}/metalstack.api.v2.HealthService"
25
- self._endpoints = {
26
- "Get": Endpoint[metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse](
27
- service_name="HealthService",
28
- name="Get",
29
- function=getattr(service, "Get"),
30
- input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
31
- output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
32
- allowed_methods=("POST",),
33
- ),
34
- }
35
-
36
- def serviceName(self):
37
- return "metalstack.api.v2.HealthService"
38
-
39
-
40
- class HealthServiceSync(Protocol):
41
- def Get(self, req: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: ...
42
-
43
-
44
- class HealthServiceServerSync(ConnecpyServer):
45
- def __init__(self, *, service: HealthServiceSync, server_path_prefix=""):
46
- super().__init__()
47
- self._prefix = f"{server_path_prefix}/metalstack.api.v2.HealthService"
48
- self._endpoints = {
49
- "Get": Endpoint[metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse](
50
- service_name="HealthService",
51
- name="Get",
52
- function=getattr(service, "Get"),
53
- input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
54
- output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
55
- allowed_methods=("POST",),
56
- ),
57
- }
19
+ async def get(self, request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse:
20
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+
23
+ class HealthServiceASGIApplication(ConnecpyASGIApplication):
24
+ def __init__(self, service: HealthService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
25
+ super().__init__(
26
+ endpoints={
27
+ "/metalstack.api.v2.HealthService/Get": Endpoint.unary(
28
+ method=MethodInfo(
29
+ name="Get",
30
+ service_name="metalstack.api.v2.HealthService",
31
+ input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
32
+ output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
33
+ idempotency_level=IdempotencyLevel.UNKNOWN,
34
+ ),
35
+ function=service.get,
36
+ ),
37
+ },
38
+ interceptors=interceptors,
39
+ read_max_bytes=read_max_bytes,
40
+ )
58
41
 
59
- def serviceName(self):
60
- return "metalstack.api.v2.HealthService"
42
+ @property
43
+ def path(self):
44
+ """Returns the URL path to mount the application to when serving multiple applications."""
45
+ return "/metalstack.api.v2.HealthService"
61
46
 
62
47
 
63
48
  class HealthServiceClient(ConnecpyClient):
64
- def Get(
49
+ async def get(
65
50
  self,
66
51
  request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
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_api_dot_v2_dot_health__pb2.HealthServiceGetResponse:
72
- method = "POST"
73
- return self._make_request(
74
- url=f"{server_path_prefix}/metalstack.api.v2.HealthService/Get",
75
- ctx=ctx,
56
+ return await self.execute_unary(
76
57
  request=request,
77
- response_class=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
78
- method=method,
79
- **kwargs,
58
+ method=MethodInfo(
59
+ name="Get",
60
+ service_name="metalstack.api.v2.HealthService",
61
+ input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
62
+ output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
63
+ idempotency_level=IdempotencyLevel.UNKNOWN,
64
+ ),
65
+ headers=headers,
66
+ timeout_ms=timeout_ms,
80
67
  )
81
68
 
82
69
 
83
- class AsyncHealthServiceClient(AsyncConnecpyClient):
84
- async def Get(
70
+ class HealthServiceSync(Protocol):
71
+ def get(self, request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse:
72
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
73
+
74
+
75
+ class HealthServiceWSGIApplication(ConnecpyWSGIApplication):
76
+ def __init__(self, service: HealthServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
77
+ super().__init__(
78
+ endpoints={
79
+ "/metalstack.api.v2.HealthService/Get": EndpointSync.unary(
80
+ method=MethodInfo(
81
+ name="Get",
82
+ service_name="metalstack.api.v2.HealthService",
83
+ input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
84
+ output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
85
+ idempotency_level=IdempotencyLevel.UNKNOWN,
86
+ ),
87
+ function=service.get,
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.api.v2.HealthService"
98
+
99
+
100
+ class HealthServiceClientSync(ConnecpyClientSync):
101
+ def get(
85
102
  self,
86
103
  request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
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_api_dot_v2_dot_health__pb2.HealthServiceGetResponse:
93
- method = "POST"
94
- return await self._make_request(
95
- url=f"{server_path_prefix}/metalstack.api.v2.HealthService/Get",
96
- ctx=ctx,
108
+ return self.execute_unary(
97
109
  request=request,
98
- response_class=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
99
- method=method,
100
- session=session,
101
- **kwargs,
110
+ method=MethodInfo(
111
+ name="Get",
112
+ service_name="metalstack.api.v2.HealthService",
113
+ input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest,
114
+ output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse,
115
+ idempotency_level=IdempotencyLevel.UNKNOWN,
116
+ ),
117
+ headers=headers,
118
+ timeout_ms=timeout_ms,
102
119
  )