syntax = "proto3";
package specs;

option go_package = "github.com/siderolabs/omni/client/api/omni/specs";

message CurrentUserSpec {
  string identity = 1;
  reserved 2;
  string role = 3;
  string user_id = 4;
}

message PermissionsSpec {
  bool can_read_clusters = 1;
  bool can_create_clusters = 2;
  bool can_manage_users = 3;
  bool can_read_machines = 4;
  bool can_remove_machines = 5;
  bool can_read_machine_logs = 6;
  bool can_read_machine_config_patches = 9;
  bool can_manage_machine_config_patches = 10;
  bool can_manage_backup_store = 11;
  bool can_access_maintenance_nodes = 12;
  bool can_read_audit_log = 13;
}

message ClusterPermissionsSpec {
  bool can_add_machines = 1;
  bool can_remove_machines = 2;
  bool can_reboot_machines = 3;
  bool can_update_kubernetes = 4;
  bool can_download_kubeconfig = 5;
  bool can_sync_kubernetes_manifests = 6;
  bool can_update_talos = 7;
  bool can_download_talosconfig = 8;
  bool can_read_config_patches = 9;
  bool can_manage_config_patches = 10;
  bool can_manage_cluster_features = 11;
  bool can_download_support_bundle = 12;
}

message LabelsCompletionSpec {
  message Values {
    repeated string items = 1;
  }

  map<string, Values> items = 1;
}

message AdvertisedEndpointsSpec {
  string grpc_api_url = 1;
}

message PlatformConfigSpec {
  enum BootMethod {
    UNKNOWN_BOOT = 0;
    DISK_IMAGE = 1;
    ISO = 2;
    PXE = 3;
  }

  enum Arch {
    UNKNOWN_ARCH = 0;
    AMD64 = 1;
    ARM64 = 2;
  }

  string label = 1;
  string description = 2;
  repeated Arch architectures = 3;
  string documentation = 4;
  string disk_image_suffix = 5;
  repeated BootMethod boot_methods = 6;
  string min_version = 7;
  bool secure_boot_supported = 8;
}

message SBCConfigSpec {
  string label = 1;
  string overlay_name = 2;
  string overlay_image = 3;
  string documentation = 4;
  string min_version = 5;
}
