# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from nebius.api.nebius.compute.v1 import node_service_pb2 as nebius_dot_compute_dot_v1_dot_node__service__pb2


class NodeServiceStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.SetUnhealthy = channel.unary_unary(
                '/nebius.compute.v1.NodeService/SetUnhealthy',
                request_serializer=nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyRequest.SerializeToString,
                response_deserializer=nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyResponse.FromString,
                )


class NodeServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def SetUnhealthy(self, request, context):
        """SetUnhealthy marks the node underlying the Compute VM as unhealthy, which has the following effect:

        1. Scheduler makes the best effort not to assign new VMs to the unhealthy node,
        but in case of no capacity, the VM can be assigned to an unhealthy node.
        2. The existing VMs continue to work on the node, but after stop/start via
        Compute API they most probably will be assigned to a different node.

        To use this rpc one needs to obtain `compute.node.setUnhealthy` permission
        for the VM's parent container. The permission is granted to the TSA inside the VM.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_NodeServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetUnhealthy': grpc.unary_unary_rpc_method_handler(
                    servicer.SetUnhealthy,
                    request_deserializer=nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyRequest.FromString,
                    response_serializer=nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nebius.compute.v1.NodeService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class NodeService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def SetUnhealthy(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, '/nebius.compute.v1.NodeService/SetUnhealthy',
            nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyRequest.SerializeToString,
            nebius_dot_compute_dot_v1_dot_node__service__pb2.NodeSetUnhealthyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
