Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in .proto files from ni-apis repo as a submodule #702

Merged
merged 9 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/check_nims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_party/ni-apis"]
path = third_party/ni-apis
url = https://github.com/ni/ni-apis.git

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,26 @@ class EnumerateServicesResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

AVAILABLE_SERVICES_FIELD_NUMBER: builtins.int
UNREACHABLE_FIELD_NUMBER: builtins.int
@property
def available_services(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ServiceDescriptor]:
"""The list of available services which implement the specified service interface."""

@property
def unreachable(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
"""Information about any unreachable resources. Each string in the list will be a
'ServiceDescriptor.service_class' entry for each of the unreachable resources.
To get extended information about the unreachable resources, use ResolveService
and handle the resulting error.
"""

def __init__(
self,
*,
available_services: collections.abc.Iterable[global___ServiceDescriptor] | None = ...,
unreachable: collections.abc.Iterable[builtins.str] | None = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["available_services", b"available_services"]) -> None: ...
def ClearField(self, field_name: typing.Literal["available_services", b"available_services", "unreachable", b"unreachable"]) -> None: ...

global___EnumerateServicesResponse = EnumerateServicesResponse

Expand All @@ -229,6 +239,7 @@ class ResolveServiceRequest(google.protobuf.message.Message):

PROVIDED_INTERFACE_FIELD_NUMBER: builtins.int
SERVICE_CLASS_FIELD_NUMBER: builtins.int
DEPLOYMENT_TARGET_FIELD_NUMBER: builtins.int
provided_interface: builtins.str
"""Required. This corresponds to the gRPC Full Name of the service and should match the information
that was supplied in the RegisterServiceRequest message.
Expand All @@ -237,12 +248,74 @@ class ResolveServiceRequest(google.protobuf.message.Message):
"""Optional. The service "class" that should be matched. If the value of this field is not specified and there
is more than one matching service registered, an error is returned.
"""
deployment_target: builtins.str
"""Optional. Indicates the deployment target from which the service should be resolved.
The value of this field can be obtained from the results of the EnumerateComputeNodes method.
If the value of this field is not specified, the service will be resolved from the
local deployment target. If the service cannot be resolved from the specified deployment
target, an error is returned.
"""
def __init__(
self,
*,
provided_interface: builtins.str = ...,
service_class: builtins.str = ...,
deployment_target: builtins.str = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["provided_interface", b"provided_interface", "service_class", b"service_class"]) -> None: ...
def ClearField(self, field_name: typing.Literal["deployment_target", b"deployment_target", "provided_interface", b"provided_interface", "service_class", b"service_class"]) -> None: ...

global___ResolveServiceRequest = ResolveServiceRequest

@typing.final
class ComputeNodeDescriptor(google.protobuf.message.Message):
"""Represents a location capable resolving and running a service."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

URL_FIELD_NUMBER: builtins.int
IS_LOCAL_FIELD_NUMBER: builtins.int
url: builtins.str
"""The resolvable name of the compute node."""
is_local: builtins.bool
"""indicates whether the compute node is considered the local node."""
def __init__(
self,
*,
url: builtins.str = ...,
is_local: builtins.bool = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["is_local", b"is_local", "url", b"url"]) -> None: ...

global___ComputeNodeDescriptor = ComputeNodeDescriptor

@typing.final
class EnumerateComputeNodesRequest(google.protobuf.message.Message):
"""Message sent to enumerate the compute nodes that have registered themselves in the current session."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

def __init__(
self,
) -> None: ...

global___EnumerateComputeNodesRequest = EnumerateComputeNodesRequest

@typing.final
class EnumerateComputeNodesResponse(google.protobuf.message.Message):
"""Message returned from the EnumerateComputeNodes method."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

COMPUTE_NODES_FIELD_NUMBER: builtins.int
@property
def compute_nodes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ComputeNodeDescriptor]:
"""The list of compute nodes that have registered themselves in the current session."""

def __init__(
self,
*,
compute_nodes: collections.abc.Iterable[global___ComputeNodeDescriptor] | None = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["compute_nodes", b"compute_nodes"]) -> None: ...

