// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

syntax = "proto3";

package relay;

option go_package = "github.com/cilium/cilium/api/v1/relay";

option java_multiple_files = true;
option java_package = "io.cilium.api.relay";

// NodeStatusEvent is a message sent by hubble-relay to inform clients about
// the state of a particular node.
message NodeStatusEvent {
    // state_change contains the new node state
    NodeState state_change = 1;
    // node_names is the list of nodes for which the above state changes applies
    repeated string node_names = 2;
    // message is an optional message attached to the state change (e.g. an
    // error message). The message applies to all nodes in node_names.
    string message = 3;
}

enum NodeState {
    // UNKNOWN_NODE_STATE indicates that the state of this node is unknown.
    UNKNOWN_NODE_STATE = 0;
    // NODE_CONNECTED indicates that we have established a connection
    // to this node. The client can expect to observe flows from this node.
    NODE_CONNECTED = 1;
    // NODE_UNAVAILABLE indicates that the connection to this
    // node is currently unavailable. The client can expect to not see any
    // flows from this node until either the connection is re-established or
    // the node is gone.
    NODE_UNAVAILABLE = 2;
    // NODE_GONE indicates that a node has been removed from the
    // cluster. No reconnection attempts will be made.
    NODE_GONE = 3;
    // NODE_ERROR indicates that a node has reported an error while processing
    // the request. No reconnection attempts will be made.
    NODE_ERROR = 4;
}
