metal-stack-api 0.0.15__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.
- {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.16.dist-info}/METADATA +1 -1
- {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.16.dist-info}/RECORD +29 -29
- metalstack/admin/v2/filesystem_connecpy.py +195 -160
- metalstack/admin/v2/image_connecpy.py +241 -197
- metalstack/admin/v2/ip_connecpy.py +144 -118
- metalstack/admin/v2/machine_connecpy.py +144 -118
- metalstack/admin/v2/network_connecpy.py +291 -238
- metalstack/admin/v2/partition_connecpy.py +241 -197
- metalstack/admin/v2/size_connecpy.py +195 -160
- metalstack/admin/v2/tenant_connecpy.py +144 -118
- metalstack/admin/v2/token_connecpy.py +144 -118
- metalstack/api/v2/filesystem_connecpy.py +241 -197
- metalstack/api/v2/health_connecpy.py +93 -76
- metalstack/api/v2/image_connecpy.py +195 -160
- metalstack/api/v2/ip_connecpy.py +291 -238
- metalstack/api/v2/machine_connecpy.py +291 -238
- metalstack/api/v2/method_connecpy.py +144 -118
- metalstack/api/v2/network_connecpy.py +341 -279
- metalstack/api/v2/partition_connecpy.py +144 -118
- metalstack/api/v2/project_connecpy.py +654 -538
- metalstack/api/v2/size_connecpy.py +144 -118
- metalstack/api/v2/tenant_connecpy.py +654 -538
- metalstack/api/v2/token_connecpy.py +341 -279
- metalstack/api/v2/user_connecpy.py +93 -76
- metalstack/api/v2/version_connecpy.py +93 -76
- metalstack/infra/v2/bmc_connecpy.py +93 -76
- metalstack/infra/v2/switch_connecpy.py +93 -76
- {metal_stack_api-0.0.15.dist-info → metal_stack_api-0.0.16.dist-info}/WHEEL +0 -0
- {metal_stack_api-0.0.15.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/user.proto
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from collections.abc import AsyncIterator, Iterable, Iterator, Mapping
|
|
6
|
+
from typing import Protocol
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
from connecpy.
|
|
10
|
-
from connecpy.
|
|
11
|
-
from connecpy.
|
|
12
|
-
from connecpy.
|
|
13
|
-
from connecpy.
|
|
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.user_pb2 as metalstack_dot_api_dot_v2_dot_user__pb2
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class UserService(Protocol):
|
|
18
|
-
async def
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class UserServiceSync(Protocol):
|
|
41
|
-
def Get(self, req: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse: ...
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class UserServiceServerSync(ConnecpyServer):
|
|
45
|
-
def __init__(self, *, service: UserServiceSync, server_path_prefix=""):
|
|
46
|
-
super().__init__()
|
|
47
|
-
self._prefix = f"{server_path_prefix}/metalstack.api.v2.UserService"
|
|
48
|
-
self._endpoints = {
|
|
49
|
-
"Get": Endpoint[metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse](
|
|
50
|
-
service_name="UserService",
|
|
51
|
-
name="Get",
|
|
52
|
-
function=getattr(service, "Get"),
|
|
53
|
-
input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
54
|
-
output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse,
|
|
55
|
-
allowed_methods=("POST",),
|
|
56
|
-
),
|
|
57
|
-
}
|
|
19
|
+
async def get(self, request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse:
|
|
20
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class UserServiceASGIApplication(ConnecpyASGIApplication):
|
|
24
|
+
def __init__(self, service: UserService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
|
|
25
|
+
super().__init__(
|
|
26
|
+
endpoints={
|
|
27
|
+
"/metalstack.api.v2.UserService/Get": Endpoint.unary(
|
|
28
|
+
method=MethodInfo(
|
|
29
|
+
name="Get",
|
|
30
|
+
service_name="metalstack.api.v2.UserService",
|
|
31
|
+
input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
32
|
+
output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse,
|
|
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
|
-
|
|
60
|
-
|
|
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.UserService"
|
|
61
46
|
|
|
62
47
|
|
|
63
48
|
class UserServiceClient(ConnecpyClient):
|
|
64
|
-
def
|
|
49
|
+
async def get(
|
|
65
50
|
self,
|
|
66
51
|
request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
67
52
|
*,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
**kwargs,
|
|
53
|
+
headers: Headers | Mapping[str, str] | None = None,
|
|
54
|
+
timeout_ms: int | None = None,
|
|
71
55
|
) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse:
|
|
72
|
-
|
|
73
|
-
return self._make_request(
|
|
74
|
-
url=f"{server_path_prefix}/metalstack.api.v2.UserService/Get",
|
|
75
|
-
ctx=ctx,
|
|
56
|
+
return await self.execute_unary(
|
|
76
57
|
request=request,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
method=MethodInfo(
|
|
59
|
+
name="Get",
|
|
60
|
+
service_name="metalstack.api.v2.UserService",
|
|
61
|
+
input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
62
|
+
output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse,
|
|
63
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
64
|
+
),
|
|
65
|
+
headers=headers,
|
|
66
|
+
timeout_ms=timeout_ms,
|
|
80
67
|
)
|
|
81
68
|
|
|
82
69
|
|
|
83
|
-
class
|
|
84
|
-
|
|
70
|
+
class UserServiceSync(Protocol):
|
|
71
|
+
def get(self, request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse:
|
|
72
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class UserServiceWSGIApplication(ConnecpyWSGIApplication):
|
|
76
|
+
def __init__(self, service: UserServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
|
|
77
|
+
super().__init__(
|
|
78
|
+
endpoints={
|
|
79
|
+
"/metalstack.api.v2.UserService/Get": EndpointSync.unary(
|
|
80
|
+
method=MethodInfo(
|
|
81
|
+
name="Get",
|
|
82
|
+
service_name="metalstack.api.v2.UserService",
|
|
83
|
+
input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
84
|
+
output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse,
|
|
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.UserService"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class UserServiceClientSync(ConnecpyClientSync):
|
|
101
|
+
def get(
|
|
85
102
|
self,
|
|
86
103
|
request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
87
104
|
*,
|
|
88
|
-
|
|
89
|
-
|
|
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_user__pb2.UserServiceGetResponse:
|
|
93
|
-
|
|
94
|
-
return await self._make_request(
|
|
95
|
-
url=f"{server_path_prefix}/metalstack.api.v2.UserService/Get",
|
|
96
|
-
ctx=ctx,
|
|
108
|
+
return self.execute_unary(
|
|
97
109
|
request=request,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
method=MethodInfo(
|
|
111
|
+
name="Get",
|
|
112
|
+
service_name="metalstack.api.v2.UserService",
|
|
113
|
+
input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest,
|
|
114
|
+
output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse,
|
|
115
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
116
|
+
),
|
|
117
|
+
headers=headers,
|
|
118
|
+
timeout_ms=timeout_ms,
|
|
102
119
|
)
|
|
@@ -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/version.proto
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from collections.abc import AsyncIterator, Iterable, Iterator, Mapping
|
|
6
|
+
from typing import Protocol
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
from connecpy.
|
|
10
|
-
from connecpy.
|
|
11
|
-
from connecpy.
|
|
12
|
-
from connecpy.
|
|
13
|
-
from connecpy.
|
|
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.version_pb2 as metalstack_dot_api_dot_v2_dot_version__pb2
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class VersionService(Protocol):
|
|
18
|
-
async def
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class VersionServiceSync(Protocol):
|
|
41
|
-
def Get(self, req: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, ctx: ServiceContext) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse: ...
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class VersionServiceServerSync(ConnecpyServer):
|
|
45
|
-
def __init__(self, *, service: VersionServiceSync, server_path_prefix=""):
|
|
46
|
-
super().__init__()
|
|
47
|
-
self._prefix = f"{server_path_prefix}/metalstack.api.v2.VersionService"
|
|
48
|
-
self._endpoints = {
|
|
49
|
-
"Get": Endpoint[metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse](
|
|
50
|
-
service_name="VersionService",
|
|
51
|
-
name="Get",
|
|
52
|
-
function=getattr(service, "Get"),
|
|
53
|
-
input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
54
|
-
output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse,
|
|
55
|
-
allowed_methods=("POST",),
|
|
56
|
-
),
|
|
57
|
-
}
|
|
19
|
+
async def get(self, request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse:
|
|
20
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class VersionServiceASGIApplication(ConnecpyASGIApplication):
|
|
24
|
+
def __init__(self, service: VersionService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
|
|
25
|
+
super().__init__(
|
|
26
|
+
endpoints={
|
|
27
|
+
"/metalstack.api.v2.VersionService/Get": Endpoint.unary(
|
|
28
|
+
method=MethodInfo(
|
|
29
|
+
name="Get",
|
|
30
|
+
service_name="metalstack.api.v2.VersionService",
|
|
31
|
+
input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
32
|
+
output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse,
|
|
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
|
-
|
|
60
|
-
|
|
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.VersionService"
|
|
61
46
|
|
|
62
47
|
|
|
63
48
|
class VersionServiceClient(ConnecpyClient):
|
|
64
|
-
def
|
|
49
|
+
async def get(
|
|
65
50
|
self,
|
|
66
51
|
request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
67
52
|
*,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
**kwargs,
|
|
53
|
+
headers: Headers | Mapping[str, str] | None = None,
|
|
54
|
+
timeout_ms: int | None = None,
|
|
71
55
|
) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse:
|
|
72
|
-
|
|
73
|
-
return self._make_request(
|
|
74
|
-
url=f"{server_path_prefix}/metalstack.api.v2.VersionService/Get",
|
|
75
|
-
ctx=ctx,
|
|
56
|
+
return await self.execute_unary(
|
|
76
57
|
request=request,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
method=MethodInfo(
|
|
59
|
+
name="Get",
|
|
60
|
+
service_name="metalstack.api.v2.VersionService",
|
|
61
|
+
input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
62
|
+
output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse,
|
|
63
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
64
|
+
),
|
|
65
|
+
headers=headers,
|
|
66
|
+
timeout_ms=timeout_ms,
|
|
80
67
|
)
|
|
81
68
|
|
|
82
69
|
|
|
83
|
-
class
|
|
84
|
-
|
|
70
|
+
class VersionServiceSync(Protocol):
|
|
71
|
+
def get(self, request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse:
|
|
72
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class VersionServiceWSGIApplication(ConnecpyWSGIApplication):
|
|
76
|
+
def __init__(self, service: VersionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
|
|
77
|
+
super().__init__(
|
|
78
|
+
endpoints={
|
|
79
|
+
"/metalstack.api.v2.VersionService/Get": EndpointSync.unary(
|
|
80
|
+
method=MethodInfo(
|
|
81
|
+
name="Get",
|
|
82
|
+
service_name="metalstack.api.v2.VersionService",
|
|
83
|
+
input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
84
|
+
output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse,
|
|
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.VersionService"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class VersionServiceClientSync(ConnecpyClientSync):
|
|
101
|
+
def get(
|
|
85
102
|
self,
|
|
86
103
|
request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
87
104
|
*,
|
|
88
|
-
|
|
89
|
-
|
|
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_version__pb2.VersionServiceGetResponse:
|
|
93
|
-
|
|
94
|
-
return await self._make_request(
|
|
95
|
-
url=f"{server_path_prefix}/metalstack.api.v2.VersionService/Get",
|
|
96
|
-
ctx=ctx,
|
|
108
|
+
return self.execute_unary(
|
|
97
109
|
request=request,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
method=MethodInfo(
|
|
111
|
+
name="Get",
|
|
112
|
+
service_name="metalstack.api.v2.VersionService",
|
|
113
|
+
input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest,
|
|
114
|
+
output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse,
|
|
115
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
116
|
+
),
|
|
117
|
+
headers=headers,
|
|
118
|
+
timeout_ms=timeout_ms,
|
|
102
119
|
)
|
|
@@ -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/bmc.proto
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from collections.abc import AsyncIterator, Iterable, Iterator, Mapping
|
|
6
|
+
from typing import Protocol
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
from connecpy.
|
|
10
|
-
from connecpy.
|
|
11
|
-
from connecpy.
|
|
12
|
-
from connecpy.
|
|
13
|
-
from connecpy.
|
|
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.bmc_pb2 as metalstack_dot_infra_dot_v2_dot_bmc__pb2
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class BMCService(Protocol):
|
|
18
|
-
async def
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class BMCServiceSync(Protocol):
|
|
41
|
-
def UpdateBMCInfo(self, req: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse: ...
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class BMCServiceServerSync(ConnecpyServer):
|
|
45
|
-
def __init__(self, *, service: BMCServiceSync, server_path_prefix=""):
|
|
46
|
-
super().__init__()
|
|
47
|
-
self._prefix = f"{server_path_prefix}/metalstack.infra.v2.BMCService"
|
|
48
|
-
self._endpoints = {
|
|
49
|
-
"UpdateBMCInfo": Endpoint[metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse](
|
|
50
|
-
service_name="BMCService",
|
|
51
|
-
name="UpdateBMCInfo",
|
|
52
|
-
function=getattr(service, "UpdateBMCInfo"),
|
|
53
|
-
input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
54
|
-
output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse,
|
|
55
|
-
allowed_methods=("POST",),
|
|
56
|
-
),
|
|
57
|
-
}
|
|
19
|
+
async def update_b_m_c_info(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse:
|
|
20
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BMCServiceASGIApplication(ConnecpyASGIApplication):
|
|
24
|
+
def __init__(self, service: BMCService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None):
|
|
25
|
+
super().__init__(
|
|
26
|
+
endpoints={
|
|
27
|
+
"/metalstack.infra.v2.BMCService/UpdateBMCInfo": Endpoint.unary(
|
|
28
|
+
method=MethodInfo(
|
|
29
|
+
name="UpdateBMCInfo",
|
|
30
|
+
service_name="metalstack.infra.v2.BMCService",
|
|
31
|
+
input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
32
|
+
output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse,
|
|
33
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
34
|
+
),
|
|
35
|
+
function=service.update_b_m_c_info,
|
|
36
|
+
),
|
|
37
|
+
},
|
|
38
|
+
interceptors=interceptors,
|
|
39
|
+
read_max_bytes=read_max_bytes,
|
|
40
|
+
)
|
|
58
41
|
|
|
59
|
-
|
|
60
|
-
|
|
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.BMCService"
|
|
61
46
|
|
|
62
47
|
|
|
63
48
|
class BMCServiceClient(ConnecpyClient):
|
|
64
|
-
def
|
|
49
|
+
async def update_b_m_c_info(
|
|
65
50
|
self,
|
|
66
51
|
request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
67
52
|
*,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
**kwargs,
|
|
53
|
+
headers: Headers | Mapping[str, str] | None = None,
|
|
54
|
+
timeout_ms: int | None = None,
|
|
71
55
|
) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse:
|
|
72
|
-
|
|
73
|
-
return self._make_request(
|
|
74
|
-
url=f"{server_path_prefix}/metalstack.infra.v2.BMCService/UpdateBMCInfo",
|
|
75
|
-
ctx=ctx,
|
|
56
|
+
return await self.execute_unary(
|
|
76
57
|
request=request,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
method=MethodInfo(
|
|
59
|
+
name="UpdateBMCInfo",
|
|
60
|
+
service_name="metalstack.infra.v2.BMCService",
|
|
61
|
+
input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
62
|
+
output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse,
|
|
63
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
64
|
+
),
|
|
65
|
+
headers=headers,
|
|
66
|
+
timeout_ms=timeout_ms,
|
|
80
67
|
)
|
|
81
68
|
|
|
82
69
|
|
|
83
|
-
class
|
|
84
|
-
|
|
70
|
+
class BMCServiceSync(Protocol):
|
|
71
|
+
def update_b_m_c_info(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse:
|
|
72
|
+
raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class BMCServiceWSGIApplication(ConnecpyWSGIApplication):
|
|
76
|
+
def __init__(self, service: BMCServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None):
|
|
77
|
+
super().__init__(
|
|
78
|
+
endpoints={
|
|
79
|
+
"/metalstack.infra.v2.BMCService/UpdateBMCInfo": EndpointSync.unary(
|
|
80
|
+
method=MethodInfo(
|
|
81
|
+
name="UpdateBMCInfo",
|
|
82
|
+
service_name="metalstack.infra.v2.BMCService",
|
|
83
|
+
input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
84
|
+
output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse,
|
|
85
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
86
|
+
),
|
|
87
|
+
function=service.update_b_m_c_info,
|
|
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.BMCService"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class BMCServiceClientSync(ConnecpyClientSync):
|
|
101
|
+
def update_b_m_c_info(
|
|
85
102
|
self,
|
|
86
103
|
request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
87
104
|
*,
|
|
88
|
-
|
|
89
|
-
|
|
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_bmc__pb2.UpdateBMCInfoResponse:
|
|
93
|
-
|
|
94
|
-
return await self._make_request(
|
|
95
|
-
url=f"{server_path_prefix}/metalstack.infra.v2.BMCService/UpdateBMCInfo",
|
|
96
|
-
ctx=ctx,
|
|
108
|
+
return self.execute_unary(
|
|
97
109
|
request=request,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
method=MethodInfo(
|
|
111
|
+
name="UpdateBMCInfo",
|
|
112
|
+
service_name="metalstack.infra.v2.BMCService",
|
|
113
|
+
input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest,
|
|
114
|
+
output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse,
|
|
115
|
+
idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
116
|
+
),
|
|
117
|
+
headers=headers,
|
|
118
|
+
timeout_ms=timeout_ms,
|
|
102
119
|
)
|