Synchronize new proto/yaml changes.

PiperOrigin-RevId: 196132290
This commit is contained in:
Google APIs 2018-05-10 10:10:13 -07:00 committed by Copybara-Service
parent b7f06f0880
commit 1f5f3990ab
5 changed files with 184 additions and 126 deletions

View File

@ -1,4 +1,4 @@
// Copyright 2017 Google Inc.
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -17,13 +17,19 @@ syntax = "proto3";
package google.devtools.remoteworkers.v1test2;
import "google/api/annotations.proto";
import "google/devtools/remoteworkers/v1test2/worker.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersBots";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Design doc: https://goo.gl/oojM5H
@ -58,14 +64,20 @@ service Bots {
// establishes a session ID to ensure that multiple machines do not register
// using the same name accidentally.
rpc CreateBotSession(CreateBotSessionRequest) returns (BotSession) {
option (google.api.http) = { post: "/v1test2/{parent=**}/botSessions" body: "bot_session" };
option (google.api.http) = {
post: "/v1test2/{parent=**}/botSessions"
body: "bot_session"
};
}
// UpdateBotSession must be called periodically by the bot (on a schedule
// determined by the server) to let the server know about its status, and to
// pick up new lease requests from the server.
rpc UpdateBotSession(UpdateBotSessionRequest) returns (BotSession) {
option (google.api.http) = { patch: "/v1test2/{name=**/botSessions/*}" body: "bot_session" };
option (google.api.http) = {
patch: "/v1test2/{name=**/botSessions/*}"
body: "bot_session"
};
}
// PostBotEventTemp may be called by the bot to indicate that some exceptional
@ -73,7 +85,10 @@ service Bots {
// revisions of this API; we may simply want to replace it with StackDriver or
// some other common interface.
rpc PostBotEventTemp(PostBotEventTempRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { post: "/v1test2/{name=**/botSessions/*}:postEvent" body: "*" };
option (google.api.http) = {
post: "/v1test2/{name=**/botSessions/*}:postEvent"
body: "*"
};
}
}
@ -208,120 +223,6 @@ message Lease {
google.protobuf.Any inline_assignment = 6;
}
// Describes a worker, which is a list of one or more devices and the
// connections between them. A device could be a computer, a phone, or even an
// accelerator like a GPU; it's up to the farm administrator to decide how to
// model their farm. For example, if a farm only has one type of GPU, the GPU
// could be modelled as a "has_gpu" property on its host computer; if it has
// many subproperties itself, it might be better to model it as a separate
// device.
//
// The first device in the worker is the "primary device" - that is, the device
// running a bot and which is responsible for actually executing commands. All
// other devices are considered to be attached devices, and must be controllable
// by the primary device.
//
// This message (and all its submessages) can be used in two contexts:
//
// * Status: sent by the bot to report the current capabilities of the device to
// allow reservation matching.
// * Request: sent by a client to request a device with certain capabilities in
// a reservation.
//
// Several of the fields in this message have different semantics depending on
// which of which of these contexts it is used. These semantics are described
// below.
//
// Several messages in Worker and its submessages have the concept of keys and
// values, such as `Worker.Property` and `Device.Property`. All keys are simple
// strings, but certain keys are "standard" keys and should be broadly supported
// across farms and implementations; these are listed below each relevant
// message. Bot implementations or farm admins may add *additional* keys, but
// these SHOULD all begin with an underscore so they do not conflict with
// standard keys that may be added in the future.
//
// Keys are not context sensitive.
//
// See http://goo.gl/NurY8g for more information on the Worker message.
message Worker {
// A global property; see the `properties` field for more information.
message Property {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * pool: different workers can be reserved for different purposes. For
// example, an admin might want to segregate long-running integration tests
// from short-running unit tests, so unit tests will always get some
// throughput. To support this, the server can assign different values for
// `pool` (such as "itest" and "utest") to different workers, and then have
// jobs request workers from those pools.
string key = 1;
// The property's value.
string value = 2;
}
// A list of devices; the first device is the primary device. See the `Device`
// message for more information.
repeated Device devices = 1;
// A worker may contain "global" properties. For example, certain machines
// might be reserved for certain types of jobs, like short-running compilation
// versus long-running integration tests. This property is known as a "pool"
// and is not related to any one device within the worker; rather, it applies
// to the worker as a whole.
//
// The behaviour of repeated keys is identical to that of Device.Property.
repeated Property properties = 2;
}
// Any device, including computers, phones, accelerators (e.g. GPUs), etc. All
// names must be unique.
message Device {
// A device property; see `properties` for more information.
message Property {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * os: a human-readable description of the OS. Examples include `linux`,
// `ubuntu` and `ubuntu 14.04` (note that a bot may advertise itself as more
// than one). This will be replaced in the future by more well-structured
// keys and values to represent OS variants.
//
// * has-docker: "true" if the bot has Docker installed. This will be
// replaced in the future by a more structured message for Docker support.
string key = 1;
// The property's value.
string value = 2;
}
// The handle can be thought of as the "name" of the device, and must be
// unique within a Worker.
//
// In the Status context, the handle should be some human-understandable name,
// perhaps corresponding to a label physically written on the device to make
// it easy to locate. In the Request context, the name should be the
// *logical* name expected by the task. The bot is responsible for mapping the
// logical name expected by the task to a machine-readable name that the task
// can actually use, such as a USB address. The method by which this mapping
// is communicated to the task is not covered in this API.
string handle = 1;
// Properties of this device that don't change based on the tasks that are
// running on it, e.g. OS, CPU architecture, etc.
//
// Keys may be repeated, and have the following interpretation:
//
// * Status context: the device can support *any* the listed values. For
// example, an "ISA" property might include "x86", "x86-64" and "sse4".
//
// * Request context: the device *must* support *all* of the listed values.
repeated Property properties = 2;
}
// AdminTemp is a prelimiary set of administration tasks. It's called "Temp"
// because we do not yet know the best way to represent admin tasks; it's
// possible that this will be entirely replaced in later versions of this API.

View File

@ -1,4 +1,4 @@
// Copyright 2017 Google Inc.
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -18,7 +18,12 @@ package google.devtools.remoteworkers.v1test2;
import "google/protobuf/duration.proto";
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersCommands";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Describes a shell-style task to execute.

View File

@ -37,7 +37,7 @@ interfaces:
# The entity_name is the name to be used as a basis for generated methods and
# classes.
collections:
- name_pattern: {unknown_path=**}/botSessions/{bot_session}
- name_pattern: "{unknown_path=**}/botSessions/{bot_session}"
entity_name: bot_session
# Definition for retryable codes.
retry_codes_def:
@ -176,9 +176,9 @@ interfaces:
# The entity_name is the name to be used as a basis for generated methods and
# classes.
collections:
- name_pattern: {unknown_path=**}/tasks/{task}
- name_pattern: "{unknown_path=**}/tasks/{task}"
entity_name: task
- name_pattern: {unknown_path=**}/tasks/{task}/result
- name_pattern: "{unknown_path=**}/tasks/{task}/result"
entity_name: task_2
# Definition for retryable codes.
retry_codes_def:

View File

@ -1,4 +1,4 @@
// Copyright 2017 Google Inc.
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,7 +21,12 @@ import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersTasks";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Design doc: https://goo.gl/oojM5H
@ -42,12 +47,17 @@ service Tasks {
// some other interface, and should be immutable once created and exposed to
// the bots.
rpc GetTask(GetTaskRequest) returns (Task) {
option (google.api.http) = { get: "/v1test2/{name=**/tasks/*}" };
option (google.api.http) = {
get: "/v1test2/{name=**/tasks/*}"
};
}
// UpdateTaskResult updates the result.
rpc UpdateTaskResult(UpdateTaskResultRequest) returns (TaskResult) {
option (google.api.http) = { patch: "/v1test2/{name=**/tasks/*/result}" body: "result" };
option (google.api.http) = {
patch: "/v1test2/{name=**/tasks/*/result}"
body: "result"
};
}
// AddTaskLog creates a new streaming log. The log is streamed and marked as
@ -55,7 +65,10 @@ service Tasks {
// by the bot if it wants to create a new log; the server can also predefine
// logs that do not need to be created (e.g. `stdout`).
rpc AddTaskLog(AddTaskLogRequest) returns (AddTaskLogResponse) {
option (google.api.http) = { post: "/v1test2/{name=**/tasks/*}:addLog" body: "*" };
option (google.api.http) = {
post: "/v1test2/{name=**/tasks/*}:addLog"
body: "*"
};
}
}

View File

@ -0,0 +1,139 @@
// Copyright 2018 Google Inc.
//
// 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 google.devtools.remoteworkers.v1test2;
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersWorker";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Describes a worker, which is a list of one or more devices and the
// connections between them. A device could be a computer, a phone, or even an
// accelerator like a GPU; it's up to the farm administrator to decide how to
// model their farm. For example, if a farm only has one type of GPU, the GPU
// could be modelled as a "has_gpu" property on its host computer; if it has
// many subproperties itself, it might be better to model it as a separate
// device.
//
// The first device in the worker is the "primary device" - that is, the device
// running a bot and which is responsible for actually executing commands. All
// other devices are considered to be attached devices, and must be controllable
// by the primary device.
//
// This message (and all its submessages) can be used in two contexts:
//
// * Status: sent by the bot to report the current capabilities of the device to
// allow reservation matching.
// * Request: sent by a client to request a device with certain capabilities in
// a reservation.
//
// Several of the fields in this message have different semantics depending on
// which of which of these contexts it is used. These semantics are described
// below.
//
// Several messages in Worker and its submessages have the concept of keys and
// values, such as `Worker.Property` and `Device.Property`. All keys are simple
// strings, but certain keys are "standard" keys and should be broadly supported
// across farms and implementations; these are listed below each relevant
// message. Bot implementations or farm admins may add *additional* keys, but
// these SHOULD all begin with an underscore so they do not conflict with
// standard keys that may be added in the future.
//
// Keys are not context sensitive.
//
// See http://goo.gl/NurY8g for more information on the Worker message.
message Worker {
// A global property; see the `properties` field for more information.
message Property {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * pool: different workers can be reserved for different purposes. For
// example, an admin might want to segregate long-running integration tests
// from short-running unit tests, so unit tests will always get some
// throughput. To support this, the server can assign different values for
// `pool` (such as "itest" and "utest") to different workers, and then have
// jobs request workers from those pools.
string key = 1;
// The property's value.
string value = 2;
}
// A list of devices; the first device is the primary device. See the `Device`
// message for more information.
repeated Device devices = 1;
// A worker may contain "global" properties. For example, certain machines
// might be reserved for certain types of jobs, like short-running compilation
// versus long-running integration tests. This property is known as a "pool"
// and is not related to any one device within the worker; rather, it applies
// to the worker as a whole.
//
// The behaviour of repeated keys is identical to that of Device.Property.
repeated Property properties = 2;
}
// Any device, including computers, phones, accelerators (e.g. GPUs), etc. All
// names must be unique.
message Device {
// A device property; see `properties` for more information.
message Property {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * os: a human-readable description of the OS. Examples include `linux`,
// `ubuntu` and `ubuntu 14.04` (note that a bot may advertise itself as more
// than one). This will be replaced in the future by more well-structured
// keys and values to represent OS variants.
//
// * has-docker: "true" if the bot has Docker installed. This will be
// replaced in the future by a more structured message for Docker support.
string key = 1;
// The property's value.
string value = 2;
}
// The handle can be thought of as the "name" of the device, and must be
// unique within a Worker.
//
// In the Status context, the handle should be some human-understandable name,
// perhaps corresponding to a label physically written on the device to make
// it easy to locate. In the Request context, the name should be the
// *logical* name expected by the task. The bot is responsible for mapping the
// logical name expected by the task to a machine-readable name that the task
// can actually use, such as a USB address. The method by which this mapping
// is communicated to the task is not covered in this API.
string handle = 1;
// Properties of this device that don't change based on the tasks that are
// running on it, e.g. OS, CPU architecture, etc.
//
// Keys may be repeated, and have the following interpretation:
//
// * Status context: the device can support *any* the listed values. For
// example, an "ISA" property might include "x86", "x86-64" and "sse4".
//
// * Request context: the device *must* support *all* of the listed values.
repeated Property properties = 2;
}