metal-stack-api 0.0.3__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.
- buf/__init__.py +0 -0
- buf/validate/__init__.py +0 -0
- buf/validate/validate_pb2.py +450 -0
- buf/validate/validate_pb2.pyi +631 -0
- buf/validate/validate_pb2_grpc.py +4 -0
- metal_stack_api-0.0.3.dist-info/METADATA +26 -0
- metal_stack_api-0.0.3.dist-info/RECORD +107 -0
- metal_stack_api-0.0.3.dist-info/WHEEL +5 -0
- metal_stack_api-0.0.3.dist-info/top_level.txt +2 -0
- metalstack/__init__.py +0 -0
- metalstack/admin/__init__.py +0 -0
- metalstack/admin/v2/__init__.py +0 -0
- metalstack/admin/v2/filesystem_connecpy.py +214 -0
- metalstack/admin/v2/filesystem_pb2.py +60 -0
- metalstack/admin/v2/filesystem_pb2.pyi +45 -0
- metalstack/admin/v2/filesystem_pb2_grpc.py +169 -0
- metalstack/admin/v2/image_connecpy.py +270 -0
- metalstack/admin/v2/image_pb2.py +66 -0
- metalstack/admin/v2/image_pb2.pyi +58 -0
- metalstack/admin/v2/image_pb2_grpc.py +213 -0
- metalstack/admin/v2/ip_connecpy.py +158 -0
- metalstack/admin/v2/ip_pb2.py +53 -0
- metalstack/admin/v2/ip_pb2.pyi +39 -0
- metalstack/admin/v2/ip_pb2_grpc.py +125 -0
- metalstack/admin/v2/network_connecpy.py +326 -0
- metalstack/admin/v2/network_pb2.py +104 -0
- metalstack/admin/v2/network_pb2.pyi +122 -0
- metalstack/admin/v2/network_pb2_grpc.py +257 -0
- metalstack/admin/v2/partition_connecpy.py +270 -0
- metalstack/admin/v2/partition_pb2.py +72 -0
- metalstack/admin/v2/partition_pb2.pyi +90 -0
- metalstack/admin/v2/partition_pb2_grpc.py +213 -0
- metalstack/admin/v2/size_connecpy.py +214 -0
- metalstack/admin/v2/size_pb2.py +66 -0
- metalstack/admin/v2/size_pb2.pyi +54 -0
- metalstack/admin/v2/size_pb2_grpc.py +169 -0
- metalstack/admin/v2/tenant_connecpy.py +158 -0
- metalstack/admin/v2/tenant_pb2.py +58 -0
- metalstack/admin/v2/tenant_pb2.pyi +50 -0
- metalstack/admin/v2/tenant_pb2_grpc.py +125 -0
- metalstack/admin/v2/token_connecpy.py +158 -0
- metalstack/admin/v2/token_pb2.py +56 -0
- metalstack/admin/v2/token_pb2.pyi +34 -0
- metalstack/admin/v2/token_pb2_grpc.py +125 -0
- metalstack/api/__init__.py +0 -0
- metalstack/api/v2/__init__.py +0 -0
- metalstack/api/v2/common_pb2.py +66 -0
- metalstack/api/v2/common_pb2.pyi +128 -0
- metalstack/api/v2/common_pb2_grpc.py +4 -0
- metalstack/api/v2/filesystem_connecpy.py +270 -0
- metalstack/api/v2/filesystem_pb2.py +167 -0
- metalstack/api/v2/filesystem_pb2.pyi +229 -0
- metalstack/api/v2/filesystem_pb2_grpc.py +213 -0
- metalstack/api/v2/health_connecpy.py +102 -0
- metalstack/api/v2/health_pb2.py +70 -0
- metalstack/api/v2/health_pb2.pyi +80 -0
- metalstack/api/v2/health_pb2_grpc.py +81 -0
- metalstack/api/v2/image_connecpy.py +214 -0
- metalstack/api/v2/image_pb2.py +106 -0
- metalstack/api/v2/image_pb2.pyi +115 -0
- metalstack/api/v2/image_pb2_grpc.py +169 -0
- metalstack/api/v2/ip_connecpy.py +326 -0
- metalstack/api/v2/ip_pb2.py +159 -0
- metalstack/api/v2/ip_pb2.pyi +170 -0
- metalstack/api/v2/ip_pb2_grpc.py +257 -0
- metalstack/api/v2/methods_connecpy.py +158 -0
- metalstack/api/v2/methods_pb2.py +62 -0
- metalstack/api/v2/methods_pb2.pyi +50 -0
- metalstack/api/v2/methods_pb2_grpc.py +128 -0
- metalstack/api/v2/network_connecpy.py +382 -0
- metalstack/api/v2/network_pb2.py +191 -0
- metalstack/api/v2/network_pb2.pyi +247 -0
- metalstack/api/v2/network_pb2_grpc.py +301 -0
- metalstack/api/v2/partition_connecpy.py +158 -0
- metalstack/api/v2/partition_pb2.py +81 -0
- metalstack/api/v2/partition_pb2.pyi +79 -0
- metalstack/api/v2/partition_pb2_grpc.py +125 -0
- metalstack/api/v2/project_connecpy.py +718 -0
- metalstack/api/v2/project_pb2.py +156 -0
- metalstack/api/v2/project_pb2.pyi +230 -0
- metalstack/api/v2/project_pb2_grpc.py +565 -0
- metalstack/api/v2/size_connecpy.py +158 -0
- metalstack/api/v2/size_pb2.py +85 -0
- metalstack/api/v2/size_pb2.pyi +85 -0
- metalstack/api/v2/size_pb2_grpc.py +125 -0
- metalstack/api/v2/tenant_connecpy.py +718 -0
- metalstack/api/v2/tenant_pb2.py +140 -0
- metalstack/api/v2/tenant_pb2.pyi +236 -0
- metalstack/api/v2/tenant_pb2_grpc.py +565 -0
- metalstack/api/v2/token_connecpy.py +326 -0
- metalstack/api/v2/token_pb2.py +143 -0
- metalstack/api/v2/token_pb2.pyi +175 -0
- metalstack/api/v2/token_pb2_grpc.py +257 -0
- metalstack/api/v2/user_connecpy.py +102 -0
- metalstack/api/v2/user_pb2.py +48 -0
- metalstack/api/v2/user_pb2.pyi +38 -0
- metalstack/api/v2/user_pb2_grpc.py +81 -0
- metalstack/api/v2/version_connecpy.py +102 -0
- metalstack/api/v2/version_pb2.py +46 -0
- metalstack/api/v2/version_pb2.pyi +29 -0
- metalstack/api/v2/version_pb2_grpc.py +81 -0
- metalstack/infra/__init__.py +0 -0
- metalstack/infra/v2/__init__.py +0 -0
- metalstack/infra/v2/bmc_connecpy.py +102 -0
- metalstack/infra/v2/bmc_pb2.py +44 -0
- metalstack/infra/v2/bmc_pb2.pyi +14 -0
- metalstack/infra/v2/bmc_pb2_grpc.py +81 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from metalstack.admin.v2 import size_pb2 as metalstack_dot_admin_dot_v2_dot_size__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SizeServiceStub(object):
|
|
9
|
+
"""SizeService serves size related functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.Create = channel.unary_unary(
|
|
19
|
+
'/metalstack.admin.v2.SizeService/Create',
|
|
20
|
+
request_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest.SerializeToString,
|
|
21
|
+
response_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse.FromString,
|
|
22
|
+
_registered_method=True)
|
|
23
|
+
self.Update = channel.unary_unary(
|
|
24
|
+
'/metalstack.admin.v2.SizeService/Update',
|
|
25
|
+
request_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest.SerializeToString,
|
|
26
|
+
response_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse.FromString,
|
|
27
|
+
_registered_method=True)
|
|
28
|
+
self.Delete = channel.unary_unary(
|
|
29
|
+
'/metalstack.admin.v2.SizeService/Delete',
|
|
30
|
+
request_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest.SerializeToString,
|
|
31
|
+
response_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse.FromString,
|
|
32
|
+
_registered_method=True)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class SizeServiceServicer(object):
|
|
36
|
+
"""SizeService serves size related functions
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def Create(self, request, context):
|
|
40
|
+
"""Create a size
|
|
41
|
+
"""
|
|
42
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
43
|
+
context.set_details('Method not implemented!')
|
|
44
|
+
raise NotImplementedError('Method not implemented!')
|
|
45
|
+
|
|
46
|
+
def Update(self, request, context):
|
|
47
|
+
"""Update a size
|
|
48
|
+
"""
|
|
49
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
50
|
+
context.set_details('Method not implemented!')
|
|
51
|
+
raise NotImplementedError('Method not implemented!')
|
|
52
|
+
|
|
53
|
+
def Delete(self, request, context):
|
|
54
|
+
"""Delete a size
|
|
55
|
+
"""
|
|
56
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
57
|
+
context.set_details('Method not implemented!')
|
|
58
|
+
raise NotImplementedError('Method not implemented!')
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def add_SizeServiceServicer_to_server(servicer, server):
|
|
62
|
+
rpc_method_handlers = {
|
|
63
|
+
'Create': grpc.unary_unary_rpc_method_handler(
|
|
64
|
+
servicer.Create,
|
|
65
|
+
request_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest.FromString,
|
|
66
|
+
response_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse.SerializeToString,
|
|
67
|
+
),
|
|
68
|
+
'Update': grpc.unary_unary_rpc_method_handler(
|
|
69
|
+
servicer.Update,
|
|
70
|
+
request_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest.FromString,
|
|
71
|
+
response_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse.SerializeToString,
|
|
72
|
+
),
|
|
73
|
+
'Delete': grpc.unary_unary_rpc_method_handler(
|
|
74
|
+
servicer.Delete,
|
|
75
|
+
request_deserializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest.FromString,
|
|
76
|
+
response_serializer=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse.SerializeToString,
|
|
77
|
+
),
|
|
78
|
+
}
|
|
79
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
80
|
+
'metalstack.admin.v2.SizeService', rpc_method_handlers)
|
|
81
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
82
|
+
server.add_registered_method_handlers('metalstack.admin.v2.SizeService', rpc_method_handlers)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# This class is part of an EXPERIMENTAL API.
|
|
86
|
+
class SizeService(object):
|
|
87
|
+
"""SizeService serves size related functions
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def Create(request,
|
|
92
|
+
target,
|
|
93
|
+
options=(),
|
|
94
|
+
channel_credentials=None,
|
|
95
|
+
call_credentials=None,
|
|
96
|
+
insecure=False,
|
|
97
|
+
compression=None,
|
|
98
|
+
wait_for_ready=None,
|
|
99
|
+
timeout=None,
|
|
100
|
+
metadata=None):
|
|
101
|
+
return grpc.experimental.unary_unary(
|
|
102
|
+
request,
|
|
103
|
+
target,
|
|
104
|
+
'/metalstack.admin.v2.SizeService/Create',
|
|
105
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest.SerializeToString,
|
|
106
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse.FromString,
|
|
107
|
+
options,
|
|
108
|
+
channel_credentials,
|
|
109
|
+
insecure,
|
|
110
|
+
call_credentials,
|
|
111
|
+
compression,
|
|
112
|
+
wait_for_ready,
|
|
113
|
+
timeout,
|
|
114
|
+
metadata,
|
|
115
|
+
_registered_method=True)
|
|
116
|
+
|
|
117
|
+
@staticmethod
|
|
118
|
+
def Update(request,
|
|
119
|
+
target,
|
|
120
|
+
options=(),
|
|
121
|
+
channel_credentials=None,
|
|
122
|
+
call_credentials=None,
|
|
123
|
+
insecure=False,
|
|
124
|
+
compression=None,
|
|
125
|
+
wait_for_ready=None,
|
|
126
|
+
timeout=None,
|
|
127
|
+
metadata=None):
|
|
128
|
+
return grpc.experimental.unary_unary(
|
|
129
|
+
request,
|
|
130
|
+
target,
|
|
131
|
+
'/metalstack.admin.v2.SizeService/Update',
|
|
132
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest.SerializeToString,
|
|
133
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse.FromString,
|
|
134
|
+
options,
|
|
135
|
+
channel_credentials,
|
|
136
|
+
insecure,
|
|
137
|
+
call_credentials,
|
|
138
|
+
compression,
|
|
139
|
+
wait_for_ready,
|
|
140
|
+
timeout,
|
|
141
|
+
metadata,
|
|
142
|
+
_registered_method=True)
|
|
143
|
+
|
|
144
|
+
@staticmethod
|
|
145
|
+
def Delete(request,
|
|
146
|
+
target,
|
|
147
|
+
options=(),
|
|
148
|
+
channel_credentials=None,
|
|
149
|
+
call_credentials=None,
|
|
150
|
+
insecure=False,
|
|
151
|
+
compression=None,
|
|
152
|
+
wait_for_ready=None,
|
|
153
|
+
timeout=None,
|
|
154
|
+
metadata=None):
|
|
155
|
+
return grpc.experimental.unary_unary(
|
|
156
|
+
request,
|
|
157
|
+
target,
|
|
158
|
+
'/metalstack.admin.v2.SizeService/Delete',
|
|
159
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest.SerializeToString,
|
|
160
|
+
metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse.FromString,
|
|
161
|
+
options,
|
|
162
|
+
channel_credentials,
|
|
163
|
+
insecure,
|
|
164
|
+
call_credentials,
|
|
165
|
+
compression,
|
|
166
|
+
wait_for_ready,
|
|
167
|
+
timeout,
|
|
168
|
+
metadata,
|
|
169
|
+
_registered_method=True)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT!
|
|
3
|
+
# source: metalstack/admin/v2/tenant.proto
|
|
4
|
+
|
|
5
|
+
from typing import Optional, Protocol, Union
|
|
6
|
+
|
|
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
|
|
14
|
+
import metalstack.admin.v2.tenant_pb2 as metalstack_dot_admin_dot_v2_dot_tenant__pb2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class TenantService(Protocol):
|
|
18
|
+
async def Create(self, req: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: ...
|
|
19
|
+
async def List(self, req: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: ...
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TenantServiceServer(ConnecpyServer):
|
|
23
|
+
def __init__(self, *, service: TenantService, server_path_prefix=""):
|
|
24
|
+
super().__init__()
|
|
25
|
+
self._prefix = f"{server_path_prefix}/metalstack.admin.v2.TenantService"
|
|
26
|
+
self._endpoints = {
|
|
27
|
+
"Create": Endpoint[metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse](
|
|
28
|
+
service_name="TenantService",
|
|
29
|
+
name="Create",
|
|
30
|
+
function=getattr(service, "Create"),
|
|
31
|
+
input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest,
|
|
32
|
+
output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse,
|
|
33
|
+
allowed_methods=("POST",),
|
|
34
|
+
),
|
|
35
|
+
"List": Endpoint[metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse](
|
|
36
|
+
service_name="TenantService",
|
|
37
|
+
name="List",
|
|
38
|
+
function=getattr(service, "List"),
|
|
39
|
+
input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest,
|
|
40
|
+
output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse,
|
|
41
|
+
allowed_methods=("POST",),
|
|
42
|
+
),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
def serviceName(self):
|
|
46
|
+
return "metalstack.admin.v2.TenantService"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class TenantServiceSync(Protocol):
|
|
50
|
+
def Create(self, req: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: ...
|
|
51
|
+
def List(self, req: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: ServiceContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: ...
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class TenantServiceServerSync(ConnecpyServer):
|
|
55
|
+
def __init__(self, *, service: TenantServiceSync, server_path_prefix=""):
|
|
56
|
+
super().__init__()
|
|
57
|
+
self._prefix = f"{server_path_prefix}/metalstack.admin.v2.TenantService"
|
|
58
|
+
self._endpoints = {
|
|
59
|
+
"Create": Endpoint[metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse](
|
|
60
|
+
service_name="TenantService",
|
|
61
|
+
name="Create",
|
|
62
|
+
function=getattr(service, "Create"),
|
|
63
|
+
input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest,
|
|
64
|
+
output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse,
|
|
65
|
+
allowed_methods=("POST",),
|
|
66
|
+
),
|
|
67
|
+
"List": Endpoint[metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse](
|
|
68
|
+
service_name="TenantService",
|
|
69
|
+
name="List",
|
|
70
|
+
function=getattr(service, "List"),
|
|
71
|
+
input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest,
|
|
72
|
+
output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse,
|
|
73
|
+
allowed_methods=("POST",),
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
def serviceName(self):
|
|
78
|
+
return "metalstack.admin.v2.TenantService"
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class TenantServiceClient(ConnecpyClient):
|
|
82
|
+
def Create(
|
|
83
|
+
self,
|
|
84
|
+
request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest,
|
|
85
|
+
*,
|
|
86
|
+
ctx: Optional[ClientContext] = None,
|
|
87
|
+
server_path_prefix: str = "",
|
|
88
|
+
**kwargs,
|
|
89
|
+
) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse:
|
|
90
|
+
method = "POST"
|
|
91
|
+
return self._make_request(
|
|
92
|
+
url=f"{server_path_prefix}/metalstack.admin.v2.TenantService/Create",
|
|
93
|
+
ctx=ctx,
|
|
94
|
+
request=request,
|
|
95
|
+
response_class=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse,
|
|
96
|
+
method=method,
|
|
97
|
+
**kwargs,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def List(
|
|
101
|
+
self,
|
|
102
|
+
request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest,
|
|
103
|
+
*,
|
|
104
|
+
ctx: Optional[ClientContext] = None,
|
|
105
|
+
server_path_prefix: str = "",
|
|
106
|
+
**kwargs,
|
|
107
|
+
) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse:
|
|
108
|
+
method = "POST"
|
|
109
|
+
return self._make_request(
|
|
110
|
+
url=f"{server_path_prefix}/metalstack.admin.v2.TenantService/List",
|
|
111
|
+
ctx=ctx,
|
|
112
|
+
request=request,
|
|
113
|
+
response_class=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse,
|
|
114
|
+
method=method,
|
|
115
|
+
**kwargs,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class AsyncTenantServiceClient(AsyncConnecpyClient):
|
|
120
|
+
async def Create(
|
|
121
|
+
self,
|
|
122
|
+
request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest,
|
|
123
|
+
*,
|
|
124
|
+
ctx: Optional[ClientContext] = None,
|
|
125
|
+
server_path_prefix: str = "",
|
|
126
|
+
session: Union[httpx.AsyncClient, None] = None,
|
|
127
|
+
**kwargs,
|
|
128
|
+
) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse:
|
|
129
|
+
method = "POST"
|
|
130
|
+
return await self._make_request(
|
|
131
|
+
url=f"{server_path_prefix}/metalstack.admin.v2.TenantService/Create",
|
|
132
|
+
ctx=ctx,
|
|
133
|
+
request=request,
|
|
134
|
+
response_class=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse,
|
|
135
|
+
method=method,
|
|
136
|
+
session=session,
|
|
137
|
+
**kwargs,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
async def List(
|
|
141
|
+
self,
|
|
142
|
+
request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest,
|
|
143
|
+
*,
|
|
144
|
+
ctx: Optional[ClientContext] = None,
|
|
145
|
+
server_path_prefix: str = "",
|
|
146
|
+
session: Union[httpx.AsyncClient, None] = None,
|
|
147
|
+
**kwargs,
|
|
148
|
+
) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse:
|
|
149
|
+
method = "POST"
|
|
150
|
+
return await self._make_request(
|
|
151
|
+
url=f"{server_path_prefix}/metalstack.admin.v2.TenantService/List",
|
|
152
|
+
ctx=ctx,
|
|
153
|
+
request=request,
|
|
154
|
+
response_class=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse,
|
|
155
|
+
method=method,
|
|
156
|
+
session=session,
|
|
157
|
+
**kwargs,
|
|
158
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: metalstack/admin/v2/tenant.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'metalstack/admin/v2/tenant.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
|
|
26
|
+
from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2
|
|
27
|
+
from metalstack.api.v2 import tenant_pb2 as metalstack_dot_api_dot_v2_dot_tenant__pb2
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/admin/v2/tenant.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1emetalstack/api/v2/tenant.proto\"\x98\x02\n\x1aTenantServiceCreateRequest\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xbaH\x06r\x04\x10\x02\x18@R\x04name\x12\x31\n\x0b\x64\x65scription\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\"\n\x05\x65mail\x18\x03 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x01R\x05\x65mail\x88\x01\x01\x12\"\n\navatar_url\x18\x04 \x01(\tH\x02R\tavatarUrl\x88\x01\x01\x12&\n\x0cphone_number\x18\x05 \x01(\tH\x03R\x0bphoneNumber\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x08\n\x06_emailB\r\n\x0b_avatar_urlB\x0f\n\r_phone_number\"P\n\x1bTenantServiceCreateResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\"\xb9\x01\n\x18TenantServiceListRequest\x12\x19\n\x05login\x18\x01 \x01(\tH\x00R\x05login\x88\x01\x01\x12\x17\n\x04name\x18\x02 \x01(\tH\x01R\x04name\x88\x01\x01\x12\x19\n\x05\x65mail\x18\x03 \x01(\tH\x02R\x05\x65mail\x88\x01\x01\x12\x31\n\x06paging\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.PagingR\x06pagingB\x08\n\x06_loginB\x07\n\x05_nameB\x08\n\x06_email\"\x80\x01\n\x19TenantServiceListResponse\x12\x33\n\x07tenants\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.TenantR\x07tenants\x12 \n\tnext_page\x18\x02 \x01(\x04H\x00R\x08nextPage\x88\x01\x01\x42\x0c\n\n_next_page2\xf2\x01\n\rTenantService\x12r\n\x06\x43reate\x12/.metalstack.admin.v2.TenantServiceCreateRequest\x1a\x30.metalstack.admin.v2.TenantServiceCreateResponse\"\x05\xd2\xf3\x18\x01\x01\x12m\n\x04List\x12-.metalstack.admin.v2.TenantServiceListRequest\x1a..metalstack.admin.v2.TenantServiceListResponse\"\x06\xd2\xf3\x18\x02\x01\x02\x42\xcf\x01\n\x17\x63om.metalstack.admin.v2B\x0bTenantProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3')
|
|
31
|
+
|
|
32
|
+
_globals = globals()
|
|
33
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
34
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.tenant_pb2', _globals)
|
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
36
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
37
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\013TenantProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2'
|
|
38
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None
|
|
39
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\006r\004\020\002\030@'
|
|
40
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None
|
|
41
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\007r\005\020\002\030\200\004'
|
|
42
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._loaded_options = None
|
|
43
|
+
_globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001'
|
|
44
|
+
_globals['_TENANTSERVICE'].methods_by_name['Create']._loaded_options = None
|
|
45
|
+
_globals['_TENANTSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001'
|
|
46
|
+
_globals['_TENANTSERVICE'].methods_by_name['List']._loaded_options = None
|
|
47
|
+
_globals['_TENANTSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002'
|
|
48
|
+
_globals['_TENANTSERVICECREATEREQUEST']._serialized_start=151
|
|
49
|
+
_globals['_TENANTSERVICECREATEREQUEST']._serialized_end=431
|
|
50
|
+
_globals['_TENANTSERVICECREATERESPONSE']._serialized_start=433
|
|
51
|
+
_globals['_TENANTSERVICECREATERESPONSE']._serialized_end=513
|
|
52
|
+
_globals['_TENANTSERVICELISTREQUEST']._serialized_start=516
|
|
53
|
+
_globals['_TENANTSERVICELISTREQUEST']._serialized_end=701
|
|
54
|
+
_globals['_TENANTSERVICELISTRESPONSE']._serialized_start=704
|
|
55
|
+
_globals['_TENANTSERVICELISTRESPONSE']._serialized_end=832
|
|
56
|
+
_globals['_TENANTSERVICE']._serialized_start=835
|
|
57
|
+
_globals['_TENANTSERVICE']._serialized_end=1077
|
|
58
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from buf.validate import validate_pb2 as _validate_pb2
|
|
2
|
+
from metalstack.api.v2 import common_pb2 as _common_pb2
|
|
3
|
+
from metalstack.api.v2 import tenant_pb2 as _tenant_pb2
|
|
4
|
+
from google.protobuf.internal import containers as _containers
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import message as _message
|
|
7
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
8
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
9
|
+
|
|
10
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
11
|
+
|
|
12
|
+
class TenantServiceCreateRequest(_message.Message):
|
|
13
|
+
__slots__ = ("name", "description", "email", "avatar_url", "phone_number")
|
|
14
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
15
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
EMAIL_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
+
AVATAR_URL_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
name: str
|
|
20
|
+
description: str
|
|
21
|
+
email: str
|
|
22
|
+
avatar_url: str
|
|
23
|
+
phone_number: str
|
|
24
|
+
def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., email: _Optional[str] = ..., avatar_url: _Optional[str] = ..., phone_number: _Optional[str] = ...) -> None: ...
|
|
25
|
+
|
|
26
|
+
class TenantServiceCreateResponse(_message.Message):
|
|
27
|
+
__slots__ = ("tenant",)
|
|
28
|
+
TENANT_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
tenant: _tenant_pb2.Tenant
|
|
30
|
+
def __init__(self, tenant: _Optional[_Union[_tenant_pb2.Tenant, _Mapping]] = ...) -> None: ...
|
|
31
|
+
|
|
32
|
+
class TenantServiceListRequest(_message.Message):
|
|
33
|
+
__slots__ = ("login", "name", "email", "paging")
|
|
34
|
+
LOGIN_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
EMAIL_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
PAGING_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
login: str
|
|
39
|
+
name: str
|
|
40
|
+
email: str
|
|
41
|
+
paging: _common_pb2.Paging
|
|
42
|
+
def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., email: _Optional[str] = ..., paging: _Optional[_Union[_common_pb2.Paging, _Mapping]] = ...) -> None: ...
|
|
43
|
+
|
|
44
|
+
class TenantServiceListResponse(_message.Message):
|
|
45
|
+
__slots__ = ("tenants", "next_page")
|
|
46
|
+
TENANTS_FIELD_NUMBER: _ClassVar[int]
|
|
47
|
+
NEXT_PAGE_FIELD_NUMBER: _ClassVar[int]
|
|
48
|
+
tenants: _containers.RepeatedCompositeFieldContainer[_tenant_pb2.Tenant]
|
|
49
|
+
next_page: int
|
|
50
|
+
def __init__(self, tenants: _Optional[_Iterable[_Union[_tenant_pb2.Tenant, _Mapping]]] = ..., next_page: _Optional[int] = ...) -> None: ...
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from metalstack.admin.v2 import tenant_pb2 as metalstack_dot_admin_dot_v2_dot_tenant__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TenantServiceStub(object):
|
|
9
|
+
"""TenantService serves tenant related functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.Create = channel.unary_unary(
|
|
19
|
+
'/metalstack.admin.v2.TenantService/Create',
|
|
20
|
+
request_serializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest.SerializeToString,
|
|
21
|
+
response_deserializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse.FromString,
|
|
22
|
+
_registered_method=True)
|
|
23
|
+
self.List = channel.unary_unary(
|
|
24
|
+
'/metalstack.admin.v2.TenantService/List',
|
|
25
|
+
request_serializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest.SerializeToString,
|
|
26
|
+
response_deserializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse.FromString,
|
|
27
|
+
_registered_method=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class TenantServiceServicer(object):
|
|
31
|
+
"""TenantService serves tenant related functions
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def Create(self, request, context):
|
|
35
|
+
"""Create a tenant
|
|
36
|
+
"""
|
|
37
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
38
|
+
context.set_details('Method not implemented!')
|
|
39
|
+
raise NotImplementedError('Method not implemented!')
|
|
40
|
+
|
|
41
|
+
def List(self, request, context):
|
|
42
|
+
"""List all tenants
|
|
43
|
+
"""
|
|
44
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
45
|
+
context.set_details('Method not implemented!')
|
|
46
|
+
raise NotImplementedError('Method not implemented!')
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def add_TenantServiceServicer_to_server(servicer, server):
|
|
50
|
+
rpc_method_handlers = {
|
|
51
|
+
'Create': grpc.unary_unary_rpc_method_handler(
|
|
52
|
+
servicer.Create,
|
|
53
|
+
request_deserializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest.FromString,
|
|
54
|
+
response_serializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse.SerializeToString,
|
|
55
|
+
),
|
|
56
|
+
'List': grpc.unary_unary_rpc_method_handler(
|
|
57
|
+
servicer.List,
|
|
58
|
+
request_deserializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest.FromString,
|
|
59
|
+
response_serializer=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse.SerializeToString,
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
63
|
+
'metalstack.admin.v2.TenantService', rpc_method_handlers)
|
|
64
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
65
|
+
server.add_registered_method_handlers('metalstack.admin.v2.TenantService', rpc_method_handlers)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# This class is part of an EXPERIMENTAL API.
|
|
69
|
+
class TenantService(object):
|
|
70
|
+
"""TenantService serves tenant related functions
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
@staticmethod
|
|
74
|
+
def Create(request,
|
|
75
|
+
target,
|
|
76
|
+
options=(),
|
|
77
|
+
channel_credentials=None,
|
|
78
|
+
call_credentials=None,
|
|
79
|
+
insecure=False,
|
|
80
|
+
compression=None,
|
|
81
|
+
wait_for_ready=None,
|
|
82
|
+
timeout=None,
|
|
83
|
+
metadata=None):
|
|
84
|
+
return grpc.experimental.unary_unary(
|
|
85
|
+
request,
|
|
86
|
+
target,
|
|
87
|
+
'/metalstack.admin.v2.TenantService/Create',
|
|
88
|
+
metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest.SerializeToString,
|
|
89
|
+
metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse.FromString,
|
|
90
|
+
options,
|
|
91
|
+
channel_credentials,
|
|
92
|
+
insecure,
|
|
93
|
+
call_credentials,
|
|
94
|
+
compression,
|
|
95
|
+
wait_for_ready,
|
|
96
|
+
timeout,
|
|
97
|
+
metadata,
|
|
98
|
+
_registered_method=True)
|
|
99
|
+
|
|
100
|
+
@staticmethod
|
|
101
|
+
def List(request,
|
|
102
|
+
target,
|
|
103
|
+
options=(),
|
|
104
|
+
channel_credentials=None,
|
|
105
|
+
call_credentials=None,
|
|
106
|
+
insecure=False,
|
|
107
|
+
compression=None,
|
|
108
|
+
wait_for_ready=None,
|
|
109
|
+
timeout=None,
|
|
110
|
+
metadata=None):
|
|
111
|
+
return grpc.experimental.unary_unary(
|
|
112
|
+
request,
|
|
113
|
+
target,
|
|
114
|
+
'/metalstack.admin.v2.TenantService/List',
|
|
115
|
+
metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest.SerializeToString,
|
|
116
|
+
metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse.FromString,
|
|
117
|
+
options,
|
|
118
|
+
channel_credentials,
|
|
119
|
+
insecure,
|
|
120
|
+
call_credentials,
|
|
121
|
+
compression,
|
|
122
|
+
wait_for_ready,
|
|
123
|
+
timeout,
|
|
124
|
+
metadata,
|
|
125
|
+
_registered_method=True)
|