/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

package cuttlefish.cvd;

enum InstanceState {
  INSTANCE_STATE_UNSPECIFIED = 0;
  INSTANCE_STATE_PREPARING = 1;
  INSTANCE_STATE_STARTING = 2;
  INSTANCE_STATE_RUNNING = 3;
  INSTANCE_STATE_STOPPING = 4;
  INSTANCE_STATE_STOPPED = 5;
  INSTANCE_STATE_PREPARE_FAILED = 6;
  INSTANCE_STATE_BOOT_FAILED = 7;
  INSTANCE_STATE_UNREACHABLE = 8;
  INSTANCE_STATE_CANCELLED = 9;
}

message Instance {
  uint32 id = 1;
  string name = 2;
  InstanceState state = 3;
  // uint32 adb_port = 4;
  reserved 4;
  reserved "adb_port";
  string webrtc_device_id = 5;
}

message InstanceGroup {
  string name = 1;
  string home_directory = 2;
  string host_artifacts_path = 3;
  string product_out_path = 4;
  int64 start_time_sec = 5;
  repeated Instance instances = 6;
}

message PersistentData {
  repeated InstanceGroup instance_groups = 1;
  reserved 2;  // bool acloud_translator_optout
}
