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,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
  )
@@ -1,214 +1,249 @@
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/image.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.image_pb2 as metalstack_dot_api_dot_v2_dot_image__pb2
15
16
 
16
17
 
17
18
  class ImageService(Protocol):
18
- async def Get(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: ...
19
- async def List(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: ...
20
- async def Latest(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: ...
21
-
22
-
23
- class ImageServiceServer(ConnecpyServer):
24
- def __init__(self, *, service: ImageService, server_path_prefix=""):
25
- super().__init__()
26
- self._prefix = f"{server_path_prefix}/metalstack.api.v2.ImageService"
27
- self._endpoints = {
28
- "Get": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse](
29
- service_name="ImageService",
30
- name="Get",
31
- function=getattr(service, "Get"),
32
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
33
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
34
- allowed_methods=("POST",),
35
- ),
36
- "List": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse](
37
- service_name="ImageService",
38
- name="List",
39
- function=getattr(service, "List"),
40
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
41
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
42
- allowed_methods=("POST",),
43
- ),
44
- "Latest": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse](
45
- service_name="ImageService",
46
- name="Latest",
47
- function=getattr(service, "Latest"),
48
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
49
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
50
- allowed_methods=("POST",),
51
- ),
52
- }
53
-
54
- def serviceName(self):
55
- return "metalstack.api.v2.ImageService"
56
-
57
-
58
- class ImageServiceSync(Protocol):
59
- def Get(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: ...
60
- def List(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: ...
61
- def Latest(self, req: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: ...
62
-
63
-
64
- class ImageServiceServerSync(ConnecpyServer):
65
- def __init__(self, *, service: ImageServiceSync, server_path_prefix=""):
66
- super().__init__()
67
- self._prefix = f"{server_path_prefix}/metalstack.api.v2.ImageService"
68
- self._endpoints = {
69
- "Get": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse](
70
- service_name="ImageService",
71
- name="Get",
72
- function=getattr(service, "Get"),
73
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
74
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
75
- allowed_methods=("POST",),
76
- ),
77
- "List": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse](
78
- service_name="ImageService",
79
- name="List",
80
- function=getattr(service, "List"),
81
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
82
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
83
- allowed_methods=("POST",),
84
- ),
85
- "Latest": Endpoint[metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse](
86
- service_name="ImageService",
87
- name="Latest",
88
- function=getattr(service, "Latest"),
89
- input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
90
- output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
91
- allowed_methods=("POST",),
92
- ),
93
- }
19
+ async def get(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse:
20
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+ async def list(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse:
23
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
24
+
25
+ async def latest(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse:
26
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
27
+
28
+
29
+ class ImageServiceASGIApplication(ConnecpyASGIApplication):
30
+ def __init__(self, service: ImageService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
31
+ super().__init__(
32
+ endpoints={
33
+ "/metalstack.api.v2.ImageService/Get": Endpoint.unary(
34
+ method=MethodInfo(
35
+ name="Get",
36
+ service_name="metalstack.api.v2.ImageService",
37
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
38
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
39
+ idempotency_level=IdempotencyLevel.UNKNOWN,
40
+ ),
41
+ function=service.get,
42
+ ),
43
+ "/metalstack.api.v2.ImageService/List": Endpoint.unary(
44
+ method=MethodInfo(
45
+ name="List",
46
+ service_name="metalstack.api.v2.ImageService",
47
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
48
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
49
+ idempotency_level=IdempotencyLevel.UNKNOWN,
50
+ ),
51
+ function=service.list,
52
+ ),
53
+ "/metalstack.api.v2.ImageService/Latest": Endpoint.unary(
54
+ method=MethodInfo(
55
+ name="Latest",
56
+ service_name="metalstack.api.v2.ImageService",
57
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
58
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
59
+ idempotency_level=IdempotencyLevel.UNKNOWN,
60
+ ),
61
+ function=service.latest,
62
+ ),
63
+ },
64
+ interceptors=interceptors,
65
+ read_max_bytes=read_max_bytes,
66
+ )
94
67
 
95
- def serviceName(self):
96
- return "metalstack.api.v2.ImageService"
68
+ @property
69
+ def path(self):
70
+ """Returns the URL path to mount the application to when serving multiple applications."""
71
+ return "/metalstack.api.v2.ImageService"
97
72
 
98
73
 
99
74
  class ImageServiceClient(ConnecpyClient):
100
- def Get(
75
+ async def get(
101
76
  self,
102
77
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
103
78
  *,
104
- ctx: Optional[ClientContext] = None,
105
- server_path_prefix: str = "",
106
- **kwargs,
79
+ headers: Headers | Mapping[str, str] | None = None,
80
+ timeout_ms: int | None = None,
107
81
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse:
108
- method = "POST"
109
- return self._make_request(
110
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/Get",
111
- ctx=ctx,
82
+ return await self.execute_unary(
112
83
  request=request,
113
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
114
- method=method,
115
- **kwargs,
84
+ method=MethodInfo(
85
+ name="Get",
86
+ service_name="metalstack.api.v2.ImageService",
87
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
88
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
89
+ idempotency_level=IdempotencyLevel.UNKNOWN,
90
+ ),
91
+ headers=headers,
92
+ timeout_ms=timeout_ms,
116
93
  )
117
94
 
118
- def List(
95
+ async def list(
119
96
  self,
120
97
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
121
98
  *,
122
- ctx: Optional[ClientContext] = None,
123
- server_path_prefix: str = "",
124
- **kwargs,
99
+ headers: Headers | Mapping[str, str] | None = None,
100
+ timeout_ms: int | None = None,
125
101
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse:
126
- method = "POST"
127
- return self._make_request(
128
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/List",
129
- ctx=ctx,
102
+ return await self.execute_unary(
130
103
  request=request,
131
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
132
- method=method,
133
- **kwargs,
104
+ method=MethodInfo(
105
+ name="List",
106
+ service_name="metalstack.api.v2.ImageService",
107
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
108
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
109
+ idempotency_level=IdempotencyLevel.UNKNOWN,
110
+ ),
111
+ headers=headers,
112
+ timeout_ms=timeout_ms,
134
113
  )
135
114
 
136
- def Latest(
115
+ async def latest(
137
116
  self,
138
117
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
139
118
  *,
140
- ctx: Optional[ClientContext] = None,
141
- server_path_prefix: str = "",
142
- **kwargs,
119
+ headers: Headers | Mapping[str, str] | None = None,
120
+ timeout_ms: int | None = None,
143
121
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse:
144
- method = "POST"
145
- return self._make_request(
146
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/Latest",
147
- ctx=ctx,
122
+ return await self.execute_unary(
148
123
  request=request,
149
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
150
- method=method,
151
- **kwargs,
124
+ method=MethodInfo(
125
+ name="Latest",
126
+ service_name="metalstack.api.v2.ImageService",
127
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
128
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
129
+ idempotency_level=IdempotencyLevel.UNKNOWN,
130
+ ),
131
+ headers=headers,
132
+ timeout_ms=timeout_ms,
152
133
  )
153
134
 
154
135
 
155
- class AsyncImageServiceClient(AsyncConnecpyClient):
156
- async def Get(
136
+ class ImageServiceSync(Protocol):
137
+ def get(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse:
138
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
139
+ def list(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse:
140
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
141
+ def latest(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse:
142
+ raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
143
+
144
+
145
+ class ImageServiceWSGIApplication(ConnecpyWSGIApplication):
146
+ def __init__(self, service: ImageServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
147
+ super().__init__(
148
+ endpoints={
149
+ "/metalstack.api.v2.ImageService/Get": EndpointSync.unary(
150
+ method=MethodInfo(
151
+ name="Get",
152
+ service_name="metalstack.api.v2.ImageService",
153
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
154
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
155
+ idempotency_level=IdempotencyLevel.UNKNOWN,
156
+ ),
157
+ function=service.get,
158
+ ),
159
+ "/metalstack.api.v2.ImageService/List": EndpointSync.unary(
160
+ method=MethodInfo(
161
+ name="List",
162
+ service_name="metalstack.api.v2.ImageService",
163
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
164
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
165
+ idempotency_level=IdempotencyLevel.UNKNOWN,
166
+ ),
167
+ function=service.list,
168
+ ),
169
+ "/metalstack.api.v2.ImageService/Latest": EndpointSync.unary(
170
+ method=MethodInfo(
171
+ name="Latest",
172
+ service_name="metalstack.api.v2.ImageService",
173
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
174
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
175
+ idempotency_level=IdempotencyLevel.UNKNOWN,
176
+ ),
177
+ function=service.latest,
178
+ ),
179
+ },
180
+ interceptors=interceptors,
181
+ read_max_bytes=read_max_bytes,
182
+ )
183
+
184
+ @property
185
+ def path(self):
186
+ """Returns the URL path to mount the application to when serving multiple applications."""
187
+ return "/metalstack.api.v2.ImageService"
188
+
189
+
190
+ class ImageServiceClientSync(ConnecpyClientSync):
191
+ def get(
157
192
  self,
158
193
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
159
194
  *,
160
- ctx: Optional[ClientContext] = None,
161
- server_path_prefix: str = "",
162
- session: Union[httpx.AsyncClient, None] = None,
163
- **kwargs,
195
+ headers: Headers | Mapping[str, str] | None = None,
196
+ timeout_ms: int | None = None,
164
197
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse:
165
- method = "POST"
166
- return await self._make_request(
167
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/Get",
168
- ctx=ctx,
198
+ return self.execute_unary(
169
199
  request=request,
170
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
171
- method=method,
172
- session=session,
173
- **kwargs,
200
+ method=MethodInfo(
201
+ name="Get",
202
+ service_name="metalstack.api.v2.ImageService",
203
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest,
204
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse,
205
+ idempotency_level=IdempotencyLevel.UNKNOWN,
206
+ ),
207
+ headers=headers,
208
+ timeout_ms=timeout_ms,
174
209
  )
175
210
 
176
- async def List(
211
+ def list(
177
212
  self,
178
213
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
179
214
  *,
180
- ctx: Optional[ClientContext] = None,
181
- server_path_prefix: str = "",
182
- session: Union[httpx.AsyncClient, None] = None,
183
- **kwargs,
215
+ headers: Headers | Mapping[str, str] | None = None,
216
+ timeout_ms: int | None = None,
184
217
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse:
185
- method = "POST"
186
- return await self._make_request(
187
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/List",
188
- ctx=ctx,
218
+ return self.execute_unary(
189
219
  request=request,
190
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
191
- method=method,
192
- session=session,
193
- **kwargs,
220
+ method=MethodInfo(
221
+ name="List",
222
+ service_name="metalstack.api.v2.ImageService",
223
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest,
224
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse,
225
+ idempotency_level=IdempotencyLevel.UNKNOWN,
226
+ ),
227
+ headers=headers,
228
+ timeout_ms=timeout_ms,
194
229
  )
195
230
 
196
- async def Latest(
231
+ def latest(
197
232
  self,
198
233
  request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
199
234
  *,
200
- ctx: Optional[ClientContext] = None,
201
- server_path_prefix: str = "",
202
- session: Union[httpx.AsyncClient, None] = None,
203
- **kwargs,
235
+ headers: Headers | Mapping[str, str] | None = None,
236
+ timeout_ms: int | None = None,
204
237
  ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse:
205
- method = "POST"
206
- return await self._make_request(
207
- url=f"{server_path_prefix}/metalstack.api.v2.ImageService/Latest",
208
- ctx=ctx,
238
+ return self.execute_unary(
209
239
  request=request,
210
- response_class=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
211
- method=method,
212
- session=session,
213
- **kwargs,
240
+ method=MethodInfo(
241
+ name="Latest",
242
+ service_name="metalstack.api.v2.ImageService",
243
+ input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest,
244
+ output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse,
245
+ idempotency_level=IdempotencyLevel.UNKNOWN,
246
+ ),
247
+ headers=headers,
248
+ timeout_ms=timeout_ms,
214
249
  )