Skip to content

Commit 49f5574

Browse files
committed
Add Discovery service
1 parent 8c47d31 commit 49f5574

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ clone-proto:
44

55
gen:
66
cd plugin-pb && git pull && cd ..
7+
8+
mkdir -p ./protos/cloudquery/plugin_v3
79
cp ./plugin-pb/plugin/v3/*.proto ./protos/cloudquery/plugin_v3/.
810
python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/plugin_v3/*.proto
911

12+
mkdir -p ./protos/cloudquery/discovery_v1
13+
cp ./plugin-pb/discovery/v1/*.proto ./protos/cloudquery/discovery_v1/.
14+
python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/discovery_v1/*.proto

cloudquery/discovery_v1/discovery_pb2.py

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from google.protobuf.internal import containers as _containers
2+
from google.protobuf import descriptor as _descriptor
3+
from google.protobuf import message as _message
4+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Optional as _Optional
5+
6+
DESCRIPTOR: _descriptor.FileDescriptor
7+
8+
class GetVersions(_message.Message):
9+
__slots__ = []
10+
class Request(_message.Message):
11+
__slots__ = []
12+
def __init__(self) -> None: ...
13+
class Response(_message.Message):
14+
__slots__ = ["versions"]
15+
VERSIONS_FIELD_NUMBER: _ClassVar[int]
16+
versions: _containers.RepeatedScalarFieldContainer[int]
17+
def __init__(self, versions: _Optional[_Iterable[int]] = ...) -> None: ...
18+
def __init__(self) -> None: ...
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 cloudquery.discovery_v1 import discovery_pb2 as cloudquery_dot_discovery__v1_dot_discovery__pb2
6+
7+
8+
class DiscoveryStub(object):
9+
"""Missing associated documentation comment in .proto file."""
10+
11+
def __init__(self, channel):
12+
"""Constructor.
13+
14+
Args:
15+
channel: A grpc.Channel.
16+
"""
17+
self.GetVersions = channel.unary_unary(
18+
'/cloudquery.discovery.v1.Discovery/GetVersions',
19+
request_serializer=cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Request.SerializeToString,
20+
response_deserializer=cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Response.FromString,
21+
)
22+
23+
24+
class DiscoveryServicer(object):
25+
"""Missing associated documentation comment in .proto file."""
26+
27+
def GetVersions(self, request, context):
28+
"""Get the name of the plugin
29+
"""
30+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
31+
context.set_details('Method not implemented!')
32+
raise NotImplementedError('Method not implemented!')
33+
34+
35+
def add_DiscoveryServicer_to_server(servicer, server):
36+
rpc_method_handlers = {
37+
'GetVersions': grpc.unary_unary_rpc_method_handler(
38+
servicer.GetVersions,
39+
request_deserializer=cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Request.FromString,
40+
response_serializer=cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Response.SerializeToString,
41+
),
42+
}
43+
generic_handler = grpc.method_handlers_generic_handler(
44+
'cloudquery.discovery.v1.Discovery', rpc_method_handlers)
45+
server.add_generic_rpc_handlers((generic_handler,))
46+
47+
48+
# This class is part of an EXPERIMENTAL API.
49+
class Discovery(object):
50+
"""Missing associated documentation comment in .proto file."""
51+
52+
@staticmethod
53+
def GetVersions(request,
54+
target,
55+
options=(),
56+
channel_credentials=None,
57+
call_credentials=None,
58+
insecure=False,
59+
compression=None,
60+
wait_for_ready=None,
61+
timeout=None,
62+
metadata=None):
63+
return grpc.experimental.unary_unary(request, target, '/cloudquery.discovery.v1.Discovery/GetVersions',
64+
cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Request.SerializeToString,
65+
cloudquery_dot_discovery__v1_dot_discovery__pb2.GetVersions.Response.FromString,
66+
options, channel_credentials,
67+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

0 commit comments

Comments
 (0)