xref: /aosp_15_r20/external/googleapis/google/chromeos/moblab/v1beta1/resources.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.chromeos.moblab.v1beta1;
18
19import "google/api/resource.proto";
20
21option go_package = "google.golang.org/genproto/googleapis/chromeos/moblab/v1beta1;moblab";
22option java_multiple_files = true;
23option java_outer_classname = "ResourcesProto";
24option java_package = "com.google.chromeos.moblab.v1beta1";
25option optimize_for = SPEED;
26
27// Resource that represents a build target.
28// -- NEXT_TAG: 2 --
29message BuildTarget {
30  option (google.api.resource) = {
31    type: "chromeosmoblab.googleapis.com/BuildTarget"
32    pattern: "buildTargets/{build_target}"
33  };
34
35  // The resource name of the build target.
36  // Format: buildTargets/{build_target}
37  string name = 1;
38}
39
40// Resource that represents a model. Each model belongs to a build target. For
41// non-unified build, the model name is the same as its build target name.
42// -- NEXT_TAG: 2 --
43message Model {
44  option (google.api.resource) = {
45    type: "chromeosmoblab.googleapis.com/Model"
46    pattern: "buildTargets/{build_target}/models/{model}"
47  };
48
49  // The resource name of the model.
50  // Format: buildTargets/{build_target}/models/{model}
51  string name = 1;
52}
53
54// Resource that represents a chrome OS milestone.
55// -- NEXT_TAG: 2 --
56message Milestone {
57  option (google.api.resource) = {
58    type: "chromeosmoblab.googleapis.com/Milestone"
59    pattern: "milestones/{milestone}"
60  };
61
62  // The resource name of the milestone.
63  // Format: milestones/{milestone}
64  string name = 1;
65}
66
67// Resource that represents a build for the given build target, model, milestone
68// and build version.
69// -- NEXT_TAG: 9 --
70message Build {
71  option (google.api.resource) = {
72    type: "chromeosmoblab.googleapis.com/Build"
73    pattern: "buildTargets/{build_target}/models/{model}/builds/{build}"
74  };
75
76  // The build status types.
77  enum BuildStatus {
78    // No build status is specified.
79    BUILD_STATUS_UNSPECIFIED = 0;
80
81    // Complete Status: The build passed.
82    PASS = 1;
83
84    // Complete Status: The build failed.
85    FAIL = 2;
86
87    // Intermediate Status: The build is still running.
88    RUNNING = 3;
89
90    // Complete Status: The build was aborted.
91    ABORTED = 4;
92  }
93
94  // The build types.
95  enum BuildType {
96    // Invalid build type.
97    BUILD_TYPE_UNSPECIFIED = 0;
98
99    // The release build.
100    RELEASE = 1;
101
102    // The firmware build.
103    FIRMWARE = 2;
104  }
105
106  // The resource name of the build.
107  // Format: buildTargets/{build_target}/models/{model}/builds/{build}
108  // Example: buildTargets/octopus/models/bobba/builds/1234.0.0
109  string name = 1;
110
111  // The milestone that owns the build.
112  // Format: milestones/{milestone}
113  string milestone = 2 [(google.api.resource_reference) = {
114    type: "chromeosmoblab.googleapis.com/Milestone"
115  }];
116
117  // The build version of the build, e.g. 1234.0.0.
118  string build_version = 3;
119
120  // The status of the build.
121  BuildStatus status = 4;
122
123  // The type of the build.
124  BuildType type = 5;
125
126  // The branch of the build.
127  string branch = 6;
128
129  // The firmware version of the software that is flashed to the chip on the
130  // Chrome OS device.
131  string rw_firmware_version = 7;
132
133  // The labels of the build.
134  repeated string labels = 8;
135}
136
137// Resource that represents a build artifact stored in Google Cloud Storage for
138// the given build target, model, build version and bucket.
139// -- NEXT_TAG: 6 --
140message BuildArtifact {
141  option (google.api.resource) = {
142    type: "chromeosmoblab.googleapis.com/BuildArtifact"
143    pattern: "buildTargets/{build_target}/models/{model}/builds/{build}/artifacts/{artifact}"
144  };
145
146  // The resource name of the build artifact.
147  // Format:
148  // buildTargets/{build_target}/models/{model}/builds/{build}/artifacts/{artifact}
149  // Example:
150  // buildTargets/octopus/models/bobba/builds/1234.0.0/artifacts/chromeos-moblab-peng-staging
151  string name = 1;
152
153  // The build metadata of the build artifact.
154  string build = 2 [(google.api.resource_reference) = {
155    type: "chromeosmoblab.googleapis.com/Build"
156  }];
157
158  // The bucket that stores the build artifact.
159  string bucket = 3;
160
161  // The path of the build artifact in the bucket.
162  string path = 4;
163
164  // The number of objects in the build artifact folder. The object number can
165  // be used to calculated the stage progress by comparing the source build
166  // artifact with the destination build artifact.
167  uint32 object_count = 5;
168}
169