global___EnumerateComputeNodesResponse = EnumerateComputeNodesResponse
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def __init__(self, channel):
request_serializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.ResolveServiceRequest.SerializeToString,
response_deserializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.ServiceLocation.FromString,
)
self.EnumerateComputeNodes = channel.unary_unary(
'/ni.measurementlink.discovery.v1.DiscoveryService/EnumerateComputeNodes',
request_serializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesRequest.SerializeToString,
response_deserializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesResponse.FromString,
)


class DiscoveryServiceServicer(object):
Expand Down Expand Up @@ -89,6 +94,16 @@ def ResolveService(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def EnumerateComputeNodes(self, request, context):
"""Enumerate all compute nodes that have registered themselves in the current session.
These compute nodes are targets available for execution of services.
A compute node can be used as an argument to the ResolveService method to
get the service location for a service running on that compute node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_DiscoveryServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
Expand All @@ -112,6 +127,11 @@ def add_DiscoveryServiceServicer_to_server(servicer, server):
request_deserializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.ResolveServiceRequest.FromString,
response_serializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.ServiceLocation.SerializeToString,
),
'EnumerateComputeNodes': grpc.unary_unary_rpc_method_handler(
servicer.EnumerateComputeNodes,
request_deserializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesRequest.FromString,
response_serializer=ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ni.measurementlink.discovery.v1.DiscoveryService', rpc_method_handlers)
Expand Down Expand Up @@ -191,3 +211,20 @@ def ResolveService(request,
ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.ServiceLocation.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def EnumerateComputeNodes(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.measurementlink.discovery.v1.DiscoveryService/EnumerateComputeNodes',
ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesRequest.SerializeToString,
ni_dot_measurementlink_dot_discovery_dot_v1_dot_discovery__service__pb2.EnumerateComputeNodesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ class DiscoveryServiceStub:
- FAILED_PRECONDITION: More than one service matching the resolve request was found
"""

EnumerateComputeNodes: grpc.UnaryUnaryMultiCallable[
ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesRequest,
ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesResponse,
]
"""Enumerate all compute nodes that have registered themselves in the current session.
These compute nodes are targets available for execution of services.
A compute node can be used as an argument to the ResolveService method to
get the service location for a service running on that compute node.
"""

class DiscoveryServiceAsyncStub:
"""The service used as a registry for other services. This service can be used to discover
and activate other services present in the system.
Expand Down Expand Up @@ -120,6 +130,16 @@ class DiscoveryServiceAsyncStub:
- FAILED_PRECONDITION: More than one service matching the resolve request was found
"""

EnumerateComputeNodes: grpc.aio.UnaryUnaryMultiCallable[
ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesRequest,
ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesResponse,
]
"""Enumerate all compute nodes that have registered themselves in the current session.
These compute nodes are targets available for execution of services.
A compute node can be used as an argument to the ResolveService method to
get the service location for a service running on that compute node.
"""

class DiscoveryServiceServicer(metaclass=abc.ABCMeta):
"""The service used as a registry for other services. This service can be used to discover
and activate other services present in the system.
Expand Down Expand Up @@ -178,4 +198,16 @@ class DiscoveryServiceServicer(metaclass=abc.ABCMeta):
- FAILED_PRECONDITION: More than one service matching the resolve request was found
"""

@abc.abstractmethod
def EnumerateComputeNodes(
self,
request: ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesRequest,
context: _ServicerContext,
) -> typing.Union[ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesResponse, collections.abc.Awaitable[ni_measurementlink_discovery_v1_discovery_service_pb2.EnumerateComputeNodesResponse]]:
"""Enumerate all compute nodes that have registered themselves in the current session.
These compute nodes are targets available for execution of services.
A compute node can be used as an argument to the ResolveService method to
get the service location for a service running on that compute node.
"""

def add_DiscoveryServiceServicer_to_server(servicer: DiscoveryServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ class ConfigurationParameter(google.protobuf.message.Message):
Well-known annotations:
- Type specialization. The keys to other annotations will be read based on the value of `ni/type_specialization` annotation.
- Key: "ni/type_specialization"
- Common Values: "pin" ...
- For string parameter with ni/type_specialization annotation equals "pin"
- Key: "ni/pin.instrument_type"
- Common Values: "ioresource" ...
- For string parameter with ni/type_specialization annotation equals "ioresource", the "ni/ioresource.instrument_type" annotation will be used by UIs to limit selection of I/O to the specified instrument type.
- Key: "ni/ioresource.instrument_type"
- Common Values: "niDCPower", "niScope"...
"""

Expand Down
Loading
Loading