• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2024 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto3";
6
7package chromiumos.test.lab.api.passport;
8
9option go_package = "go.chromium.org/chromiumos/config/go/test/lab/api/passport";
10
11// SwitchService is a service which controls a set of physical switches connected to a
12// dedicated host. These switches are used to disable/enable individual peripheral components
13// at runtime.
14service SwitchService {
15    // GetSwitches probes all connected switches to the host device.
16    rpc GetSwitches(GetSwitchesRequest) returns (GetSwitchesResponse) {}
17
18    // ResetAllSwitches re-initializes all found switches and sets them to the "disabled" state.
19    rpc ResetAllSwitches(ResetAllSwitchesRequest) returns (ResetAllSwitchesResponse) {}
20
21    // ConfigureSwitchPort configures a single port on a switch.
22    rpc ConfigureSwitchPort(ConfigureSwitchPortRequest) returns (ConfigureSwitchPortResponse) {}
23}
24
25// SwitchFixture represents a switch connected to a host.
26message SwitchFixture{
27    // The switches unique Id.
28    string id = 1;
29}
30
31message GetSwitchesRequest{}
32message GetSwitchesResponse{
33    // The probed switches.
34    repeated SwitchFixture switches = 1;
35}
36
37message ResetAllSwitchesRequest{}
38message ResetAllSwitchesResponse{}
39
40// A switches state or action to be applied to the switch.
41enum SwitchPortState {
42    // Default, the switch port is in an "unknown" state.
43    SWITCH_PORT_UNKNOWN = 0;
44    // The switch port is disabled.
45    SWITCH_PORT_DISABLED = 1;
46    // The switch port is enabled.
47    SWITCH_PORT_ENABLED = 2;
48    // The switch port orientation should be "flipped" (only supported for symmetrical swiches e.g. USBC).
49    // Note: This isn't a detectable state as much as it is an "action"
50    SWITCH_PORT_FLIP = 3;
51}
52
53message ConfigureSwitchPortRequest{
54    // The unique switch ID to be configured.
55    string switch_id = 1;
56    // The requested state to be applied to the switch.
57    SwitchPortState state = 2;
58}
59
60message ConfigureSwitchPortResponse{}