1// Copyright 2020 The Cirq Developers
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 cirq.google.engine.client.quantum_v1alpha1.proto;
18
19import "google/api/resource.proto";
20import "google/protobuf/any.proto";
21import "google/protobuf/duration.proto";
22import "google/protobuf/field_mask.proto";
23import "google/protobuf/timestamp.proto";
24
25option go_package = "google.golang.org/genproto/googleapis/cloud/quantum/v1alpha1;quantum";
26option java_package = "com.google.cloud.quantum.engine.v1alpha1";
27
28// -
29
30// -
31message QuantumProgram {
32  // -
33  string name = 1;
34
35  // -
36  .google.protobuf.Timestamp create_time = 2;
37
38  // -
39  .google.protobuf.Timestamp update_time = 3;
40
41  // -
42  map<string, string> labels = 4;
43
44  // -
45  string label_fingerprint = 5;
46
47  // -
48  string description = 6;
49
50  // -
51  oneof code_location {
52    // -
53    GcsLocation gcs_code_location = 7 [deprecated = true];
54
55    // -
56    InlineData code_inline_data = 9;
57  }
58
59  // -
60  .google.protobuf.Any code = 8;
61}
62
63// -
64message QuantumJob {
65  // -
66  string name = 1;
67
68  // -
69  .google.protobuf.Timestamp create_time = 2;
70
71  // -
72  .google.protobuf.Timestamp update_time = 3;
73
74  // -
75  map<string, string> labels = 4;
76
77  // -
78  string label_fingerprint = 5;
79
80  // -
81  string description = 6;
82
83  // -
84  SchedulingConfig scheduling_config = 7;
85
86  // -
87  OutputConfig output_config = 8 [deprecated = true];
88
89  // -
90  ExecutionStatus execution_status = 9;
91
92  // -
93  oneof run_context_location {
94    // -
95    GcsLocation gcs_run_context_location = 10 [deprecated = true];
96
97    // -
98    InlineData run_context_inline_data = 12;
99  }
100
101  // -
102  .google.protobuf.Any run_context = 11;
103}
104
105// -
106message SchedulingConfig {
107  // -
108  message ProcessorSelector {
109    // -
110    repeated string processor_names = 1;
111  }
112
113  // -
114  string target_route = 1 [deprecated = true];
115
116  // -
117  ProcessorSelector processor_selector = 3;
118
119  // -
120  int32 priority = 2;
121}
122
123// -
124message ExecutionStatus {
125  // -
126  message Failure {
127    // -
128    enum Code {
129      // -
130      CODE_UNSPECIFIED = 0;
131
132      // -
133      SYSTEM_ERROR = 1;
134
135      // -
136      INVALID_PROGRAM = 2;
137
138      // -
139      INVALID_RUN_CONTEXT = 3;
140
141      // -
142      READ_PROGRAM_NOT_FOUND_IN_GCS = 4 [deprecated = true];
143
144      // -
145      READ_PROGRAM_PERMISSION_DENIED = 5 [deprecated = true];
146
147      // -
148      READ_PROGRAM_UNKNOWN_ERROR = 6 [deprecated = true];
149
150      // -
151      READ_RUN_CONTEXT_NOT_FOUND_IN_GCS = 7 [deprecated = true];
152
153      // -
154      READ_RUN_CONTEXT_PERMISSION_DENIED = 8 [deprecated = true];
155
156      // -
157      READ_RUN_CONTEXT_UNKNOWN_ERROR = 9 [deprecated = true];
158
159      // -
160      WRITE_RESULT_ALREADY_EXISTS_IN_GCS = 10;
161
162      // -
163      WRITE_RESULT_GCS_PERMISSION_DENIED = 11;
164
165      // -
166      SCHEDULING_EXPIRED = 14;
167    }
168
169    // -
170    Code error_code = 1;
171
172    // -
173    string error_message = 2;
174  }
175
176  // -
177  enum State {
178    // -
179    STATE_UNSPECIFIED = 0;
180
181    // -
182    READY = 1;
183
184    // -
185    RUNNING = 2;
186
187    // -
188    CANCELLING = 3;
189
190    // -
191    CANCELLED = 4;
192
193    // -
194    SUCCESS = 5;
195
196    // -
197    FAILURE = 6;
198  }
199
200  // -
201  State state = 1;
202
203  // -
204  string processor_name = 3;
205
206  // -
207  string calibration_name = 4;
208
209  // -
210  Failure failure = 5;
211}
212
213// -
214message OutputConfig {
215  // -
216  oneof output_destination {
217    // -
218    GcsLocation gcs_results_location = 1;
219  }
220
221  // -
222  bool overwrite_existing = 2;
223}
224
225// -
226message GcsLocation {
227  // -
228  string uri = 1;
229
230  // -
231  string type_url = 2;
232}
233
234// -
235message InlineData {
236  // -
237  string type_url = 1;
238}
239
240// -
241message QuantumJobEvent {
242  // -
243  .google.protobuf.Timestamp event_time = 1;
244
245  // -
246  QuantumJob job = 2;
247
248  // -
249  .google.protobuf.FieldMask modified_field_mask = 3;
250}
251
252// -
253message QuantumResult {
254  // -
255  string parent = 1;
256
257  // -
258  .google.protobuf.Any result = 2;
259}
260
261// -
262message QuantumProcessor {
263  option (.google.api.resource) = {
264    type: "quantum.googleapis.com/QuantumProcessor"
265    pattern: "projects/{project_id}/processors/{processor_id}"
266  };
267
268  // -
269  enum Health {
270    // -
271    HEALTH_UNSPECIFIED = 0;
272
273    // -
274    OK = 1;
275
276    // -
277    DOWN = 2;
278
279    // -
280    UNAVAILABLE = 3;
281  }
282
283  // -
284  string name = 1;
285
286  // -
287  Health health = 3;
288
289  // -
290  .google.protobuf.Timestamp expected_down_time = 7;
291
292  // -
293  .google.protobuf.Timestamp expected_recovery_time = 4;
294
295  // -
296  repeated string supported_languages = 5;
297
298  // -
299  .google.protobuf.Any device_spec = 6;
300
301  // -
302  .google.protobuf.Duration schedule_horizon = 8;
303
304  // -
305  .google.protobuf.Duration schedule_frozen_period = 9;
306}
307
308// -
309message QuantumCalibration {
310  // -
311  string name = 1;
312
313  // -
314  .google.protobuf.Timestamp timestamp = 2;
315
316  // -
317  .google.protobuf.Any data = 3;
318}
319
320// -
321message QuantumReservationGrant {
322  // -
323  message Budget {
324    // -
325    string project_id = 1;
326
327    // -
328    .google.protobuf.Duration granted_duration = 2;
329
330    // -
331    .google.protobuf.Duration available_duration = 3;
332  }
333
334  // -
335  string name = 1;
336
337  // -
338  repeated string processor_names = 2;
339
340  // -
341  .google.protobuf.Timestamp effective_time = 3;
342
343  // -
344  .google.protobuf.Timestamp expire_time = 4;
345
346  // -
347  .google.protobuf.Duration granted_duration = 5;
348
349  // -
350  .google.protobuf.Duration available_duration = 6;
351
352  // -
353  repeated Budget budgets = 7;
354}
355
356// -
357message QuantumReservationBudget {
358  // -
359  string name = 1;
360
361  // -
362  repeated string processor_names = 2;
363
364  // -
365  .google.protobuf.Timestamp effective_time = 3;
366
367  // -
368  .google.protobuf.Timestamp expire_time = 4;
369
370  // -
371  .google.protobuf.Duration granted_duration = 5;
372
373  // -
374  .google.protobuf.Duration available_duration = 6;
375}
376
377// -
378message QuantumTimeSlot {
379  // -
380  message ReservationConfig {
381    // -
382    string project_id = 1;
383  }
384
385  // -
386  message MaintenanceConfig {
387    // -
388    string title = 1;
389
390    // -
391    string description = 2;
392  }
393
394  // -
395  enum TimeSlotType {
396    // -
397    TIME_SLOT_TYPE_UNSPECIFIED = 0;
398
399    // -
400    MAINTENANCE = 1;
401
402    // -
403    OPEN_SWIM = 2;
404
405    // -
406    RESERVATION = 3;
407
408    // -
409    UNALLOCATED = 4;
410  }
411
412  // -
413  string processor_name = 1;
414
415  // -
416  .google.protobuf.Timestamp start_time = 2;
417
418  // -
419  .google.protobuf.Timestamp end_time = 3;
420
421  // -
422  TimeSlotType slot_type = 5;
423
424  // -
425  oneof type_config {
426    // -
427    ReservationConfig reservation_config = 6;
428
429    // -
430    MaintenanceConfig maintenance_config = 7;
431  }
432}
433
434// -
435message QuantumReservation {
436  // -
437  string name = 1;
438
439  // -
440  .google.protobuf.Timestamp start_time = 2;
441
442  // -
443  .google.protobuf.Timestamp end_time = 3;
444
445  // -
446  .google.protobuf.Timestamp cancelled_time = 4;
447
448  // -
449  repeated string whitelisted_users = 5;
450}
451