syntax = "proto3";

package inspect;

option go_package = "github.com/siderolabs/talos/pkg/machinery/api/inspect";
option java_package = "dev.talos.api.inspect";

import "common/common.proto";
import "google/protobuf/empty.proto";

// The inspect service definition.
//
// InspectService provides auxiliary API to inspect OS internals.
service InspectService {
  rpc ControllerRuntimeDependencies(google.protobuf.Empty) returns (ControllerRuntimeDependenciesResponse);
}

// The ControllerRuntimeDependency message contains the graph of controller-resource dependencies.
message ControllerRuntimeDependency {
  common.Metadata metadata = 1;
  repeated ControllerDependencyEdge edges = 2;
}

message ControllerRuntimeDependenciesResponse {
  repeated ControllerRuntimeDependency messages = 1;
}

enum DependencyEdgeType {
  OUTPUT_EXCLUSIVE = 0;
  OUTPUT_SHARED = 3;
  INPUT_STRONG = 1;
  INPUT_WEAK = 2;
  INPUT_DESTROY_READY = 4;
}

message ControllerDependencyEdge {
  string controller_name = 1;
  DependencyEdgeType edge_type = 2;
  string resource_namespace = 3;
  string resource_type = 4;
  string resource_id = 5;
}
