syntax = "proto3";

package inspect;

option go_package = "github.com/talos-systems/talos/pkg/machinery/api/inspect";
option java_multiple_files = true;
option java_outer_classname = "InspectApi";
option java_package = "com.inspect.api";

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

// The inspect service definition.
//
// InspectService provides auxilary 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 {
    MANAGES = 0;
    STRONG = 1;
    WEAK = 2;
}

message ControllerDependencyEdge {
    string controller_name = 1;

    DependencyEdgeType edge_type = 2;

    string resource_namespace = 3;
    string resource_type = 4;
    string resource_id = 5;
}
