// Copyright 2021 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

package chromiumos.test.api;

option go_package = "go.chromium.org/chromiumos/config/go/test/api";

import "chromiumos/test/lab/api/dut.proto";
import "chromiumos/test/api/provision_state.proto";
import "chromiumos/test/api/provision_service.proto";

message ProvisionCliInput {
  repeated DutInput dut_inputs = 1;
}

message DutInput {
  reserved 2;

  chromiumos.test.lab.api.Dut.Id id = 1;
  // Provision state is pass through request to the provision service.
  ProvisionState provision_state = 3;

  // Docker image info used to pull DUT service.
  DockerImage dut_service = 4;
  // Docker image info used to pull provision service.
  DockerImage provision_service = 5;

  message DockerImage {
    // If not specified then used default.
    string repository_path = 1;
    // If not specified then used 'latest'.
    string tag = 2;
  }
}

message ProvisionCliOutput {
  repeated DutOutput dut_outputs = 1;
}

message DutOutput {
  chromiumos.test.lab.api.Dut.Id id = 1;
  // Outcome represents the result of performing provisioning on the DUT.
  oneof outcome {
    InstallSuccess success = 2;
    InstallFailure failure = 3;
  }
}
