Initial commit

This commit is contained in:
pasketti
2026-04-05 16:14:49 -04:00
commit ebee3a5534
14059 changed files with 2588797 additions and 0 deletions

View File

@@ -0,0 +1,186 @@
// Copyright 2017 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.build.v1;
import "google/api/annotations.proto";
import "google/devtools/build/v1/build_status.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
option java_multiple_files = true;
option java_outer_classname = "BuildEventProto";
option java_package = "com.google.devtools.build.v1";
// An event representing some state change that occured in the build. This
// message does not include field for uniquely identifying an event.
message BuildEvent {
// Notification that the build system has attempted to run the build tool.
message InvocationAttemptStarted {
// The number of the invocation attempt, starting at 1 and increasing by 1
// for each new attempt. Can be used to determine if there is a later
// invocation attempt replacing the current one a client is processing.
int64 attempt_number = 1;
}
// Notification that an invocation attempt has finished.
message InvocationAttemptFinished {
// The exit code of the build tool.
google.protobuf.Int32Value exit_code = 2;
// Final status of the invocation.
BuildStatus invocation_status = 3;
}
// Notification that the build request is enqueued. It could happen when
// a new build request is inserted into the build queue, or when a
// build request is put back into the build queue due to a previous build
// failure.
message BuildEnqueued {
}
// Notification that the build request has finished, and no further
// invocations will occur. Note that this applies to the entire Build.
// Individual invocations trigger InvocationFinished when they finish.
message BuildFinished {
// Final status of the build.
BuildStatus status = 1;
}
// Textual output written to standard output or standard error.
message ConsoleOutput {
// The output stream type.
ConsoleOutputStream type = 1;
// The output stream content.
oneof output {
// Regular UTF-8 output; normal text.
string text_output = 2;
// Used if the output is not UTF-8 text (for example, a binary proto).
bytes binary_output = 3;
}
}
// Notification of the end of a build event stream published by a build
// component other than CONTROLLER (See StreamId.BuildComponents).
message BuildComponentStreamFinished {
// How did the event stream finish.
enum FinishType {
// Unknown or unspecified; callers should never set this value.
FINISH_TYPE_UNSPECIFIED = 0;
// Set by the event publisher to indicate a build event stream is
// finished.
FINISHED = 1;
// Set by the WatchBuild RPC server when the publisher of a build event
// stream stops publishing events without publishing a
// BuildComponentStreamFinished event whose type equals FINISHED.
EXPIRED = 2;
}
// How the event stream finished.
FinishType type = 1;
}
// The timestamp of this event.
google.protobuf.Timestamp event_time = 1;
// //////////////////////////////////////////////////////////////////////////
// Events that indicate a state change of a build request in the build
// queue.
oneof event {
// An invocation attempt has started.
InvocationAttemptStarted invocation_attempt_started = 51;
// An invocation attempt has finished.
InvocationAttemptFinished invocation_attempt_finished = 52;
// The build is enqueued (just inserted to the build queue or put back
// into the build queue due to a previous build failure).
BuildEnqueued build_enqueued = 53;
// The build has finished. Set when the build is terminated.
BuildFinished build_finished = 55;
// An event containing printed text.
ConsoleOutput console_output = 56;
// Indicates the end of a build event stream (with the same StreamId) from
// a build component executing the requested build task.
// *** This field does not indicate the WatchBuild RPC is finished. ***
BuildComponentStreamFinished component_stream_finished = 59;
// Structured build event generated by Bazel about its execution progress.
google.protobuf.Any bazel_event = 60;
// An event that contains supplemental tool-specific information about
// build execution.
google.protobuf.Any build_execution_event = 61;
// An event that contains supplemental tool-specific information about
// source fetching.
google.protobuf.Any source_fetch_event = 62;
}
}
// Unique identifier for a build event stream.
message StreamId {
// Which build component generates this event stream. Each build component
// may generate one event stream.
enum BuildComponent {
// Unknown or unspecified; callers should never set this value.
UNKNOWN_COMPONENT = 0;
// A component that coordinates builds.
CONTROLLER = 1;
// A component that runs executables needed to complete a build.
WORKER = 2;
// A component that builds something.
TOOL = 3;
}
// The id of a Build message.
string build_id = 1;
// The unique invocation ID within this build.
// It should be the same as {invocation} (below) during the migration.
string invocation_id = 6;
// The component that emitted this event.
BuildComponent component = 3;
}
// The type of console output stream.
enum ConsoleOutputStream {
// Unspecified or unknown.
UNKNOWN = 0;
// Normal output stream.
STDOUT = 1;
// Error output stream.
STDERR = 2;
}

View File

@@ -0,0 +1,66 @@
// Copyright 2017 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.build.v1;
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
option java_multiple_files = true;
option java_outer_classname = "BuildStatusProto";
option java_package = "com.google.devtools.build.v1";
// Status used for both invocation attempt and overall build completion.
message BuildStatus {
// The end result of the Build.
enum Result {
// Unspecified or unknown.
UNKNOWN_STATUS = 0;
// Build was successful and tests (if requested) all pass.
COMMAND_SUCCEEDED = 1;
// Build error and/or test failure.
COMMAND_FAILED = 2;
// Unable to obtain a result due to input provided by the user.
USER_ERROR = 3;
// Unable to obtain a result due to a failure within the build system.
SYSTEM_ERROR = 4;
// Build required too many resources, such as build tool RAM.
RESOURCE_EXHAUSTED = 5;
// An invocation attempt time exceeded its deadline.
INVOCATION_DEADLINE_EXCEEDED = 6;
// Build request time exceeded the request_deadline
REQUEST_DEADLINE_EXCEEDED = 8;
// The build was cancelled by a call to CancelBuild.
CANCELLED = 7;
}
// The end result.
Result result = 1;
// Fine-grained diagnostic information to complement the status.
google.protobuf.Any details = 2;
}

View File

@@ -0,0 +1,160 @@
// Copyright 2017 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.build.v1;
import "google/api/annotations.proto";
import "google/devtools/build/v1/build_events.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
option java_multiple_files = true;
option java_outer_classname = "BackendProto";
option java_package = "com.google.devtools.build.v1";
// A service for publishing BuildEvents. BuildEvents are generated by Build
// Systems to record actions taken during a Build. Events occur in streams,
// are identified by a StreamId, and ordered by sequence number in a stream.
//
// A Build may contain several streams of BuildEvents, depending on the systems
// that are involved in the Build. Some BuildEvents are used to declare the
// beginning and end of major portions of a Build; these are called
// LifecycleEvents, and are used (for example) to indicate the beginning or end
// of a Build, and the beginning or end of an Invocation attempt (there can be
// more than 1 Invocation in a Build if, for example, a failure occurs somewhere
// and it needs to be retried).
//
// Other, build-tool events represent actions taken by the Build tool, such as
// target objects produced via compilation, tests run, et cetera. There could be
// more than one build tool stream for an invocation attempt of a build.
service PublishBuildEvent {
// Publish a build event stating the new state of a build (typically from the
// build queue). If the event is a BuildEnqueued event, also register the new
// build request ID and its build type to BES.
//
// The backend will persist the event and deliver it to registered frontend
// jobs immediately without batching.
//
// The commit status of the request is reported by the RPC's util_status()
// function. The error code is the canoncial error code defined in
// //util/task/codes.proto.
rpc PublishLifecycleEvent(PublishLifecycleEventRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { post: "/v1/lifecycleEvents:publish" body: "*" };
}
// Publish build tool events belonging to the same stream to a backend job
// using bidirectional streaming.
rpc PublishBuildToolEventStream(stream OrderedBuildEvent) returns (stream PublishBuildToolEventStreamResponse) {
option (google.api.http) = { post: "/v1/events:publish" body: "*" };
}
}
// Publishes 'lifecycle events' that update the high-level state of a build:
// - BuildEnqueued: When a build is scheduled.
// - InvocationAttemptStarted: When work for a build starts; there can be
// multiple invocations for a build (e.g. retries).
// - InvocationAttemptCompleted: When work for a build finishes.
// - BuildFinished: When a build is finished.
message PublishLifecycleEventRequest {
// The service level of the build request. Backends only uses this value when
// the BuildEnqueued event is published to determine what level of service
// this build should receive.
enum ServiceLevel {
// Non-interactive builds can tolerate longer event latencies. This is the
// default ServiceLevel if callers do not specify one.
NONINTERACTIVE = 0;
// The events of an interactive build should be delivered with low latency.
INTERACTIVE = 1;
}
// The interactivity of this build.
ServiceLevel service_level = 1;
// The lifecycle build event. If this is a build tool event, the RPC will fail
// with INVALID_REQUEST.
OrderedBuildEvent build_event = 2;
// If the next event for this build or invocation (depending on the event
// type) hasn't been published after this duration from when {build_event}
// is written to BES, consider this stream expired. If this field is not set,
// BES backend will use its own default value.
google.protobuf.Duration stream_timeout = 3;
// Additional information about a build request. These are define by the event
// publishers, and the Build Event Service does not validate or interpret
// them. They are used while notifying internal systems of new builds and
// invocations if the OrderedBuildEvent.event type is
// BuildEnqueued/InvocationAttemptStarted.
repeated string notification_keywords = 4;
// This field identifies which project (if any) the build is associated with.
string project_id = 6;
}
// States which event has been committed. Any failure to commit will cause
// RPC errors, hence not recorded by this proto.
message PublishBuildToolEventStreamResponse {
// The stream that contains this event.
StreamId stream_id = 1;
// The sequence number of this event that has been committed.
int64 sequence_number = 2;
}
// Build event with contextual information about the stream it belongs to and
// its position in that stream.
message OrderedBuildEvent {
// Which build event stream this event belongs to.
StreamId stream_id = 1;
// The position of this event in the stream. The sequence numbers for a build
// event stream should be a sequence of consecutive natural numbers starting
// from one. (1, 2, 3, ...)
int64 sequence_number = 2;
// The actual event.
BuildEvent event = 3;
}
message PublishBuildToolEventStreamRequest {
// The fist 3 fields are identical to OrderedBuildEvent so we can have wire-
// compatibility when migrating BES publishers.
// Which build event stream this event belongs to.
google.devtools.build.v1.StreamId stream_id = 1 [deprecated = true];
// The position of this event in the stream. The sequence numbers for a build
// event stream should be a sequence of consecutive natural numbers starting
// from one. (1, 2, 3, ...)
int64 sequence_number = 2 [deprecated = true];
// The actual event.
google.devtools.build.v1.BuildEvent event = 3 [deprecated = true];
// The build event with position info.
// New publishing clients should use this field rather than the 3 above.
OrderedBuildEvent ordered_build_event = 4;
// The keywords to be attached to the notification which notifies the start
// of a new build event stream. BES only reads this field when sequence_number
// or ordered_build_event.sequence_number is 1 in this message. If this field
// is empty, BES will not publish notification messages for this stream.
repeated string notification_keywords = 5;
}

View File

@@ -0,0 +1,769 @@
// Copyright 2017 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.cloudbuild.v1;
import "google/api/annotations.proto";
import "google/cloud/audit/audit_log.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild";
option java_multiple_files = true;
option java_package = "com.google.cloudbuild.v1";
option objc_class_prefix = "GCB";
// Manages container image build requests in the cloud.
//
// The main concept used by this API is a Build, which describes the location of
// the source to build, how to build the source into a container image, and what
// tag to apply to the built image when it is pushed to Google Container
// Registry.
//
// A user can list previously-requested builds or get builds by their ID to
// determine the status of the build.
service CloudBuild {
// Starts a build with the specified configuration.
//
// The long-running Operation returned by this method will include the ID of
// the build, which can be passed to GetBuild to determine its status (e.g.,
// success or failure).
rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/projects/{project_id}/builds" body: "build" };
}
// Returns information about a previously requested build.
//
// The Build that is returned includes its status (e.g., success or failure,
// or in-progress), and timing information.
rpc GetBuild(GetBuildRequest) returns (Build) {
option (google.api.http) = { get: "/v1/projects/{project_id}/builds/{id}" };
}
// Lists previously requested builds.
//
// Previously requested builds may still be in-progress, or may have finished
// successfully or unsuccessfully.
rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) {
option (google.api.http) = { get: "/v1/projects/{project_id}/builds" };
}
// Cancels a requested build in progress.
rpc CancelBuild(CancelBuildRequest) returns (Build) {
option (google.api.http) = { post: "/v1/projects/{project_id}/builds/{id}:cancel" body: "*" };
}
// Creates a new build based on the given build.
//
// This API creates a new build using the original build request, which may
// or may not result in an identical build.
//
// For triggered builds:
//
// * Triggered builds resolve to a precise revision, so a retry of a triggered
// build will result in a build that uses the same revision.
//
// For non-triggered builds that specify RepoSource:
//
// * If the original build built from the tip of a branch, the retried build
// will build from the tip of that branch, which may not be the same revision
// as the original build.
// * If the original build specified a commit sha or revision ID, the retried
// build will use the identical source.
//
// For builds that specify StorageSource:
//
// * If the original build pulled source from Cloud Storage without specifying
// the generation of the object, the new build will use the current object,
// which may be different from the original build source.
// * If the original build pulled source from Cloud Storage and specified the
// generation of the object, the new build will attempt to use the same
// object, which may or may not be available depending on the bucket's
// lifecycle management settings.
rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/projects/{project_id}/builds/{id}:retry" body: "*" };
}
// Creates a new BuildTrigger.
//
// This API is experimental.
rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) {
option (google.api.http) = { post: "/v1/projects/{project_id}/triggers" body: "trigger" };
}
// Gets information about a BuildTrigger.
//
// This API is experimental.
rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) {
option (google.api.http) = { get: "/v1/projects/{project_id}/triggers/{trigger_id}" };
}
// Lists existing BuildTrigger.
//
// This API is experimental.
rpc ListBuildTriggers(ListBuildTriggersRequest) returns (ListBuildTriggersResponse) {
option (google.api.http) = { get: "/v1/projects/{project_id}/triggers" };
}
// Deletes an BuildTrigger by its project ID and trigger ID.
//
// This API is experimental.
rpc DeleteBuildTrigger(DeleteBuildTriggerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/projects/{project_id}/triggers/{trigger_id}" };
}
// Updates an BuildTrigger by its project ID and trigger ID.
//
// This API is experimental.
rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) {
option (google.api.http) = { patch: "/v1/projects/{project_id}/triggers/{trigger_id}" body: "trigger" };
}
// Runs a BuildTrigger at a particular source revision.
rpc RunBuildTrigger(RunBuildTriggerRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1/projects/{project_id}/triggers/{trigger_id}:run" body: "source" };
}
}
// RetryBuildRequest specifies a build to retry.
message RetryBuildRequest {
// ID of the project.
string project_id = 1;
// Build ID of the original build.
string id = 2;
}
// RunBuildTriggerRequest specifies a build trigger to run and the source to
// use.
message RunBuildTriggerRequest {
// ID of the project.
string project_id = 1;
// ID of the trigger.
string trigger_id = 2;
// Source to build against this trigger.
RepoSource source = 3;
}
// StorageSource describes the location of the source in an archive file in
// Google Cloud Storage.
message StorageSource {
// Google Cloud Storage bucket containing source (see
// [Bucket Name
// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
string bucket = 1;
// Google Cloud Storage object containing source.
//
// This object must be a gzipped archive file (.tar.gz) containing source to
// build.
string object = 2;
// Google Cloud Storage generation for the object. If the generation is
// omitted, the latest generation will be used.
int64 generation = 3;
}
// RepoSource describes the location of the source in a Google Cloud Source
// Repository.
message RepoSource {
// ID of the project that owns the repo. If omitted, the project ID requesting
// the build is assumed.
string project_id = 1;
// Name of the repo. If omitted, the name "default" is assumed.
string repo_name = 2;
// A revision within the source repository must be specified in
// one of these ways.
oneof revision {
// Name of the branch to build.
string branch_name = 3;
// Name of the tag to build.
string tag_name = 4;
// Explicit commit SHA to build.
string commit_sha = 5;
}
// Directory, relative to the source root, in which to run the build.
string dir = 7;
}
// Source describes the location of the source in a supported storage
// service.
message Source {
// Describes location of source.
oneof source {
// If provided, get the source from this location in Google Cloud Storage.
StorageSource storage_source = 2;
// If provided, get source from this location in a Cloud Repo.
RepoSource repo_source = 3;
}
}
// BuiltImage describes an image built by the pipeline.
message BuiltImage {
// Name used to push the container image to Google Container Registry, as
// presented to `docker push`.
string name = 1;
// Docker Registry 2.0 digest.
string digest = 3;
// Stores timing information for pushing the specified image.
TimeSpan push_timing = 4;
}
// BuildStep describes a step to perform in the build pipeline.
message BuildStep {
// The name of the container image that will run this particular build step.
//
// If the image is already available in the host's Docker daemon's cache, it
// will be run directly. If not, the host will attempt to pull the image
// first, using the builder service account's credentials if necessary.
//
// The Docker daemon's cache will already have the latest versions of all of
// the officially supported build steps
// ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)).
// The Docker daemon will also have cached many of the layers for some popular
// images, like "ubuntu", "debian", but they will be refreshed at the time you
// attempt to use them.
//
// If you built an image in a previous build step, it will be stored in the
// host's Docker daemon's cache and is available to use as the name for a
// later build step.
string name = 1;
// A list of environment variable definitions to be used when running a step.
//
// The elements are of the form "KEY=VALUE" for the environment variable "KEY"
// being given the value "VALUE".
repeated string env = 2;
// A list of arguments that will be presented to the step when it is started.
//
// If the image used to run the step's container has an entrypoint, these args
// will be used as arguments to that entrypoint. If the image does not define
// an entrypoint, the first element in args will be used as the entrypoint,
// and the remainder will be used as arguments.
repeated string args = 3;
// Working directory (relative to project source root) to use when running
// this operation's container.
string dir = 4;
// Optional unique identifier for this build step, used in wait_for to
// reference this build step as a dependency.
string id = 5;
// The ID(s) of the step(s) that this build step depends on.
// This build step will not start until all the build steps in wait_for
// have completed successfully. If wait_for is empty, this build step will
// start when all previous build steps in the Build.Steps list have completed
// successfully.
repeated string wait_for = 6;
// Optional entrypoint to be used instead of the build step image's default
// If unset, the image's default will be used.
string entrypoint = 7;
// A list of environment variables which are encrypted using a Cloud KMS
// crypto key. These values must be specified in the build's secrets.
repeated string secret_env = 8;
// List of volumes to mount into the build step.
//
// Each volume will be created as an empty volume prior to execution of the
// build step. Upon completion of the build, volumes and their contents will
// be discarded.
//
// Using a named volume in only one step is not valid as it is indicative
// of a mis-configured build request.
repeated Volume volumes = 9;
// Stores timing information for executing this build step.
TimeSpan timing = 10;
}
// Volume describes a Docker container volume which is mounted into build steps
// in order to persist files across build step execution.
message Volume {
// Name of the volume to mount.
//
// Volume names must be unique per build step and must be valid names for
// Docker volumes. Each named volume must be used by at least two build steps.
string name = 1;
// Path at which to mount the volume.
//
// Paths must be absolute and cannot conflict with other volume paths on the
// same build step or with certain reserved volume paths.
string path = 2;
}
// Results describes the artifacts created by the build pipeline.
message Results {
// Images that were built as a part of the build.
repeated BuiltImage images = 2;
// List of build step digests, in order corresponding to build step indices.
repeated string build_step_images = 3;
}
// A build resource in the Container Builder API.
//
// At a high level, a Build describes where to find source code, how to build
// it (for example, the builder image to run on the source), and what tag to
// apply to the built image when it is pushed to Google Container Registry.
//
// Fields can include the following variables which will be expanded when the
// build is created:
//
// - $PROJECT_ID: the project ID of the build.
// - $BUILD_ID: the autogenerated ID of the build.
// - $REPO_NAME: the source repository name specified by RepoSource.
// - $BRANCH_NAME: the branch name specified by RepoSource.
// - $TAG_NAME: the tag name specified by RepoSource.
// - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or
// resolved from the specified branch or tag.
// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
message Build {
// Possible status of a build.
enum Status {
// Status of the build is unknown.
STATUS_UNKNOWN = 0;
// Build is queued; work has not yet begun.
QUEUED = 1;
// Build is being executed.
WORKING = 2;
// Build finished successfully.
SUCCESS = 3;
// Build failed to complete successfully.
FAILURE = 4;
// Build failed due to an internal cause.
INTERNAL_ERROR = 5;
// Build took longer than was allowed.
TIMEOUT = 6;
// Build was canceled by a user.
CANCELLED = 7;
}
// Unique identifier of the build.
// @OutputOnly
string id = 1;
// ID of the project.
// @OutputOnly.
string project_id = 16;
// Status of the build.
// @OutputOnly
Status status = 2;
// Customer-readable message about the current status.
// @OutputOnly
string status_detail = 24;
// Describes where to find the source files to build.
Source source = 3;
// Describes the operations to be performed on the workspace.
repeated BuildStep steps = 11;
// Results of the build.
// @OutputOnly
Results results = 10;
// Time at which the request to create the build was received.
// @OutputOnly
google.protobuf.Timestamp create_time = 6;
// Time at which execution of the build was started.
// @OutputOnly
google.protobuf.Timestamp start_time = 7;
// Time at which execution of the build was finished.
//
// The difference between finish_time and start_time is the duration of the
// build's execution.
// @OutputOnly
google.protobuf.Timestamp finish_time = 8;
// Amount of time that this build should be allowed to run, to second
// granularity. If this amount of time elapses, work on the build will cease
// and the build status will be TIMEOUT.
//
// Default time is ten minutes.
google.protobuf.Duration timeout = 12;
// A list of images to be pushed upon the successful completion of all build
// steps.
//
// The images will be pushed using the builder service account's credentials.
//
// The digests of the pushed images will be stored in the Build resource's
// results field.
//
// If any of the images fail to be pushed, the build is marked FAILURE.
repeated string images = 13;
// Google Cloud Storage bucket where logs should be written (see
// [Bucket Name
// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
// Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.
string logs_bucket = 19;
// A permanent fixed identifier for source.
// @OutputOnly
SourceProvenance source_provenance = 21;
// The ID of the BuildTrigger that triggered this build, if it was
// triggered automatically.
// @OutputOnly
string build_trigger_id = 22;
// Special options for this build.
BuildOptions options = 23;
// URL to logs for this build in Google Cloud Logging.
// @OutputOnly
string log_url = 25;
// Substitutions data for Build resource.
map<string, string> substitutions = 29;
// Tags for annotation of a Build. These are not docker tags.
repeated string tags = 31;
// Secrets to decrypt using Cloud KMS.
repeated Secret secrets = 32;
// Stores timing information for phases of the build.
// Valid keys are:
// - BUILD: time to execute all build steps
// - PUSH: time to push all specified images.
// - FETCHSOURCE: time to fetch source.
// If the build does not specify source, or does not specify images,
// these keys will not be included.
map<string, TimeSpan> timing = 33;
}
// Stores start and end times for a build execution phase.
message TimeSpan {
// Start of time span.
google.protobuf.Timestamp start_time = 1;
// End of time span.
google.protobuf.Timestamp end_time = 2;
}
// Metadata for build operations.
message BuildOperationMetadata {
// The build that the operation is tracking.
Build build = 1;
}
// Provenance of the source. Ways to find the original source, or verify that
// some source was used for this build.
message SourceProvenance {
// A copy of the build's source.storage_source, if exists, with any
// generations resolved.
StorageSource resolved_storage_source = 3;
// A copy of the build's source.repo_source, if exists, with any
// revisions resolved.
RepoSource resolved_repo_source = 6;
// Hash(es) of the build source, which can be used to verify that the original
// source integrity was maintained in the build. Note that FileHashes will
// only be populated if BuildOptions has requested a SourceProvenanceHash.
//
// The keys to this map are file paths used as build source and the values
// contain the hash values for those files.
//
// If the build source came in a single package such as a gzipped tarfile
// (.tar.gz), the FileHash will be for the single path to that file.
// @OutputOnly
map<string, FileHashes> file_hashes = 4;
}
// Container message for hashes of byte content of files, used in
// SourceProvenance messages to verify integrity of source input to the build.
message FileHashes {
// Collection of file hashes.
repeated Hash file_hash = 1;
}
// Container message for hash values.
message Hash {
// Specifies the hash algorithm, if any.
enum HashType {
// No hash requested.
NONE = 0;
// Use a sha256 hash.
SHA256 = 1;
}
// The type of hash that was performed.
HashType type = 1;
// The hash value.
bytes value = 2;
}
// Secret pairs a set of secret environment variables containing encrypted
// values with the Cloud KMS key to use to decrypt the value.
message Secret {
// Cloud KMS key name to use to decrypt these envs.
string kms_key_name = 1;
// Map of environment variable name to its encrypted value.
//
// Secret environment variables must be unique across all of a build's
// secrets, and must be used by at least one build step. Values can be at most
// 1 KB in size. There can be at most ten secret values across all of a
// build's secrets.
map<string, bytes> secret_env = 3;
}
// Request to create a new build.
message CreateBuildRequest {
// ID of the project.
string project_id = 1;
// Build resource to create.
Build build = 2;
}
// Request to get a build.
message GetBuildRequest {
// ID of the project.
string project_id = 1;
// ID of the build.
string id = 2;
}
// Request to list builds.
message ListBuildsRequest {
// ID of the project.
string project_id = 1;
// Number of results to return in the list.
int32 page_size = 2;
// Token to provide to skip to a particular spot in the list.
string page_token = 3;
// The raw filter text to constrain the results.
string filter = 8;
}
// Response including listed builds.
message ListBuildsResponse {
// Builds will be sorted by create_time, descending.
repeated Build builds = 1;
// Token to receive the next page of results.
string next_page_token = 2;
}
// Request to cancel an ongoing build.
message CancelBuildRequest {
// ID of the project.
string project_id = 1;
// ID of the build.
string id = 2;
}
// Configuration for an automated build in response to source repository
// changes.
message BuildTrigger {
// Unique identifier of the trigger.
//
// @OutputOnly
string id = 1;
// Human-readable description of this trigger.
string description = 10;
// Template describing the types of source changes to trigger a build.
//
// Branch and tag names in trigger templates are interpreted as regular
// expressions. Any branch or tag change that matches that regular expression
// will trigger a build.
RepoSource trigger_template = 7;
// Template describing the Build request to make when the trigger is matched.
oneof build_template {
// Contents of the build template.
Build build = 4;
// Path, from the source root, to a file whose contents is used for the
// template.
string filename = 8;
}
// Time when the trigger was created.
//
// @OutputOnly
google.protobuf.Timestamp create_time = 5;
// If true, the trigger will never result in a build.
bool disabled = 9;
// Substitutions data for Build resource.
map<string, string> substitutions = 11;
}
// Request to create a new BuildTrigger.
message CreateBuildTriggerRequest {
// ID of the project for which to configure automatic builds.
string project_id = 1;
// BuildTrigger to create.
BuildTrigger trigger = 2;
}
// Returns the BuildTrigger with the specified ID.
message GetBuildTriggerRequest {
// ID of the project that owns the trigger.
string project_id = 1;
// ID of the BuildTrigger to get.
string trigger_id = 2;
}
// Request to list existing BuildTriggers.
message ListBuildTriggersRequest {
// ID of the project for which to list BuildTriggers.
string project_id = 1;
}
// Response containing existing BuildTriggers.
message ListBuildTriggersResponse {
// BuildTriggers for the project, sorted by create_time descending.
repeated BuildTrigger triggers = 1;
}
// Request to delete a BuildTrigger.
message DeleteBuildTriggerRequest {
// ID of the project that owns the trigger.
string project_id = 1;
// ID of the BuildTrigger to delete.
string trigger_id = 2;
}
// Request to update an existing BuildTrigger.
message UpdateBuildTriggerRequest {
// ID of the project that owns the trigger.
string project_id = 1;
// ID of the BuildTrigger to update.
string trigger_id = 2;
// BuildTrigger to update.
BuildTrigger trigger = 3;
}
// Optional arguments to enable specific features of builds.
message BuildOptions {
// Specifies the manner in which the build should be verified, if at all.
enum VerifyOption {
// Not a verifiable build. (default)
NOT_VERIFIED = 0;
// Verified build.
VERIFIED = 1;
}
// Supported VM sizes.
enum MachineType {
// Standard machine type.
UNSPECIFIED = 0;
// Highcpu machine with 8 CPUs.
N1_HIGHCPU_8 = 1;
// Highcpu machine with 32 CPUs.
N1_HIGHCPU_32 = 2;
}
// Specifies the behavior when there is an error in the substitution checks.
enum SubstitutionOption {
// Fails the build if error in substitutions checks, like missing
// a substitution in the template or in the map.
MUST_MATCH = 0;
// Do not fail the build if error in substitutions checks.
ALLOW_LOOSE = 1;
}
// Specifies the behavior when writing build logs to Google Cloud Storage.
enum LogStreamingOption {
// Service may automatically determine build log streaming behavior.
STREAM_DEFAULT = 0;
// Build logs should be streamed to Google Cloud Storage.
STREAM_ON = 1;
// Build logs should not be streamed to Google Cloud Storage; they will be
// written when the build is completed.
STREAM_OFF = 2;
}
// Requested hash for SourceProvenance.
repeated Hash.HashType source_provenance_hash = 1;
// Requested verifiability options.
VerifyOption requested_verify_option = 2;
// GCE VM size to run the build on.
MachineType machine_type = 3;
// Requested disk size for the VM that runs the build. Note that this is *NOT*
// "disk free"; some of the space will be used by the operating system and
// build utilities. Also note that this is the minimum disk size that will be
// allocated for the build -- the build may run with a larger disk than
// requested. At present, the maximum disk size is 1000GB; builds that request
// more than the maximum are rejected with an error.
int64 disk_size_gb = 6;
// SubstitutionOption to allow unmatch substitutions.
SubstitutionOption substitution_option = 4;
// LogStreamingOption to define build log streaming behavior to Google Cloud
// Storage.
LogStreamingOption log_streaming_option = 5;
}

View File

@@ -0,0 +1,165 @@
// Copyright 2017 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.clouddebugger.v2;
import "google/api/annotations.proto";
import "google/devtools/clouddebugger/v2/data.proto";
import "google/protobuf/empty.proto";
option csharp_namespace = "Google.Cloud.Debugger.V2";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2;clouddebugger";
option java_multiple_files = true;
option java_outer_classname = "ControllerProto";
option java_package = "com.google.devtools.clouddebugger.v2";
option php_namespace = "Google\\Cloud\\Debugger\\V2";
// The Controller service provides the API for orchestrating a collection of
// debugger agents to perform debugging tasks. These agents are each attached
// to a process of an application which may include one or more replicas.
//
// The debugger agents register with the Controller to identify the application
// being debugged, the Debuggee. All agents that register with the same data,
// represent the same Debuggee, and are assigned the same `debuggee_id`.
//
// The debugger agents call the Controller to retrieve the list of active
// Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
// list. An agent that can fulfill the breakpoint request updates the
// Controller with the breakpoint result. The controller selects the first
// result received and discards the rest of the results.
// Agents that poll again for active breakpoints will no longer have
// the completed breakpoint in the list and should remove that breakpoint from
// their attached process.
//
// The Controller service does not provide a way to retrieve the results of
// a completed breakpoint. This functionality is available using the Debugger
// service.
service Controller2 {
// Registers the debuggee with the controller service.
//
// All agents attached to the same application must call this method with
// exactly the same request content to get back the same stable `debuggee_id`.
// Agents should call this method again whenever `google.rpc.Code.NOT_FOUND`
// is returned from any controller method.
//
// This protocol allows the controller service to disable debuggees, recover
// from data loss, or change the `debuggee_id` format. Agents must handle
// `debuggee_id` value changing upon re-registration.
rpc RegisterDebuggee(RegisterDebuggeeRequest) returns (RegisterDebuggeeResponse) {
option (google.api.http) = { post: "/v2/controller/debuggees/register" body: "*" };
}
// Returns the list of all active breakpoints for the debuggee.
//
// The breakpoint specification (`location`, `condition`, and `expressions`
// fields) is semantically immutable, although the field values may
// change. For example, an agent may update the location line number
// to reflect the actual line where the breakpoint was set, but this
// doesn't change the breakpoint semantics.
//
// This means that an agent does not need to check if a breakpoint has changed
// when it encounters the same breakpoint on a successive call.
// Moreover, an agent should remember the breakpoints that are completed
// until the controller removes them from the active list to avoid
// setting those breakpoints again.
rpc ListActiveBreakpoints(ListActiveBreakpointsRequest) returns (ListActiveBreakpointsResponse) {
option (google.api.http) = { get: "/v2/controller/debuggees/{debuggee_id}/breakpoints" };
}
// Updates the breakpoint state or mutable fields.
// The entire Breakpoint message must be sent back to the controller service.
//
// Updates to active breakpoint fields are only allowed if the new value
// does not change the breakpoint specification. Updates to the `location`,
// `condition` and `expressions` fields should not alter the breakpoint
// semantics. These may only make changes such as canonicalizing a value
// or snapping the location to the correct line of code.
rpc UpdateActiveBreakpoint(UpdateActiveBreakpointRequest) returns (UpdateActiveBreakpointResponse) {
option (google.api.http) = { put: "/v2/controller/debuggees/{debuggee_id}/breakpoints/{breakpoint.id}" body: "*" };
}
}
// Request to register a debuggee.
message RegisterDebuggeeRequest {
// Debuggee information to register.
// The fields `project`, `uniquifier`, `description` and `agent_version`
// of the debuggee must be set.
Debuggee debuggee = 1;
}
// Response for registering a debuggee.
message RegisterDebuggeeResponse {
// Debuggee resource.
// The field `id` is guranteed to be set (in addition to the echoed fields).
// If the field `is_disabled` is set to `true`, the agent should disable
// itself by removing all breakpoints and detaching from the application.
// It should however continue to poll `RegisterDebuggee` until reenabled.
Debuggee debuggee = 1;
}
// Request to list active breakpoints.
message ListActiveBreakpointsRequest {
// Identifies the debuggee.
string debuggee_id = 1;
// A token that, if specified, blocks the method call until the list
// of active breakpoints has changed, or a server-selected timeout has
// expired. The value should be set from the `next_wait_token` field in
// the last response. The initial value should be set to `"init"`.
string wait_token = 2;
// If set to `true` (recommended), returns `google.rpc.Code.OK` status and
// sets the `wait_expired` response field to `true` when the server-selected
// timeout has expired.
//
// If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status
// when the server-selected timeout has expired.
bool success_on_timeout = 3;
}
// Response for listing active breakpoints.
message ListActiveBreakpointsResponse {
// List of all active breakpoints.
// The fields `id` and `location` are guaranteed to be set on each breakpoint.
repeated Breakpoint breakpoints = 1;
// A token that can be used in the next method call to block until
// the list of breakpoints changes.
string next_wait_token = 2;
// If set to `true`, indicates that there is no change to the
// list of active breakpoints and the server-selected timeout has expired.
// The `breakpoints` field would be empty and should be ignored.
bool wait_expired = 3;
}
// Request to update an active breakpoint.
message UpdateActiveBreakpointRequest {
// Identifies the debuggee being debugged.
string debuggee_id = 1;
// Updated breakpoint information.
// The field `id` must be set.
// The agent must echo all Breakpoint specification fields in the update.
Breakpoint breakpoint = 2;
}
// Response for updating an active breakpoint.
// The message is defined to allow future extensions.
message UpdateActiveBreakpointResponse {
}

View File

@@ -0,0 +1,447 @@
// Copyright 2017 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.clouddebugger.v2;
import "google/api/annotations.proto";
import "google/devtools/source/v1/source_context.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option csharp_namespace = "Google.Cloud.Debugger.V2";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2;clouddebugger";
option java_multiple_files = true;
option java_outer_classname = "DataProto";
option java_package = "com.google.devtools.clouddebugger.v2";
option php_namespace = "Google\\Cloud\\Debugger\\V2";
// Represents a message with parameters.
message FormatMessage {
// Format template for the message. The `format` uses placeholders `$0`,
// `$1`, etc. to reference parameters. `$$` can be used to denote the `$`
// character.
//
// Examples:
//
// * `Failed to load '$0' which helps debug $1 the first time it
// is loaded. Again, $0 is very important.`
// * `Please pay $$10 to use $0 instead of $1.`
string format = 1;
// Optional parameters to be embedded into the message.
repeated string parameters = 2;
}
// Represents a contextual status message.
// The message can indicate an error or informational status, and refer to
// specific parts of the containing object.
// For example, the `Breakpoint.status` field can indicate an error referring
// to the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`.
message StatusMessage {
// Enumerates references to which the message applies.
enum Reference {
// Status doesn't refer to any particular input.
UNSPECIFIED = 0;
// Status applies to the breakpoint and is related to its location.
BREAKPOINT_SOURCE_LOCATION = 3;
// Status applies to the breakpoint and is related to its condition.
BREAKPOINT_CONDITION = 4;
// Status applies to the breakpoint and is related to its expressions.
BREAKPOINT_EXPRESSION = 7;
// Status applies to the breakpoint and is related to its age.
BREAKPOINT_AGE = 8;
// Status applies to the entire variable.
VARIABLE_NAME = 5;
// Status applies to variable value (variable name is valid).
VARIABLE_VALUE = 6;
}
// Distinguishes errors from informational messages.
bool is_error = 1;
// Reference to which the message applies.
Reference refers_to = 2;
// Status message text.
FormatMessage description = 3;
}
// Represents a location in the source code.
message SourceLocation {
// Path to the source file within the source context of the target binary.
string path = 1;
// Line inside the file. The first line in the file has the value `1`.
int32 line = 2;
}
// Represents a variable or an argument possibly of a compound object type.
// Note how the following variables are represented:
//
// 1) A simple variable:
//
// int x = 5
//
// { name: "x", value: "5", type: "int" } // Captured variable
//
// 2) A compound object:
//
// struct T {
// int m1;
// int m2;
// };
// T x = { 3, 7 };
//
// { // Captured variable
// name: "x",
// type: "T",
// members { name: "m1", value: "3", type: "int" },
// members { name: "m2", value: "7", type: "int" }
// }
//
// 3) A pointer where the pointee was captured:
//
// T x = { 3, 7 };
// T* p = &x;
//
// { // Captured variable
// name: "p",
// type: "T*",
// value: "0x00500500",
// members { name: "m1", value: "3", type: "int" },
// members { name: "m2", value: "7", type: "int" }
// }
//
// 4) A pointer where the pointee was not captured:
//
// T* p = new T;
//
// { // Captured variable
// name: "p",
// type: "T*",
// value: "0x00400400"
// status { is_error: true, description { format: "unavailable" } }
// }
//
// The status should describe the reason for the missing value,
// such as `<optimized out>`, `<inaccessible>`, `<pointers limit reached>`.
//
// Note that a null pointer should not have members.
//
// 5) An unnamed value:
//
// int* p = new int(7);
//
// { // Captured variable
// name: "p",
// value: "0x00500500",
// type: "int*",
// members { value: "7", type: "int" } }
//
// 6) An unnamed pointer where the pointee was not captured:
//
// int* p = new int(7);
// int** pp = &p;
//
// { // Captured variable
// name: "pp",
// value: "0x00500500",
// type: "int**",
// members {
// value: "0x00400400",
// type: "int*"
// status {
// is_error: true,
// description: { format: "unavailable" } }
// }
// }
// }
//
// To optimize computation, memory and network traffic, variables that
// repeat in the output multiple times can be stored once in a shared
// variable table and be referenced using the `var_table_index` field. The
// variables stored in the shared table are nameless and are essentially
// a partition of the complete variable. To reconstruct the complete
// variable, merge the referencing variable with the referenced variable.
//
// When using the shared variable table, the following variables:
//
// T x = { 3, 7 };
// T* p = &x;
// T& r = x;
//
// { name: "x", var_table_index: 3, type: "T" } // Captured variables
// { name: "p", value "0x00500500", type="T*", var_table_index: 3 }
// { name: "r", type="T&", var_table_index: 3 }
//
// { // Shared variable table entry #3:
// members { name: "m1", value: "3", type: "int" },
// members { name: "m2", value: "7", type: "int" }
// }
//
// Note that the pointer address is stored with the referencing variable
// and not with the referenced variable. This allows the referenced variable
// to be shared between pointers and references.
//
// The type field is optional. The debugger agent may or may not support it.
message Variable {
// Name of the variable, if any.
string name = 1;
// Simple value of the variable.
string value = 2;
// Variable type (e.g. `MyClass`). If the variable is split with
// `var_table_index`, `type` goes next to `value`. The interpretation of
// a type is agent specific. It is recommended to include the dynamic type
// rather than a static type of an object.
string type = 6;
// Members contained or pointed to by the variable.
repeated Variable members = 3;
// Reference to a variable in the shared variable table. More than
// one variable can reference the same variable in the table. The
// `var_table_index` field is an index into `variable_table` in Breakpoint.
google.protobuf.Int32Value var_table_index = 4;
// Status associated with the variable. This field will usually stay
// unset. A status of a single variable only applies to that variable or
// expression. The rest of breakpoint data still remains valid. Variables
// might be reported in error state even when breakpoint is not in final
// state.
//
// The message may refer to variable name with `refers_to` set to
// `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`.
// In either case variable value and members will be unset.
//
// Example of error message applied to name: `Invalid expression syntax`.
//
// Example of information message applied to value: `Not captured`.
//
// Examples of error message applied to value:
//
// * `Malformed string`,
// * `Field f not found in class C`
// * `Null pointer dereference`
StatusMessage status = 5;
}
// Represents a stack frame context.
message StackFrame {
// Demangled function name at the call site.
string function = 1;
// Source location of the call site.
SourceLocation location = 2;
// Set of arguments passed to this function.
// Note that this might not be populated for all stack frames.
repeated Variable arguments = 3;
// Set of local variables at the stack frame location.
// Note that this might not be populated for all stack frames.
repeated Variable locals = 4;
}
// Represents the breakpoint specification, status and results.
message Breakpoint {
// Actions that can be taken when a breakpoint hits.
// Agents should reject breakpoints with unsupported or unknown action values.
enum Action {
// Capture stack frame and variables and update the breakpoint.
// The data is only captured once. After that the breakpoint is set
// in a final state.
CAPTURE = 0;
// Log each breakpoint hit. The breakpoint remains active until
// deleted or expired.
LOG = 1;
}
// Log severity levels.
enum LogLevel {
// Information log message.
INFO = 0;
// Warning log message.
WARNING = 1;
// Error log message.
ERROR = 2;
}
// Breakpoint identifier, unique in the scope of the debuggee.
string id = 1;
// Action that the agent should perform when the code at the
// breakpoint location is hit.
Action action = 13;
// Breakpoint source location.
SourceLocation location = 2;
// Condition that triggers the breakpoint.
// The condition is a compound boolean expression composed using expressions
// in a programming language at the source location.
string condition = 3;
// List of read-only expressions to evaluate at the breakpoint location.
// The expressions are composed using expressions in the programming language
// at the source location. If the breakpoint action is `LOG`, the evaluated
// expressions are included in log statements.
repeated string expressions = 4;
// Only relevant when action is `LOG`. Defines the message to log when
// the breakpoint hits. The message may include parameter placeholders `$0`,
// `$1`, etc. These placeholders are replaced with the evaluated value
// of the appropriate expression. Expressions not referenced in
// `log_message_format` are not logged.
//
// Example: `Message received, id = $0, count = $1` with
// `expressions` = `[ message.id, message.count ]`.
string log_message_format = 14;
// Indicates the severity of the log. Only relevant when action is `LOG`.
LogLevel log_level = 15;
// When true, indicates that this is a final result and the
// breakpoint state will not change from here on.
bool is_final_state = 5;
// Time this breakpoint was created by the server in seconds resolution.
google.protobuf.Timestamp create_time = 11;
// Time this breakpoint was finalized as seen by the server in seconds
// resolution.
google.protobuf.Timestamp final_time = 12;
// E-mail address of the user that created this breakpoint
string user_email = 16;
// Breakpoint status.
//
// The status includes an error flag and a human readable message.
// This field is usually unset. The message can be either
// informational or an error message. Regardless, clients should always
// display the text message back to the user.
//
// Error status indicates complete failure of the breakpoint.
//
// Example (non-final state): `Still loading symbols...`
//
// Examples (final state):
//
// * `Invalid line number` referring to location
// * `Field f not found in class C` referring to condition
StatusMessage status = 10;
// The stack at breakpoint time.
repeated StackFrame stack_frames = 7;
// Values of evaluated expressions at breakpoint time.
// The evaluated expressions appear in exactly the same order they
// are listed in the `expressions` field.
// The `name` field holds the original expression text, the `value` or
// `members` field holds the result of the evaluated expression.
// If the expression cannot be evaluated, the `status` inside the `Variable`
// will indicate an error and contain the error text.
repeated Variable evaluated_expressions = 8;
// The `variable_table` exists to aid with computation, memory and network
// traffic optimization. It enables storing a variable once and reference
// it from multiple variables, including variables stored in the
// `variable_table` itself.
// For example, the same `this` object, which may appear at many levels of
// the stack, can have all of its data stored once in this table. The
// stack frame variables then would hold only a reference to it.
//
// The variable `var_table_index` field is an index into this repeated field.
// The stored objects are nameless and get their name from the referencing
// variable. The effective variable is a merge of the referencing variable
// and the referenced variable.
repeated Variable variable_table = 9;
// A set of custom breakpoint properties, populated by the agent, to be
// displayed to the user.
map<string, string> labels = 17;
}
// Represents the debugged application. The application may include one or more
// replicated processes executing the same code. Each of these processes is
// attached with a debugger agent, carrying out the debugging commands.
// Agents attached to the same debuggee identify themselves as such by using
// exactly the same Debuggee message value when registering.
message Debuggee {
// Unique identifier for the debuggee generated by the controller service.
string id = 1;
// Project the debuggee is associated with.
// Use project number or id when registering a Google Cloud Platform project.
string project = 2;
// Uniquifier to further distiguish the application.
// It is possible that different applications might have identical values in
// the debuggee message, thus, incorrectly identified as a single application
// by the Controller service. This field adds salt to further distiguish the
// application. Agents should consider seeding this field with value that
// identifies the code, binary, configuration and environment.
string uniquifier = 3;
// Human readable description of the debuggee.
// Including a human-readable project name, environment name and version
// information is recommended.
string description = 4;
// If set to `true`, indicates that Controller service does not detect any
// activity from the debuggee agents and the application is possibly stopped.
bool is_inactive = 5;
// Version ID of the agent.
// Schema: `domain/language-platform/vmajor.minor` (for example
// `google.com/java-gcp/v1.1`).
string agent_version = 6;
// If set to `true`, indicates that the agent should disable itself and
// detach from the debuggee.
bool is_disabled = 7;
// Human readable message to be displayed to the user about this debuggee.
// Absence of this field indicates no status. The message can be either
// informational or an error status.
StatusMessage status = 8;
// References to the locations and revisions of the source code used in the
// deployed application.
repeated google.devtools.source.v1.SourceContext source_contexts = 9;
// References to the locations and revisions of the source code used in the
// deployed application.
//
// NOTE: this field is experimental and can be ignored.
repeated google.devtools.source.v1.ExtendedSourceContext ext_source_contexts = 13;
// A set of custom debuggee properties, populated by the agent, to be
// displayed to the user.
map<string, string> labels = 11;
}

View File

@@ -0,0 +1,197 @@
// Copyright 2017 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.clouddebugger.v2;
import "google/api/annotations.proto";
import "google/devtools/clouddebugger/v2/data.proto";
import "google/protobuf/empty.proto";
option csharp_namespace = "Google.Cloud.Debugger.V2";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouddebugger/v2;clouddebugger";
option java_multiple_files = true;
option java_outer_classname = "DebuggerProto";
option java_package = "com.google.devtools.clouddebugger.v2";
option php_namespace = "Google\\Cloud\\Debugger\\V2";
// The Debugger service provides the API that allows users to collect run-time
// information from a running application, without stopping or slowing it down
// and without modifying its state. An application may include one or
// more replicated processes performing the same work.
//
// A debugged application is represented using the Debuggee concept. The
// Debugger service provides a way to query for available debuggees, but does
// not provide a way to create one. A debuggee is created using the Controller
// service, usually by running a debugger agent with the application.
//
// The Debugger service enables the client to set one or more Breakpoints on a
// Debuggee and collect the results of the set Breakpoints.
service Debugger2 {
// Sets the breakpoint to the debuggee.
rpc SetBreakpoint(SetBreakpointRequest) returns (SetBreakpointResponse) {
option (google.api.http) = { post: "/v2/debugger/debuggees/{debuggee_id}/breakpoints/set" body: "breakpoint" };
}
// Gets breakpoint information.
rpc GetBreakpoint(GetBreakpointRequest) returns (GetBreakpointResponse) {
option (google.api.http) = { get: "/v2/debugger/debuggees/{debuggee_id}/breakpoints/{breakpoint_id}" };
}
// Deletes the breakpoint from the debuggee.
rpc DeleteBreakpoint(DeleteBreakpointRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v2/debugger/debuggees/{debuggee_id}/breakpoints/{breakpoint_id}" };
}
// Lists all breakpoints for the debuggee.
rpc ListBreakpoints(ListBreakpointsRequest) returns (ListBreakpointsResponse) {
option (google.api.http) = { get: "/v2/debugger/debuggees/{debuggee_id}/breakpoints" };
}
// Lists all the debuggees that the user has access to.
rpc ListDebuggees(ListDebuggeesRequest) returns (ListDebuggeesResponse) {
option (google.api.http) = { get: "/v2/debugger/debuggees" };
}
}
// Request to set a breakpoint
message SetBreakpointRequest {
// ID of the debuggee where the breakpoint is to be set.
string debuggee_id = 1;
// Breakpoint specification to set.
// The field `location` of the breakpoint must be set.
Breakpoint breakpoint = 2;
// The client version making the call.
// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
string client_version = 4;
}
// Response for setting a breakpoint.
message SetBreakpointResponse {
// Breakpoint resource.
// The field `id` is guaranteed to be set (in addition to the echoed fileds).
Breakpoint breakpoint = 1;
}
// Request to get breakpoint information.
message GetBreakpointRequest {
// ID of the debuggee whose breakpoint to get.
string debuggee_id = 1;
// ID of the breakpoint to get.
string breakpoint_id = 2;
// The client version making the call.
// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
string client_version = 4;
}
// Response for getting breakpoint information.
message GetBreakpointResponse {
// Complete breakpoint state.
// The fields `id` and `location` are guaranteed to be set.
Breakpoint breakpoint = 1;
}
// Request to delete a breakpoint.
message DeleteBreakpointRequest {
// ID of the debuggee whose breakpoint to delete.
string debuggee_id = 1;
// ID of the breakpoint to delete.
string breakpoint_id = 2;
// The client version making the call.
// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
string client_version = 3;
}
// Request to list breakpoints.
message ListBreakpointsRequest {
// Wrapper message for `Breakpoint.Action`. Defines a filter on the action
// field of breakpoints.
message BreakpointActionValue {
// Only breakpoints with the specified action will pass the filter.
Breakpoint.Action value = 1;
}
// ID of the debuggee whose breakpoints to list.
string debuggee_id = 1;
// When set to `true`, the response includes the list of breakpoints set by
// any user. Otherwise, it includes only breakpoints set by the caller.
bool include_all_users = 2;
// When set to `true`, the response includes active and inactive
// breakpoints. Otherwise, it includes only active breakpoints.
bool include_inactive = 3;
// When set, the response includes only breakpoints with the specified action.
BreakpointActionValue action = 4;
// This field is deprecated. The following fields are always stripped out of
// the result: `stack_frames`, `evaluated_expressions` and `variable_table`.
bool strip_results = 5;
// A wait token that, if specified, blocks the call until the breakpoints
// list has changed, or a server selected timeout has expired. The value
// should be set from the last response. The error code
// `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which
// should be called again with the same `wait_token`.
string wait_token = 6;
// The client version making the call.
// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
string client_version = 8;
}
// Response for listing breakpoints.
message ListBreakpointsResponse {
// List of breakpoints matching the request.
// The fields `id` and `location` are guaranteed to be set on each breakpoint.
// The fields: `stack_frames`, `evaluated_expressions` and `variable_table`
// are cleared on each breakpoint regardless of its status.
repeated Breakpoint breakpoints = 1;
// A wait token that can be used in the next call to `list` (REST) or
// `ListBreakpoints` (RPC) to block until the list of breakpoints has changes.
string next_wait_token = 2;
}
// Request to list debuggees.
message ListDebuggeesRequest {
// Project number of a Google Cloud project whose debuggees to list.
string project = 2;
// When set to `true`, the result includes all debuggees. Otherwise, the
// result includes only debuggees that are active.
bool include_inactive = 3;
// The client version making the call.
// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
string client_version = 4;
}
// Response for listing debuggees.
message ListDebuggeesResponse {
// List of debuggees accessible to the calling user.
// The fields `debuggee.id` and `description` are guaranteed to be set.
// The `description` field is a human readable field provided by agents and
// can be displayed to users.
repeated Debuggee debuggees = 1;
}

View File

@@ -0,0 +1,165 @@
// Copyright 2016 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.clouderrorreporting.v1beta1;
import "google/api/annotations.proto";
import "google/api/monitored_resource.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
option java_package = "com.google.devtools.clouderrorreporting.v1beta1";
option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1";
// Description of a group of similar error events.
message ErrorGroup {
// The group resource name.
// Example: <code>projects/my-project-123/groups/my-groupid</code>
string name = 1;
// Group IDs are unique for a given project. If the same kind of error
// occurs in different service contexts, it will receive the same group ID.
string group_id = 2;
// Associated tracking issues.
repeated TrackingIssue tracking_issues = 3;
}
// Information related to tracking the progress on resolving the error.
message TrackingIssue {
// A URL pointing to a related entry in an issue tracking system.
// Example: https://github.com/user/project/issues/4
string url = 1;
}
// An error event which is returned by the Error Reporting system.
message ErrorEvent {
// Time when the event occurred as provided in the error report.
// If the report did not contain a timestamp, the time the error was received
// by the Error Reporting system is used.
google.protobuf.Timestamp event_time = 1;
// The `ServiceContext` for which this error was reported.
ServiceContext service_context = 2;
// The stack trace that was reported or logged by the service.
string message = 3;
// Data about the context in which the error occurred.
ErrorContext context = 5;
}
// Describes a running service that sends errors.
// Its version changes over time and multiple versions can run in parallel.
message ServiceContext {
// An identifier of the service, such as the name of the
// executable, job, or Google App Engine service name. This field is expected
// to have a low number of values that are relatively stable over time, as
// opposed to `version`, which can be changed whenever new code is deployed.
//
// Contains the service name for error reports extracted from Google
// App Engine logs or `default` if the App Engine default service is used.
string service = 2;
// Represents the source code version that the developer provided,
// which could represent a version label or a Git SHA-1 hash, for example.
string version = 3;
// Type of the MonitoredResource. List of possible values:
// https://cloud.google.com/monitoring/api/resources
//
// Value is set automatically for incoming errors and must not be set when
// reporting errors.
string resource_type = 4;
}
// A description of the context in which an error occurred.
// This data should be provided by the application when reporting an error,
// unless the
// error report has been generated automatically from Google App Engine logs.
message ErrorContext {
// The HTTP request which was processed when the error was
// triggered.
HttpRequestContext http_request = 1;
// The user who caused or was affected by the crash.
// This can be a user ID, an email address, or an arbitrary token that
// uniquely identifies the user.
// When sending an error report, leave this field empty if the user was not
// logged in. In this case the
// Error Reporting system will use other data, such as remote IP address, to
// distinguish affected users. See `affected_users_count` in
// `ErrorGroupStats`.
string user = 2;
// The location in the source code where the decision was made to
// report the error, usually the place where it was logged.
// For a logged exception this would be the source line where the
// exception is logged, usually close to the place where it was
// caught. This value is in contrast to `Exception.cause_location`,
// which describes the source line where the exception was thrown.
SourceLocation report_location = 3;
}
// HTTP request data that is related to a reported error.
// This data should be provided by the application when reporting an error,
// unless the
// error report has been generated automatically from Google App Engine logs.
message HttpRequestContext {
// The type of HTTP request, such as `GET`, `POST`, etc.
string method = 1;
// The URL of the request.
string url = 2;
// The user agent information that is provided with the request.
string user_agent = 3;
// The referrer information that is provided with the request.
string referrer = 4;
// The HTTP response status code for the request.
int32 response_status_code = 5;
// The IP address from which the request originated.
// This can be IPv4, IPv6, or a token which is derived from the
// IP address, depending on the data that has been provided
// in the error report.
string remote_ip = 6;
}
// Indicates a location in the source code of the service for which
// errors are reported.
// This data should be provided by the application when reporting an error,
// unless the error report has been generated automatically from Google App
// Engine logs. All fields are optional.
message SourceLocation {
// The source code filename, which can include a truncated relative
// path, or a full path from a production machine.
string file_path = 1;
// 1-based. 0 indicates that the line number is unknown.
int32 line_number = 2;
// Human-readable name of a function or method.
// The value can include optional context like the class or package name.
// For example, `my.package.MyClass.method` in case of Java.
string function_name = 4;
}

View File

@@ -0,0 +1,61 @@
// Copyright 2016 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.clouderrorreporting.v1beta1;
import "google/api/annotations.proto";
import "google/devtools/clouderrorreporting/v1beta1/common.proto";
option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting";
option java_multiple_files = true;
option java_outer_classname = "ErrorGroupServiceProto";
option java_package = "com.google.devtools.clouderrorreporting.v1beta1";
option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1";
// Service for retrieving and updating individual error groups.
service ErrorGroupService {
// Get the specified group.
rpc GetGroup(GetGroupRequest) returns (ErrorGroup) {
option (google.api.http) = { get: "/v1beta1/{group_name=projects/*/groups/*}" };
}
// Replace the data for the specified group.
// Fails if the group does not exist.
rpc UpdateGroup(UpdateGroupRequest) returns (ErrorGroup) {
option (google.api.http) = { put: "/v1beta1/{group.name=projects/*/groups/*}" body: "group" };
}
}
// A request to return an individual group.
message GetGroupRequest {
// [Required] The group resource name. Written as
// <code>projects/<var>projectID</var>/groups/<var>group_name</var></code>.
// Call
// <a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list">
// <code>groupStats.list</code></a> to return a list of groups belonging to
// this project.
//
// Example: <code>projects/my-project-123/groups/my-group</code>
string group_name = 1;
}
// A request to replace the existing data for the given group.
message UpdateGroupRequest {
// [Required] The group which replaces the resource on the server.
ErrorGroup group = 1;
}

View File

@@ -0,0 +1,342 @@
// Copyright 2016 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.clouderrorreporting.v1beta1;
import "google/api/annotations.proto";
import "google/devtools/clouderrorreporting/v1beta1/common.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting";
option java_multiple_files = true;
option java_outer_classname = "ErrorStatsServiceProto";
option java_package = "com.google.devtools.clouderrorreporting.v1beta1";
option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1";
// An API for retrieving and managing error statistics as well as data for
// individual events.
service ErrorStatsService {
// Lists the specified groups.
rpc ListGroupStats(ListGroupStatsRequest) returns (ListGroupStatsResponse) {
option (google.api.http) = { get: "/v1beta1/{project_name=projects/*}/groupStats" };
}
// Lists the specified events.
rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) {
option (google.api.http) = { get: "/v1beta1/{project_name=projects/*}/events" };
}
// Deletes all error events of a given project.
rpc DeleteEvents(DeleteEventsRequest) returns (DeleteEventsResponse) {
option (google.api.http) = { delete: "/v1beta1/{project_name=projects/*}/events" };
}
}
// Specifies a set of `ErrorGroupStats` to return.
message ListGroupStatsRequest {
// [Required] The resource name of the Google Cloud Platform project. Written
// as <code>projects/</code> plus the
// <a href="https://support.google.com/cloud/answer/6158840">Google Cloud
// Platform project ID</a>.
//
// Example: <code>projects/my-project-123</code>.
string project_name = 1;
// [Optional] List all <code>ErrorGroupStats</code> with these IDs.
repeated string group_id = 2;
// [Optional] List only <code>ErrorGroupStats</code> which belong to a service
// context that matches the filter.
// Data for all service contexts is returned if this field is not specified.
ServiceContextFilter service_filter = 3;
// [Optional] List data for the given time range.
// If not set a default time range is used. The field time_range_begin
// in the response will specify the beginning of this time range.
// Only <code>ErrorGroupStats</code> with a non-zero count in the given time
// range are returned, unless the request contains an explicit group_id list.
// If a group_id list is given, also <code>ErrorGroupStats</code> with zero
// occurrences are returned.
QueryTimeRange time_range = 5;
// [Optional] The preferred duration for a single returned `TimedCount`.
// If not set, no timed counts are returned.
google.protobuf.Duration timed_count_duration = 6;
// [Optional] The alignment of the timed counts to be returned.
// Default is `ALIGNMENT_EQUAL_AT_END`.
TimedCountAlignment alignment = 7;
// [Optional] Time where the timed counts shall be aligned if rounded
// alignment is chosen. Default is 00:00 UTC.
google.protobuf.Timestamp alignment_time = 8;
// [Optional] The sort order in which the results are returned.
// Default is `COUNT_DESC`.
ErrorGroupOrder order = 9;
// [Optional] The maximum number of results to return per response.
// Default is 20.
int32 page_size = 11;
// [Optional] A `next_page_token` provided by a previous response. To view
// additional results, pass this token along with the identical query
// parameters as the first request.
string page_token = 12;
}
// Contains a set of requested error group stats.
message ListGroupStatsResponse {
// The error group stats which match the given request.
repeated ErrorGroupStats error_group_stats = 1;
// If non-empty, more results are available.
// Pass this token, along with the same query parameters as the first
// request, to view the next page of results.
string next_page_token = 2;
// The timestamp specifies the start time to which the request was restricted.
// The start time is set based on the requested time range. It may be adjusted
// to a later time if a project has exceeded the storage quota and older data
// has been deleted.
google.protobuf.Timestamp time_range_begin = 4;
}
// Data extracted for a specific group based on certain filter criteria,
// such as a given time period and/or service filter.
message ErrorGroupStats {
// Group data that is independent of the filter criteria.
ErrorGroup group = 1;
// Approximate total number of events in the given group that match
// the filter criteria.
int64 count = 2;
// Approximate number of affected users in the given group that
// match the filter criteria.
// Users are distinguished by data in the `ErrorContext` of the
// individual error events, such as their login name or their remote
// IP address in case of HTTP requests.
// The number of affected users can be zero even if the number of
// errors is non-zero if no data was provided from which the
// affected user could be deduced.
// Users are counted based on data in the request
// context that was provided in the error report. If more users are
// implicitly affected, such as due to a crash of the whole service,
// this is not reflected here.
int64 affected_users_count = 3;
// Approximate number of occurrences over time.
// Timed counts returned by ListGroups are guaranteed to be:
//
// - Inside the requested time interval
// - Non-overlapping, and
// - Ordered by ascending time.
repeated TimedCount timed_counts = 4;
// Approximate first occurrence that was ever seen for this group
// and which matches the given filter criteria, ignoring the
// time_range that was specified in the request.
google.protobuf.Timestamp first_seen_time = 5;
// Approximate last occurrence that was ever seen for this group and
// which matches the given filter criteria, ignoring the time_range
// that was specified in the request.
google.protobuf.Timestamp last_seen_time = 6;
// Service contexts with a non-zero error count for the given filter
// criteria. This list can be truncated if multiple services are affected.
// Refer to `num_affected_services` for the total count.
repeated ServiceContext affected_services = 7;
// The total number of services with a non-zero error count for the given
// filter criteria.
int32 num_affected_services = 8;
// An arbitrary event that is chosen as representative for the whole group.
// The representative event is intended to be used as a quick preview for
// the whole group. Events in the group are usually sufficiently similar
// to each other such that showing an arbitrary representative provides
// insight into the characteristics of the group as a whole.
ErrorEvent representative = 9;
}
// The number of errors in a given time period.
// All numbers are approximate since the error events are sampled
// before counting them.
message TimedCount {
// Approximate number of occurrences in the given time period.
int64 count = 1;
// Start of the time period to which `count` refers (included).
google.protobuf.Timestamp start_time = 2;
// End of the time period to which `count` refers (excluded).
google.protobuf.Timestamp end_time = 3;
}
// Specifies a set of error events to return.
message ListEventsRequest {
// [Required] The resource name of the Google Cloud Platform project. Written
// as `projects/` plus the
// [Google Cloud Platform project
// ID](https://support.google.com/cloud/answer/6158840).
// Example: `projects/my-project-123`.
string project_name = 1;
// [Required] The group for which events shall be returned.
string group_id = 2;
// [Optional] List only ErrorGroups which belong to a service context that
// matches the filter.
// Data for all service contexts is returned if this field is not specified.
ServiceContextFilter service_filter = 3;
// [Optional] List only data for the given time range.
// If not set a default time range is used. The field time_range_begin
// in the response will specify the beginning of this time range.
QueryTimeRange time_range = 4;
// [Optional] The maximum number of results to return per response.
int32 page_size = 6;
// [Optional] A `next_page_token` provided by a previous response.
string page_token = 7;
}
// Contains a set of requested error events.
message ListEventsResponse {
// The error events which match the given request.
repeated ErrorEvent error_events = 1;
// If non-empty, more results are available.
// Pass this token, along with the same query parameters as the first
// request, to view the next page of results.
string next_page_token = 2;
// The timestamp specifies the start time to which the request was restricted.
google.protobuf.Timestamp time_range_begin = 4;
}
// Requests might be rejected or the resulting timed count durations might be
// adjusted for lower durations.
message QueryTimeRange {
// The supported time ranges.
enum Period {
// Do not use.
PERIOD_UNSPECIFIED = 0;
// Retrieve data for the last hour.
// Recommended minimum timed count duration: 1 min.
PERIOD_1_HOUR = 1;
// Retrieve data for the last 6 hours.
// Recommended minimum timed count duration: 10 min.
PERIOD_6_HOURS = 2;
// Retrieve data for the last day.
// Recommended minimum timed count duration: 1 hour.
PERIOD_1_DAY = 3;
// Retrieve data for the last week.
// Recommended minimum timed count duration: 6 hours.
PERIOD_1_WEEK = 4;
// Retrieve data for the last 30 days.
// Recommended minimum timed count duration: 1 day.
PERIOD_30_DAYS = 5;
}
// Restricts the query to the specified time range.
Period period = 1;
}
// Specifies criteria for filtering a subset of service contexts.
// The fields in the filter correspond to the fields in `ServiceContext`.
// Only exact, case-sensitive matches are supported.
// If a field is unset or empty, it matches arbitrary values.
message ServiceContextFilter {
// [Optional] The exact value to match against
// [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).
string service = 2;
// [Optional] The exact value to match against
// [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).
string version = 3;
// [Optional] The exact value to match against
// [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).
string resource_type = 4;
}
// Deletes all events in the project.
message DeleteEventsRequest {
// [Required] The resource name of the Google Cloud Platform project. Written
// as `projects/` plus the
// [Google Cloud Platform project
// ID](https://support.google.com/cloud/answer/6158840).
// Example: `projects/my-project-123`.
string project_name = 1;
}
// Response message for deleting error events.
message DeleteEventsResponse {
}
// Specifies how the time periods of error group counts are aligned.
enum TimedCountAlignment {
// No alignment specified.
ERROR_COUNT_ALIGNMENT_UNSPECIFIED = 0;
// The time periods shall be consecutive, have width equal to the
// requested duration, and be aligned at the `alignment_time` provided in
// the request.
// The `alignment_time` does not have to be inside the query period but
// even if it is outside, only time periods are returned which overlap
// with the query period.
// A rounded alignment will typically result in a
// different size of the first or the last time period.
ALIGNMENT_EQUAL_ROUNDED = 1;
// The time periods shall be consecutive, have width equal to the
// requested duration, and be aligned at the end of the requested time
// period. This can result in a different size of the
// first time period.
ALIGNMENT_EQUAL_AT_END = 2;
}
// A sorting order of error groups.
enum ErrorGroupOrder {
// No group order specified.
GROUP_ORDER_UNSPECIFIED = 0;
// Total count of errors in the given time window in descending order.
COUNT_DESC = 1;
// Timestamp when the group was last seen in the given time window
// in descending order.
LAST_SEEN_DESC = 2;
// Timestamp when the group was created in descending order.
CREATED_DESC = 3;
// Number of affected users in the given time window in descending order.
AFFECTED_USERS_DESC = 4;
}

View File

@@ -0,0 +1,82 @@
// Copyright 2016 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.clouderrorreporting.v1beta1;
import "google/api/annotations.proto";
import "google/devtools/clouderrorreporting/v1beta1/common.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting";
option java_multiple_files = true;
option java_outer_classname = "ReportErrorsServiceProto";
option java_package = "com.google.devtools.clouderrorreporting.v1beta1";
option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1";
// An API for reporting error events.
service ReportErrorsService {
// Report an individual error event.
//
// This endpoint accepts <strong>either</strong> an OAuth token,
// <strong>or</strong> an
// <a href="https://support.google.com/cloud/answer/6158862">API key</a>
// for authentication. To use an API key, append it to the URL as the value of
// a `key` parameter. For example:
// <pre>POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre>
rpc ReportErrorEvent(ReportErrorEventRequest) returns (ReportErrorEventResponse) {
option (google.api.http) = { post: "/v1beta1/{project_name=projects/*}/events:report" body: "event" };
}
}
// A request for reporting an individual error event.
message ReportErrorEventRequest {
// [Required] The resource name of the Google Cloud Platform project. Written
// as `projects/` plus the
// [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840).
// Example: `projects/my-project-123`.
string project_name = 1;
// [Required] The error event to be reported.
ReportedErrorEvent event = 2;
}
// Response for reporting an individual error event.
// Data may be added to this message in the future.
message ReportErrorEventResponse {
}
// An error event which is reported to the Error Reporting system.
message ReportedErrorEvent {
// [Optional] Time when the event occurred.
// If not provided, the time when the event was received by the
// Error Reporting system will be used.
google.protobuf.Timestamp event_time = 1;
// [Required] The service context in which this error has occurred.
ServiceContext service_context = 2;
// [Required] A message describing the error. The message can contain an
// exception stack in one of the supported programming languages and formats.
// In that case, the message is parsed and detailed exception information
// is returned when retrieving the error event again.
string message = 3;
// [Optional] A description of the context in which the error occurred.
ErrorContext context = 4;
}

View File

@@ -0,0 +1,169 @@
// Copyright 2017 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.cloudprofiler.v2;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2;cloudprofiler";
// Service for recording the profiling data from profiling agents running
// in the cloud or from an offline provider of profiling data.
//
// General guidelines:
// * Profiles for a single deployment must be created in ascending time order.
// * Profiles can be created in either online or offline mode, see below.
service ProfilerService {
// CreateProfile creates a new profile resource.
//
// In the online creation mode:
// * The server ensures that the new profiles are created at a constant rate
// per deployment, so the creation request may hang for some time until the
// next profile session is available.
// * The request may fail with ABORTED error if the creation is not
// available within ~1m, the response will indicate the duration of the
// backoff the client should take before attempting creating a profile
// again. The backoff duration is returned in google.rpc.RetryInfo extension
// on the response status. To a gRPC client, the extension will be return as
// a binary-serialized proto in the trailing metadata item named
// "google.rpc.retryinfo-bin".
//
// In the offline creation mode:
// * The client provides the profile to create along with the profile bytes,
// the server records it.
rpc CreateProfile(CreateProfileRequest) returns (Profile) {
option (google.api.http) = { post: "/v2/projects/{deployment.project_id}/profiles" body: "*" };
}
// UpdateProfile updates the profile bytes and labels on the profile resource
// created in the online mode.
rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
option (google.api.http) = { patch: "/v2/{profile.name=projects/*/profiles/*}" body: "profile" };
}
}
// CreateProfileRequest describes a profile resource creation request.
// Deployment field must be populated for both online and offline modes.
// For the online mode, profile field is not set and the profile_type specifies
// the list of profile types supported by the agent. The creation call will hang
// until a profile of one of these types needs to be collected. For offline
// mode, profile field must be set, profile_type must be empty, and deployment
// field must be identical to the deployment in the profile.
message CreateProfileRequest {
// Deployment details.
Deployment deployment = 1;
// Online mode: One or more profile types that the agent is capable of
// providing.
repeated ProfileType profile_type = 2;
// Offline mode: Contents of the profile to create.
Profile profile = 3;
}
// UpdateProfileRequest contains the profile to update.
message UpdateProfileRequest {
// Profile to update
Profile profile = 1;
}
// Profile resource.
message Profile {
// Opaque, server-assigned, unique ID for this profile.
// Output only.
string name = 1;
// Type of profile.
// Input (for the offline mode) or output (for the online mode).
ProfileType profile_type = 2;
// Deployment this profile corresponds to.
Deployment deployment = 3;
// Duration of the profiling session.
// Input (for the offline mode) or output (for the online mode).
// The field represents requested profiling duration. It may slightly differ
// from the effective profiling duration, which is recorded in the profile
// data, in case the profiling can't be stopped immediately (e.g. in case
// stopping the profiling is handled asynchronously).
google.protobuf.Duration duration = 4;
// Profile bytes, as a gzip compressed serialized proto, the format is
// https://github.com/google/pprof/blob/master/proto/profile.proto.
bytes profile_bytes = 5;
// Labels associated to this specific profile. These labels will get merged
// with the deployment labels for the final data set.
// See documentation on deployment labels for validation rules and limits.
// Input only, will not be populated on responses.
map<string, string> labels = 6;
}
// Deployment contains the deployment identification information.
message Deployment {
// Project ID is the ID of a cloud project.
// Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`.
string project_id = 1;
// Target is the service name used to group related deployments:
// * Service name for GAE Flex / Standard.
// * Cluster and container name for GKE.
// * User-specified string for direct GCE profiling (e.g. Java).
// * Job name for Dataflow.
// Validation regex: `^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
string target = 2;
// Labels identify the deployment within the user universe and same target.
// Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
// Value for an individual label must be <= 512 bytes, the total
// size of all label names and values must be <= 1024 bytes.
//
// Label named "language" can be used to record the programming language of
// the profiled deployment. The standard choices for the value include "java",
// "go", "python", "ruby", "nodejs", "php", "dotnet".
//
// For deployments running on Google Cloud Platform, "zone" or "region" label
// should be present describing the deployment location. An example of a zone
// is "us-central1-a", an example of a region is "us-central1" or
// "us-central".
map<string, string> labels = 3;
}
// ProfileType is type of profiling data.
// NOTE: the enumeration member names are used (in lowercase) as unique string
// identifiers of profile types, so they must not be renamed.
enum ProfileType {
// Unspecified profile type.
PROFILE_TYPE_UNSPECIFIED = 0;
// Thread CPU time sampling.
CPU = 1;
// Wallclock time sampling. More expensive as stops all threads.
WALL = 2;
// Heap allocation sampling.
HEAP = 3;
// Single-shot collection of all thread stacks.
THREADS = 4;
// Synchronization contention profile.
CONTENTION = 5;
}

View File

@@ -0,0 +1,283 @@
// Copyright 2017 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.cloudtrace.v1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Trace.V1";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1;cloudtrace";
option java_multiple_files = true;
option java_outer_classname = "TraceProto";
option java_package = "com.google.devtools.cloudtrace.v1";
option php_namespace = "Google\\Cloud\\Trace\\V1";
// This file describes an API for collecting and viewing traces and spans
// within a trace. A Trace is a collection of spans corresponding to a single
// operation or set of operations for an application. A span is an individual
// timed event which forms a node of the trace tree. Spans for a single trace
// may span multiple services.
service TraceService {
// Returns of a list of traces that match the specified filter conditions.
rpc ListTraces(ListTracesRequest) returns (ListTracesResponse) {
option (google.api.http) = { get: "/v1/projects/{project_id}/traces" };
}
// Gets a single trace by its ID.
rpc GetTrace(GetTraceRequest) returns (Trace) {
option (google.api.http) = { get: "/v1/projects/{project_id}/traces/{trace_id}" };
}
// Sends new traces to Stackdriver Trace or updates existing traces. If the ID
// of a trace that you send matches that of an existing trace, any fields
// in the existing trace and its spans are overwritten by the provided values,
// and any new fields provided are merged with the existing trace data. If the
// ID does not match, a new trace is created.
rpc PatchTraces(PatchTracesRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { patch: "/v1/projects/{project_id}/traces" body: "traces" };
}
}
// A trace describes how long it takes for an application to perform an
// operation. It consists of a set of spans, each of which represent a single
// timed event within the operation.
message Trace {
// Project ID of the Cloud project where the trace data is stored.
string project_id = 1;
// Globally unique identifier for the trace. This identifier is a 128-bit
// numeric value formatted as a 32-byte hex string.
string trace_id = 2;
// Collection of spans in the trace.
repeated TraceSpan spans = 3;
}
// List of new or updated traces.
message Traces {
// List of traces.
repeated Trace traces = 1;
}
// A span represents a single timed event within a trace. Spans can be nested
// and form a trace tree. Often, a trace contains a root span that describes the
// end-to-end latency of an operation and, optionally, one or more subspans for
// its suboperations. Spans do not need to be contiguous. There may be gaps
// between spans in a trace.
message TraceSpan {
// Type of span. Can be used to specify additional relationships between spans
// in addition to a parent/child relationship.
enum SpanKind {
// Unspecified.
SPAN_KIND_UNSPECIFIED = 0;
// Indicates that the span covers server-side handling of an RPC or other
// remote network request.
RPC_SERVER = 1;
// Indicates that the span covers the client-side wrapper around an RPC or
// other remote request.
RPC_CLIENT = 2;
}
// Identifier for the span. Must be a 64-bit integer other than 0 and
// unique within a trace.
fixed64 span_id = 1;
// Distinguishes between spans generated in a particular context. For example,
// two spans with the same name may be distinguished using `RPC_CLIENT`
// and `RPC_SERVER` to identify queueing latency associated with the span.
SpanKind kind = 2;
// Name of the span. Must be less than 128 bytes. The span name is sanitized
// and displayed in the Stackdriver Trace tool in the
// {% dynamic print site_values.console_name %}.
// The name may be a method name or some other per-call site name.
// For the same executable and the same call point, a best practice is
// to use a consistent name, which makes it easier to correlate
// cross-trace spans.
string name = 3;
// Start time of the span in nanoseconds from the UNIX epoch.
google.protobuf.Timestamp start_time = 4;
// End time of the span in nanoseconds from the UNIX epoch.
google.protobuf.Timestamp end_time = 5;
// ID of the parent span, if any. Optional.
fixed64 parent_span_id = 6;
// Collection of labels associated with the span. Label keys must be less than
// 128 bytes. Label values must be less than 16 kilobytes (10MB for
// `/stacktrace` values).
//
// Some predefined label keys exist, or you may create your own. When creating
// your own, we recommend the following formats:
//
// * `/category/product/key` for agents of well-known products (e.g.
// `/db/mongodb/read_size`).
// * `short_host/path/key` for domain-specific keys (e.g.
// `foo.com/myproduct/bar`)
//
// Predefined labels include:
//
// * `/agent`
// * `/component`
// * `/error/message`
// * `/error/name`
// * `/http/client_city`
// * `/http/client_country`
// * `/http/client_protocol`
// * `/http/client_region`
// * `/http/host`
// * `/http/method`
// * `/http/redirected_url`
// * `/http/request/size`
// * `/http/response/size`
// * `/http/status_code`
// * `/http/url`
// * `/http/user_agent`
// * `/pid`
// * `/stacktrace`
// * `/tid`
map<string, string> labels = 7;
}
// The request message for the `ListTraces` method. All fields are required
// unless specified.
message ListTracesRequest {
// Type of data returned for traces in the list.
enum ViewType {
// Default is `MINIMAL` if unspecified.
VIEW_TYPE_UNSPECIFIED = 0;
// Minimal view of the trace record that contains only the project
// and trace IDs.
MINIMAL = 1;
// Root span view of the trace record that returns the root spans along
// with the minimal trace data.
ROOTSPAN = 2;
// Complete view of the trace record that contains the actual trace data.
// This is equivalent to calling the REST `get` or RPC `GetTrace` method
// using the ID of each listed trace.
COMPLETE = 3;
}
// ID of the Cloud project where the trace data is stored.
string project_id = 1;
// Type of data returned for traces in the list. Optional. Default is
// `MINIMAL`.
ViewType view = 2;
// Maximum number of traces to return. If not specified or <= 0, the
// implementation selects a reasonable value. The implementation may
// return fewer traces than the requested page size. Optional.
int32 page_size = 3;
// Token identifying the page of results to return. If provided, use the
// value of the `next_page_token` field from a previous request. Optional.
string page_token = 4;
// Start of the time interval (inclusive) during which the trace data was
// collected from the application.
google.protobuf.Timestamp start_time = 5;
// End of the time interval (inclusive) during which the trace data was
// collected from the application.
google.protobuf.Timestamp end_time = 6;
// An optional filter against labels for the request.
//
// By default, searches use prefix matching. To specify exact match, prepend
// a plus symbol (`+`) to the search term.
// Multiple terms are ANDed. Syntax:
//
// * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root
// span starts with `NAME_PREFIX`.
// * `+root:NAME` or `+NAME`: Return traces where any root span's name is
// exactly `NAME`.
// * `span:NAME_PREFIX`: Return traces where any span starts with
// `NAME_PREFIX`.
// * `+span:NAME`: Return traces where any span's name is exactly
// `NAME`.
// * `latency:DURATION`: Return traces whose overall latency is
// greater or equal to than `DURATION`. Accepted units are nanoseconds
// (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For
// example, `latency:24ms` returns traces whose overall latency
// is greater than or equal to 24 milliseconds.
// * `label:LABEL_KEY`: Return all traces containing the specified
// label key (exact match, case-sensitive) regardless of the key:value
// pair's value (including empty values).
// * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified
// label key (exact match, case-sensitive) whose value starts with
// `VALUE_PREFIX`. Both a key and a value must be specified.
// * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair
// exactly matching the specified text. Both a key and a value must be
// specified.
// * `method:VALUE`: Equivalent to `/http/method:VALUE`.
// * `url:VALUE`: Equivalent to `/http/url:VALUE`.
string filter = 7;
// Field used to sort the returned traces. Optional.
// Can be one of the following:
//
// * `trace_id`
// * `name` (`name` field of root span in the trace)
// * `duration` (difference between `end_time` and `start_time` fields of
// the root span)
// * `start` (`start_time` field of the root span)
//
// Descending order can be specified by appending `desc` to the sort field
// (for example, `name desc`).
//
// Only one sort field is permitted.
string order_by = 8;
}
// The response message for the `ListTraces` method.
message ListTracesResponse {
// List of trace records returned.
repeated Trace traces = 1;
// If defined, indicates that there are more traces that match the request
// and that this value should be passed to the next request to continue
// retrieving additional traces.
string next_page_token = 2;
}
// The request message for the `GetTrace` method.
message GetTraceRequest {
// ID of the Cloud project where the trace data is stored.
string project_id = 1;
// ID of the trace to return.
string trace_id = 2;
}
// The request message for the `PatchTraces` method.
message PatchTracesRequest {
// ID of the Cloud project where the trace data is stored.
string project_id = 1;
// The body of the message.
Traces traces = 2;
}

View File

@@ -0,0 +1,336 @@
// Copyright 2017 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.cloudtrace.v2;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.Trace.V2";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace";
option java_multiple_files = true;
option java_outer_classname = "TraceProto";
option java_package = "com.google.devtools.cloudtrace.v2";
option php_namespace = "Google\\Cloud\\Trace\\V2";
// A span represents a single operation within a trace. Spans can be
// nested to form a trace tree. Often, a trace contains a root span
// that describes the end-to-end latency, and one or more subspans for
// its sub-operations. A trace can also contain multiple root spans,
// or none at all. Spans do not need to be contiguous&mdash;there may be
// gaps or overlaps between spans in a trace.
message Span {
// A set of attributes, each in the format `[KEY]:[VALUE]`.
message Attributes {
// The set of attributes. Each attribute's key can be up to 128 bytes
// long. The value can be a string up to 256 bytes, an integer, or the
// Boolean values `true` and `false`. For example:
//
// "/instance_id": "my-instance"
// "/http/user_agent": ""
// "/http/request_bytes": 300
// "abc.com/myattribute": true
map<string, AttributeValue> attribute_map = 1;
// The number of attributes that were discarded. Attributes can be discarded
// because their keys are too long or because there are too many attributes.
// If this value is 0 then all attributes are valid.
int32 dropped_attributes_count = 2;
}
// A time-stamped annotation or message event in the Span.
message TimeEvent {
// Text annotation with a set of attributes.
message Annotation {
// A user-supplied message describing the event. The maximum length for
// the description is 256 bytes.
TruncatableString description = 1;
// A set of attributes on the annotation. You can have up to 4 attributes
// per Annotation.
Attributes attributes = 2;
}
// An event describing a message sent/received between Spans.
message MessageEvent {
// Indicates whether the message was sent or received.
enum Type {
// Unknown event type.
TYPE_UNSPECIFIED = 0;
// Indicates a sent message.
SENT = 1;
// Indicates a received message.
RECEIVED = 2;
}
// Type of MessageEvent. Indicates whether the message was sent or
// received.
Type type = 1;
// An identifier for the MessageEvent's message that can be used to match
// SENT and RECEIVED MessageEvents. It is recommended to be unique within
// a Span.
int64 id = 2;
// The number of uncompressed bytes sent or received.
int64 uncompressed_size_bytes = 3;
// The number of compressed bytes sent or received. If missing assumed to
// be the same size as uncompressed.
int64 compressed_size_bytes = 4;
}
// The timestamp indicating the time the event occurred.
google.protobuf.Timestamp time = 1;
// A `TimeEvent` can contain either an `Annotation` object or a
// `MessageEvent` object, but not both.
oneof value {
// Text annotation with a set of attributes.
Annotation annotation = 2;
// An event describing a message sent/received between Spans.
MessageEvent message_event = 3;
}
}
// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
// on the span, consisting of either user-supplied key:value pairs, or
// details of a message sent/received between Spans.
message TimeEvents {
// A collection of `TimeEvent`s.
repeated TimeEvent time_event = 1;
// The number of dropped annotations in all the included time events.
// If the value is 0, then no annotations were dropped.
int32 dropped_annotations_count = 2;
// The number of dropped message events in all the included time events.
// If the value is 0, then no message events were dropped.
int32 dropped_message_events_count = 3;
}
// A pointer from the current span to another span in the same trace or in a
// different trace. For example, this can be used in batching operations,
// where a single batch handler processes multiple requests from different
// traces or when the handler receives a request from a different project.
message Link {
// The relationship of the current span relative to the linked span: child,
// parent, or unspecified.
enum Type {
// The relationship of the two spans is unknown.
TYPE_UNSPECIFIED = 0;
// The linked span is a child of the current span.
CHILD_LINKED_SPAN = 1;
// The linked span is a parent of the current span.
PARENT_LINKED_SPAN = 2;
}
// The [TRACE_ID] for a trace within a project.
string trace_id = 1;
// The [SPAN_ID] for a span within a trace.
string span_id = 2;
// The relationship of the current span relative to the linked span.
Type type = 3;
// A set of attributes on the link. You have have up to 32 attributes per
// link.
Attributes attributes = 4;
}
// A collection of links, which are references from this span to a span
// in the same or different trace.
message Links {
// A collection of links.
repeated Link link = 1;
// The number of dropped links after the maximum size was enforced. If
// this value is 0, then no links were dropped.
int32 dropped_links_count = 2;
}
// The resource name of the span in the following format:
//
// projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
//
// [TRACE_ID] is a unique identifier for a trace within a project;
// it is a 32-character hexadecimal encoding of a 16-byte array.
//
// [SPAN_ID] is a unique identifier for a span within a trace; it
// is a 16-character hexadecimal encoding of an 8-byte array.
string name = 1;
// The [SPAN_ID] portion of the span's resource name.
string span_id = 2;
// The [SPAN_ID] of this span's parent span. If this is a root span,
// then this field must be empty.
string parent_span_id = 3;
// A description of the span's operation (up to 128 bytes).
// Stackdriver Trace displays the description in the
// {% dynamic print site_values.console_name %}.
// For example, the display name can be a qualified method name or a file name
// and a line number where the operation is called. A best practice is to use
// the same display name within an application and at the same call point.
// This makes it easier to correlate spans in different traces.
TruncatableString display_name = 4;
// The start time of the span. On the client side, this is the time kept by
// the local machine where the span execution starts. On the server side, this
// is the time when the server's application handler starts running.
google.protobuf.Timestamp start_time = 5;
// The end time of the span. On the client side, this is the time kept by
// the local machine where the span execution ends. On the server side, this
// is the time when the server application handler stops running.
google.protobuf.Timestamp end_time = 6;
// A set of attributes on the span. You can have up to 32 attributes per
// span.
Attributes attributes = 7;
// Stack trace captured at the start of the span.
StackTrace stack_trace = 8;
// A set of time events. You can have up to 32 annotations and 128 message
// events per span.
TimeEvents time_events = 9;
// Links associated with the span. You can have up to 128 links per Span.
Links links = 10;
// An optional final status for this span.
google.rpc.Status status = 11;
// (Optional) Set this parameter to indicate whether this span is in
// the same process as its parent. If you do not set this parameter,
// Stackdriver Trace is unable to take advantage of this helpful
// information.
google.protobuf.BoolValue same_process_as_parent_span = 12;
// An optional number of child spans that were generated while this span
// was active. If set, allows implementation to detect missing child spans.
google.protobuf.Int32Value child_span_count = 13;
}
// The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
message AttributeValue {
// The type of the value.
oneof value {
// A string up to 256 bytes long.
TruncatableString string_value = 1;
// A 64-bit signed integer.
int64 int_value = 2;
// A Boolean value represented by `true` or `false`.
bool bool_value = 3;
}
}
// A call stack appearing in a trace.
message StackTrace {
// Represents a single stack frame in a stack trace.
message StackFrame {
// The fully-qualified name that uniquely identifies the function or
// method that is active in this frame (up to 1024 bytes).
TruncatableString function_name = 1;
// An un-mangled function name, if `function_name` is
// [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
// be fully-qualified (up to 1024 bytes).
TruncatableString original_function_name = 2;
// The name of the source file where the function call appears (up to 256
// bytes).
TruncatableString file_name = 3;
// The line number in `file_name` where the function call appears.
int64 line_number = 4;
// The column number where the function call appears, if available.
// This is important in JavaScript because of its anonymous functions.
int64 column_number = 5;
// The binary module from where the code was loaded.
Module load_module = 6;
// The version of the deployed source code (up to 128 bytes).
TruncatableString source_version = 7;
}
// A collection of stack frames, which can be truncated.
message StackFrames {
// Stack frames in this call stack.
repeated StackFrame frame = 1;
// The number of stack frames that were dropped because there
// were too many stack frames.
// If this value is 0, then no stack frames were dropped.
int32 dropped_frames_count = 2;
}
// Stack frames in this stack trace. A maximum of 128 frames are allowed.
StackFrames stack_frames = 1;
// The hash ID is used to conserve network bandwidth for duplicate
// stack traces within a single trace.
//
// Often multiple spans will have identical stack traces.
// The first occurrence of a stack trace should contain both the
// `stackFrame` content and a value in `stackTraceHashId`.
//
// Subsequent spans within the same request can refer
// to that stack trace by only setting `stackTraceHashId`.
int64 stack_trace_hash_id = 2;
}
// Binary module.
message Module {
// For example: main binary, kernel modules, and dynamic libraries
// such as libc.so, sharedlib.so (up to 256 bytes).
TruncatableString module = 1;
// A unique identifier for the module, usually a hash of its
// contents (up to 128 bytes).
TruncatableString build_id = 2;
}
// Represents a string that might be shortened to a specified length.
message TruncatableString {
// The shortened string. For example, if the original string is 500
// bytes long and the limit of the string is 128 bytes, then
// `value` contains the first 128 bytes of the 500-byte string.
//
// Truncation always happens on a UTF8 character boundary. If there
// are multi-byte characters in the string, then the length of the
// shortened string might be less than the size limit.
string value = 1;
// The number of bytes removed from the original string. If this
// value is 0, then the string was not shortened.
int32 truncated_byte_count = 2;
}

View File

@@ -0,0 +1,59 @@
// Copyright 2017 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.cloudtrace.v2;
import "google/api/annotations.proto";
import "google/devtools/cloudtrace/v2/trace.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Trace.V2";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace";
option java_multiple_files = true;
option java_outer_classname = "TracingProto";
option java_package = "com.google.devtools.cloudtrace.v2";
option php_namespace = "Google\\Cloud\\Trace\\V2";
// This file describes an API for collecting and viewing traces and spans
// within a trace. A Trace is a collection of spans corresponding to a single
// operation or set of operations for an application. A span is an individual
// timed event which forms a node of the trace tree. A single trace may
// contain span(s) from multiple services.
service TraceService {
// Sends new spans to new or existing traces. You cannot update
// existing spans.
rpc BatchWriteSpans(BatchWriteSpansRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { post: "/v2/{name=projects/*}/traces:batchWrite" body: "*" };
}
// Creates a new span.
rpc CreateSpan(Span) returns (Span) {
option (google.api.http) = { post: "/v2/{name=projects/*/traces/*}/spans" body: "*" };
}
}
// The request message for the `BatchWriteSpans` method.
message BatchWriteSpansRequest {
// Required. The name of the project where the spans belong. The format is
// `projects/[PROJECT_ID]`.
string name = 1;
// A list of new spans. The span names must not match existing
// spans, or the results are undefined.
repeated Span spans = 2;
}

View File

@@ -0,0 +1,103 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
import "google/devtools/containeranalysis/v1alpha1/package_vulnerability.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// PackageManager provides metadata about available / installed packages.
message PackageManager {
// This represents a particular channel of distribution for a given package.
// e.g. Debian's jessie-backports dpkg mirror
message Distribution {
// The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
// denoting the package manager version distributing a package.
string cpe_uri = 1;
// The CPU architecture for which packages in this distribution
// channel were built
Architecture architecture = 2;
// The latest available version of this package in
// this distribution channel.
VulnerabilityType.Version latest_version = 3;
// A freeform string denoting the maintainer of this package.
string maintainer = 4;
// The distribution channel-specific homepage for this package.
string url = 6;
// The distribution channel-specific description of this package.
string description = 7;
}
// An occurrence of a particular package installation found within a
// system's filesystem.
// e.g. glibc was found in /var/lib/dpkg/status
message Location {
// The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
// denoting the package manager version distributing a package.
string cpe_uri = 1;
// The version installed at this location.
VulnerabilityType.Version version = 2;
// The path from which we gathered that this package/version is installed.
string path = 3;
}
// This represents a particular package that is distributed over
// various channels.
// e.g. glibc (aka libc6) is distributed by many, at various versions.
message Package {
// The name of the package.
string name = 1;
// The various channels by which a package is distributed.
repeated Distribution distribution = 10;
}
// This represents how a particular software package may be installed on
// a system.
message Installation {
// Output only. The name of the installed package.
string name = 1;
// All of the places within the filesystem versions of this package
// have been found.
repeated Location location = 2;
}
// Instruction set architectures supported by various package managers.
enum Architecture {
// Unknown architecture
ARCHITECTURE_UNSPECIFIED = 0;
// X86 architecture
X86 = 1;
// X64 architecture
X64 = 2;
}
}

View File

@@ -0,0 +1,650 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
import "google/devtools/containeranalysis/v1alpha1/bill_of_materials.proto";
import "google/devtools/containeranalysis/v1alpha1/image_basis.proto";
import "google/devtools/containeranalysis/v1alpha1/package_vulnerability.proto";
import "google/devtools/containeranalysis/v1alpha1/provenance.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// Retrieves the results of vulnerability scanning of cloud components such as
// container images. The Container Analysis API is an implementation of the
// [Grafeas](grafeas.io) API.
//
// The vulnerability results are stored as a series of Occurrences.
// An `Occurrence` contains information about a specific vulnerability in a
// resource. An `Occurrence` references a `Note`. A `Note` contains details
// about the vulnerability and is stored in a stored in a separate project.
// Multiple `Occurrences` can reference the same `Note`. For example, an SSL
// vulnerability could affect multiple packages in an image. In this case,
// there would be one `Note` for the vulnerability and an `Occurrence` for
// each package with the vulnerability referencing that `Note`.
service ContainerAnalysis {
// Returns the requested `Occurrence`.
rpc GetOccurrence(GetOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = { get: "/v1alpha1/{name=projects/*/occurrences/*}" };
}
// Lists active `Occurrences` for a given project matching the filters.
rpc ListOccurrences(ListOccurrencesRequest) returns (ListOccurrencesResponse) {
option (google.api.http) = { get: "/v1alpha1/{parent=projects/*}/occurrences" };
}
// Deletes the given `Occurrence` from the system. Use this when
// an `Occurrence` is no longer applicable for the given resource.
rpc DeleteOccurrence(DeleteOccurrenceRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1alpha1/{name=projects/*/occurrences/*}" };
}
// Creates a new `Occurrence`. Use this method to create `Occurrences`
// for a resource.
rpc CreateOccurrence(CreateOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = { post: "/v1alpha1/{parent=projects/*}/occurrences" body: "occurrence" };
}
// Updates an existing occurrence.
rpc UpdateOccurrence(UpdateOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = { patch: "/v1alpha1/{name=projects/*/occurrences/*}" body: "occurrence" };
}
// Gets the `Note` attached to the given `Occurrence`.
rpc GetOccurrenceNote(GetOccurrenceNoteRequest) returns (Note) {
option (google.api.http) = { get: "/v1alpha1/{name=projects/*/occurrences/*}/notes" };
}
// Returns the requested `Note`.
rpc GetNote(GetNoteRequest) returns (Note) {
option (google.api.http) = { get: "/v1alpha1/{name=projects/*/notes/*}" };
}
// Lists all `Notes` for a given project.
rpc ListNotes(ListNotesRequest) returns (ListNotesResponse) {
option (google.api.http) = { get: "/v1alpha1/{parent=projects/*}/notes" };
}
// Deletes the given `Note` from the system.
rpc DeleteNote(DeleteNoteRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1alpha1/{name=projects/*/notes/*}" };
}
// Creates a new `Note`.
rpc CreateNote(CreateNoteRequest) returns (Note) {
option (google.api.http) = { post: "/v1alpha1/{parent=projects/*}/notes" body: "note" };
}
// Updates an existing `Note`.
rpc UpdateNote(UpdateNoteRequest) returns (Note) {
option (google.api.http) = { patch: "/v1alpha1/{name=projects/*/notes/*}" body: "note" };
}
// Lists `Occurrences` referencing the specified `Note`. Use this method to
// get all occurrences referencing your `Note` across all your customer
// projects.
rpc ListNoteOccurrences(ListNoteOccurrencesRequest) returns (ListNoteOccurrencesResponse) {
option (google.api.http) = { get: "/v1alpha1/{name=projects/*/notes/*}/occurrences" };
}
// Gets a summary of the number and severity of occurrences.
rpc GetVulnzOccurrencesSummary(GetVulnzOccurrencesSummaryRequest) returns (GetVulnzOccurrencesSummaryResponse) {
option (google.api.http) = { get: "/v1alpha1/{parent=projects/*}/vulnzsummary" };
}
// Sets the access control policy on the specified `Note` or `Occurrence`.
// Requires `containeranalysis.notes.setIamPolicy` or
// `containeranalysis.occurrences.setIamPolicy` permission if the resource is
// a `Note` or an `Occurrence`, respectively.
// Attempting to call this method without these permissions will result in a `
// `PERMISSION_DENIED` error.
// Attempting to call this method on a non-existent resource will result in a
// `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission
// on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or
// a `PERMISSION_DENIED` error otherwise. The resource takes the following
// formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences
// and projects/{projectid}/notes/{noteid} for notes
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = { post: "/v1alpha1/{resource=projects/*/notes/*}:setIamPolicy" body: "*" };
}
// Gets the access control policy for a note or an `Occurrence` resource.
// Requires `containeranalysis.notes.setIamPolicy` or
// `containeranalysis.occurrences.setIamPolicy` permission if the resource is
// a note or occurrence, respectively.
// Attempting to call this method on a resource without the required
// permission will result in a `PERMISSION_DENIED` error. Attempting to call
// this method on a non-existent resource will result in a `NOT_FOUND` error
// if the user has list permission on the project, or a `PERMISSION_DENIED`
// error otherwise. The resource takes the following formats:
// `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and
// projects/{PROJECT_ID}/notes/{NOTE_ID} for notes
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = { post: "/v1alpha1/{resource=projects/*/notes/*}:getIamPolicy" body: "*" };
}
// Returns the permissions that a caller has on the specified note or
// occurrence resource. Requires list permission on the project (for example,
// "storage.objects.list" on the containing bucket for testing permission of
// an object). Attempting to call this method on a non-existent resource will
// result in a `NOT_FOUND` error if the user has list permission on the
// project, or a `PERMISSION_DENIED` error otherwise. The resource takes the
// following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for
// `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes`
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = { post: "/v1alpha1/{resource=projects/*/notes/*}:testIamPermissions" body: "*" };
}
}
// `Occurrence` includes information about analysis occurrences for an image.
message Occurrence {
// Output only. The name of the `Occurrence` in the form
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}"
string name = 1;
// The unique URL of the image or the container for which the `Occurrence`
// applies. For example, https://gcr.io/project/image@sha256:foo This field
// can be used as a filter in list requests.
string resource_url = 2;
// An analysis note associated with this image, in the form
// "providers/{provider_id}/notes/{NOTE_ID}"
// This field can be used as a filter in list requests.
string note_name = 3;
// Output only. This explicitly denotes which of the `Occurrence` details are
// specified. This field can be used as a filter in list requests.
Note.Kind kind = 6;
// Describes the details of the vulnerability `Note` found in this resource.
oneof details {
// Details of a security vulnerability note.
VulnerabilityType.VulnerabilityDetails vulnerability_details = 8;
// Build details for a verifiable build.
BuildDetails build_details = 7;
// Describes how this resource derives from the basis
// in the associated note.
DockerImage.Derived derived_image = 11;
// Describes the installation of a package on the linked resource.
PackageManager.Installation installation = 12;
// Describes the deployment of an artifact on a runtime.
Deployable.Deployment deployment = 14;
// Describes the initial scan status for this resource.
Discovery.Discovered discovered = 15;
}
// A description of actions that can be taken to remedy the `Note`
string remediation = 5;
// Output only. The time this `Occurrence` was created.
google.protobuf.Timestamp create_time = 9;
// Output only. The time this `Occurrence` was last updated.
google.protobuf.Timestamp update_time = 10;
}
// Provides a detailed description of a `Note`.
message Note {
// Metadata for any related URL information
message RelatedUrl {
// Specific URL to associate with the note
string url = 1;
// Label to describe usage of the URL
string label = 2;
}
// This must be 1:1 with members of our oneofs, it can be used for filtering
// Note and Occurrence on their kind.
enum Kind {
// Unknown
KIND_UNSPECIFIED = 0;
// The note and occurrence represent a package vulnerability.
PACKAGE_VULNERABILITY = 2;
// The note and occurrence assert build provenance.
BUILD_DETAILS = 3;
// This represents an image basis relationship.
IMAGE_BASIS = 4;
// This represents a package installed via a package manager.
PACKAGE_MANAGER = 5;
// The note and occurrence track deployment events.
DEPLOYABLE = 6;
// The note and occurrence track the initial discovery status of a resource.
DISCOVERY = 7;
}
// The name of the note in the form
// "providers/{provider_id}/notes/{NOTE_ID}"
string name = 1;
// A one sentence description of this `Note`.
string short_description = 3;
// A detailed description of this `Note`.
string long_description = 4;
// Output only. This explicitly denotes which kind of note is specified. This
// field can be used as a filter in list requests.
Kind kind = 9;
// The type of note.
oneof note_type {
// A package vulnerability type of note.
VulnerabilityType vulnerability_type = 6;
// Build provenance type for a verifiable build.
BuildType build_type = 8;
// A note describing a base image.
DockerImage.Basis base_image = 13;
// A note describing a package hosted by various package managers.
PackageManager.Package package = 14;
// A note describing something that can be deployed.
Deployable deployable = 17;
// A note describing a provider/analysis type.
Discovery discovery = 18;
}
// URLs associated with this note
repeated RelatedUrl related_url = 7;
// Time of expiration for this note, null if note does not expire.
google.protobuf.Timestamp expiration_time = 10;
// Output only. The time this note was created. This field can be used as a
// filter in list requests.
google.protobuf.Timestamp create_time = 11;
// Output only. The time this note was last updated. This field can be used as
// a filter in list requests.
google.protobuf.Timestamp update_time = 12;
}
// An artifact that can be deployed in some runtime.
message Deployable {
// The period during which some deployable was active in a runtime.
message Deployment {
// Types of platforms.
enum Platform {
// Unknown
PLATFORM_UNSPECIFIED = 0;
// Google Container Engine
GKE = 1;
// Google App Engine: Flexible Environment
FLEX = 2;
// Custom user-defined platform
CUSTOM = 3;
}
// Identity of the user that triggered this deployment.
string user_email = 1;
// Beginning of the lifetime of this deployment.
google.protobuf.Timestamp deploy_time = 2;
// End of the lifetime of this deployment.
google.protobuf.Timestamp undeploy_time = 3;
// Configuration used to create this deployment.
string config = 8;
// Address of the runtime element hosting this deployment.
string address = 5;
// Output only. Resource URI for the artifact being deployed taken from the
// deployable field with the same name.
repeated string resource_uri = 6;
// Platform hosting this deployment.
Platform platform = 7;
}
// Resource URI for the artifact being deployed.
repeated string resource_uri = 1;
}
// A note that indicates a type of analysis a provider would perform. This note
// exists in a provider's project. A `Discovery` occurrence is created in a
// consumer's project at the start of analysis. The occurrence's operation will
// indicate the status of the analysis. Absence of an occurrence linked to this
// note for a resource indicates that analysis hasn't started.
message Discovery {
// Provides information about the scan status of a discovered resource.
message Discovered {
// Output only. An operation that indicates the status of the current scan.
google.longrunning.Operation operation = 1;
}
// The kind of analysis that is handled by this discovery.
Note.Kind analysis_kind = 1;
}
// Note holding the version of the provider's builder and the signature of
// the provenance message in linked BuildDetails.
message BuildType {
// Version of the builder which produced this Note.
string builder_version = 1;
// Signature of the build in Occurrences pointing to the Note containing this
// `BuilderDetails`.
BuildSignature signature = 2;
}
// Message encapsulating the signature of the verified build.
message BuildSignature {
// Public key formats
enum KeyType {
// `KeyType` is not set.
KEY_TYPE_UNSPECIFIED = 0;
// `PGP ASCII Armored` public key.
PGP_ASCII_ARMORED = 1;
// `PKIX PEM` public key.
PKIX_PEM = 2;
}
// Public key of the builder which can be used to verify that the related
// findings are valid and unchanged. If `key_type` is empty, this defaults
// to PEM encoded public keys.
//
// This field may be empty if `key_id` references an external key.
//
// For Cloud Container Builder based signatures, this is a PEM encoded public
// key. To verify the Cloud Container Builder signature, place the contents of
// this field into a file (public.pem). The signature field is base64-decoded
// into its binary representation in signature.bin, and the provenance bytes
// from `BuildDetails` are base64-decoded into a binary representation in
// signed.bin. OpenSSL can then verify the signature:
// `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
string public_key = 1;
// Signature of the related `BuildProvenance`, encoded in a base64 string.
string signature = 2;
// An Id for the key used to sign. This could be either an Id for the key
// stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
// CN for a cert), or a reference to an external key (such as a reference to a
// key in Cloud Key Management Service).
string key_id = 3;
// The type of the key, either stored in `public_key` or referenced in
// `key_id`
KeyType key_type = 4;
}
// Message encapsulating build provenance details.
message BuildDetails {
// The actual provenance
BuildProvenance provenance = 1;
// Serialized JSON representation of the provenance, used in generating the
// `BuildSignature` in the corresponding Result. After verifying the
// signature, `provenance_bytes` can be unmarshalled and compared to the
// provenance to confirm that it is unchanged. A base64-encoded string
// representation of the provenance bytes is used for the signature in order
// to interoperate with openssl which expects this format for signature
// verification.
//
// The serialized form is captured both to avoid ambiguity in how the
// provenance is marshalled to json as well to prevent incompatibilities with
// future changes.
string provenance_bytes = 2;
}
// Request to get a Occurrence.
message GetOccurrenceRequest {
// The name of the occurrence of the form
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}"
string name = 1;
}
// Request to list occurrences.
message ListOccurrencesRequest {
// The name field contains the project Id. For example:
// "projects/{project_id}
// @Deprecated
string name = 1;
// This contains the project Id for example: projects/{project_id}.
string parent = 5;
// The filter expression.
string filter = 2;
// Number of occurrences to return in the list.
int32 page_size = 3;
// Token to provide to skip to a particular spot in the list.
string page_token = 4;
}
// Response including listed active occurrences.
message ListOccurrencesResponse {
// The occurrences requested.
repeated Occurrence occurrences = 1;
// The next pagination token in the list response. It should be used as
// `page_token` for the following request. An empty value means no more
// results.
string next_page_token = 2;
}
// Request to delete a occurrence
message DeleteOccurrenceRequest {
// The name of the occurrence in the form of
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}"
string name = 1;
}
// Request to insert a new occurrence.
message CreateOccurrenceRequest {
// The name of the project. Should be of the form "projects/{project_id}".
// @Deprecated
string name = 1;
// This field contains the project Id for example: "projects/{project_id}"
string parent = 3;
// The occurrence to be inserted
Occurrence occurrence = 2;
}
// Request to update an existing occurrence
message UpdateOccurrenceRequest {
// The name of the occurrence.
// Should be of the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}".
string name = 1;
// The updated occurrence.
Occurrence occurrence = 2;
// The fields to update.
google.protobuf.FieldMask update_mask = 3;
}
// Request to get a Note.
message GetNoteRequest {
// The name of the note in the form of
// "providers/{provider_id}/notes/{NOTE_ID}"
string name = 1;
}
// Request to get the note to which this occurrence is attached.
message GetOccurrenceNoteRequest {
// The name of the occurrence in the form
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}"
string name = 1;
}
// Request to list notes.
message ListNotesRequest {
// The name field will contain the project Id for example:
// "providers/{provider_id}
// @Deprecated
string name = 1;
// This field contains the project Id for example:
// "project/{project_id}
string parent = 5;
// The filter expression.
string filter = 2;
// Number of notes to return in the list.
int32 page_size = 3;
// Token to provide to skip to a particular spot in the list.
string page_token = 4;
}
// Response including listed notes.
message ListNotesResponse {
// The occurrences requested
repeated Note notes = 1;
// The next pagination token in the list response. It should be used as
// page_token for the following request. An empty value means no more result.
string next_page_token = 2;
}
// Request to delete a note
message DeleteNoteRequest {
// The name of the note in the form of
// "providers/{provider_id}/notes/{NOTE_ID}"
string name = 1;
}
// Request to insert a new note
message CreateNoteRequest {
// The name of the project.
// Should be of the form "providers/{provider_id}".
// @Deprecated
string name = 1;
// This field contains the project Id for example:
// "project/{project_id}
string parent = 4;
// The ID to use for this note.
string note_id = 2;
// The Note to be inserted
Note note = 3;
}
// Request to update an existing note
message UpdateNoteRequest {
// The name of the note.
// Should be of the form "projects/{provider_id}/notes/{note_id}".
string name = 1;
// The updated note.
Note note = 2;
// The fields to update.
google.protobuf.FieldMask update_mask = 3;
}
// Request to list occurrences.
message ListNoteOccurrencesRequest {
// The name field will contain the note name for example:
// "provider/{provider_id}/notes/{note_id}"
string name = 1;
// The filter expression.
string filter = 2;
// Number of notes to return in the list.
int32 page_size = 3;
// Token to provide to skip to a particular spot in the list.
string page_token = 4;
}
// Response including listed occurrences for a note.
message ListNoteOccurrencesResponse {
// The occurrences attached to the specified note.
repeated Occurrence occurrences = 1;
// Token to receive the next page of notes.
string next_page_token = 2;
}
// Metadata for all operations used and required for all operations
// that created by Container Analysis Providers
message OperationMetadata {
// Output only. The time this operation was created.
google.protobuf.Timestamp create_time = 1;
// Output only. The time that this operation was marked completed or failed.
google.protobuf.Timestamp end_time = 2;
}
// Request to get the vulnz summary for some set of vulnerability Occurrences.
message GetVulnzOccurrencesSummaryRequest {
// This contains the project Id for example: projects/{project_id}
string parent = 1;
// The filter expression.
string filter = 2;
}
// A summary of how many vulnz occurrences there are per severity type.
// counts by groups, or if we should have different summary messages
// like this.
message GetVulnzOccurrencesSummaryResponse {
// The number of occurrences created for a specific severity.
message SeverityCount {
// The severity of the occurrences.
VulnerabilityType.Severity severity = 1;
// The number of occurrences with the severity.
int64 count = 2;
}
// A map of how many occurrences were found for each severity.
repeated SeverityCount counts = 1;
}

View File

@@ -0,0 +1,149 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// DockerImage holds types defining base image notes
// and derived image occurrences.
message DockerImage {
// Layer holds metadata specific to a layer of a Docker image.
message Layer {
// Instructions from dockerfile
enum Directive {
// Default value for unsupported/missing directive
DIRECTIVE_UNSPECIFIED = 0;
// https://docs.docker.com/reference/builder/#maintainer
MAINTAINER = 1;
// https://docs.docker.com/reference/builder/#run
RUN = 2;
// https://docs.docker.com/reference/builder/#cmd
CMD = 3;
// https://docs.docker.com/reference/builder/#label
LABEL = 4;
// https://docs.docker.com/reference/builder/#expose
EXPOSE = 5;
// https://docs.docker.com/reference/builder/#env
ENV = 6;
// https://docs.docker.com/reference/builder/#add
ADD = 7;
// https://docs.docker.com/reference/builder/#copy
COPY = 8;
// https://docs.docker.com/reference/builder/#entrypoint
ENTRYPOINT = 9;
// https://docs.docker.com/reference/builder/#volume
VOLUME = 10;
// https://docs.docker.com/reference/builder/#user
USER = 11;
// https://docs.docker.com/reference/builder/#workdir
WORKDIR = 12;
// https://docs.docker.com/reference/builder/#arg
ARG = 13;
// https://docs.docker.com/reference/builder/#onbuild
ONBUILD = 14;
// https://docs.docker.com/reference/builder/#stopsignal
STOPSIGNAL = 15;
// https://docs.docker.com/reference/builder/#healthcheck
HEALTHCHECK = 16;
// https://docs.docker.com/reference/builder/#shell
SHELL = 17;
}
// The recovered Dockerfile directive used to construct this layer.
Directive directive = 1;
// The recovered arguments to the Dockerfile directive.
string arguments = 2;
}
// A set of properties that uniquely identify a given Docker image.
message Fingerprint {
// The layer-id of the final layer in the Docker image's v1
// representation.
// This field can be used as a filter in list requests.
string v1_name = 1;
// The ordered list of v2 blobs that represent a given image.
repeated string v2_blob = 2;
// Output only. The name of the image's v2 blobs computed via:
// [bottom] := v2_blob[bottom]
// [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
// Only the name of the final blob is kept.
// This field can be used as a filter in list requests.
string v2_name = 3;
}
// Basis describes the base image portion (Note) of the DockerImage
// relationship. Linked occurrences are derived from this or an
// equivalent image via:
// FROM <Basis.resource_url>
// Or an equivalent reference, e.g. a tag of the resource_url.
message Basis {
// The resource_url for the resource representing the basis of
// associated occurrence images.
string resource_url = 1;
// The fingerprint of the base image
Fingerprint fingerprint = 2;
}
// Derived describes the derived image portion (Occurrence) of the
// DockerImage relationship. This image would be produced from a Dockerfile
// with FROM <DockerImage.Basis in attached Note>.
message Derived {
// The fingerprint of the derived image
Fingerprint fingerprint = 1;
// Output only. The number of layers by which this image differs from
// the associated image basis.
uint32 distance = 2;
// This contains layer-specific metadata, if populated it
// has length "distance" and is ordered with [distance] being the
// layer immediately following the base image and [1]
// being the final layer.
repeated Layer layer_info = 3;
// Output only.This contains the base image url for the derived image
// Occurrence
string base_resource_url = 4;
}
}

View File

@@ -0,0 +1,178 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// VulnerabilityType provides metadata about a security vulnerability.
message VulnerabilityType {
// Version contains structured information about the version of the package.
// For a discussion of this in Debian/Ubuntu:
// http://serverfault.com/questions/604541/debian-packages-version-convention
// For a discussion of this in Redhat/Fedora/Centos:
// http://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/
message Version {
// Whether this is an ordinary package version or a
// sentinel MIN/MAX version.
enum VersionKind {
// A standard package version, defined by the other fields.
NORMAL = 0;
// A special version representing negative infinity,
// other fields are ignored.
MINIMUM = 1;
// A special version representing positive infinity,
// other fields are ignored.
MAXIMUM = 2;
}
// Used to correct mistakes in the version numbering scheme.
int32 epoch = 1;
// The main part of the version name.
string name = 2;
// The iteration of the package build from the above version.
string revision = 3;
// Distinguish between sentinel MIN/MAX versions and normal versions.
// If kind is not NORMAL, then the other fields are ignored.
VersionKind kind = 5;
}
// Identifies all occurrences of this vulnerability in the package for a
// specific distro/location
// For example: glibc in cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2
message Detail {
// The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
// which the vulnerability manifests. Examples include distro or storage
// location for vulnerable jar.
// This field can be used as a filter in list requests.
string cpe_uri = 1;
// The name of the package where the vulnerability was found.
// This field can be used as a filter in list requests.
string package = 8;
// The min version of the package in which the vulnerability exists.
Version min_affected_version = 6;
// The max version of the package in which the vulnerability exists.
// This field can be used as a filter in list requests.
Version max_affected_version = 7;
// The severity (eg: distro assigned severity) for this vulnerability.
string severity_name = 4;
// A vendor-specific description of this note.
string description = 9;
// The fix for this specific package version.
VulnerabilityLocation fixed_location = 5;
// The type of package; whether native or non native(ruby gems,
// node.js packages etc)
string package_type = 10;
}
// Used by Occurrence to point to where the vulnerability exists and how
// to fix it.
message VulnerabilityDetails {
// The type of package; whether native or non native(ruby gems,
// node.js packages etc)
string type = 3;
// Output only. The note provider assigned Severity of the vulnerability.
Severity severity = 4;
// Output only. The CVSS score of this vulnerability. CVSS score is on a
// scale of 0-10 where 0 indicates low severity and 10 indicates high
// severity.
float cvss_score = 5;
// The set of affected locations and their fixes (if available) within
// the associated resource.
repeated PackageIssue package_issue = 6;
}
// This message wraps a location affected by a vulnerability and its
// associated fix (if one is available).
message PackageIssue {
// The location of the vulnerability.
VulnerabilityLocation affected_location = 1;
// The location of the available fix for vulnerability.
VulnerabilityLocation fixed_location = 2;
// The severity (eg: distro assigned severity) for this vulnerability.
string severity_name = 3;
}
// The location of the vulnerability
message VulnerabilityLocation {
// The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
// format. Examples include distro or storage location for vulnerable jar.
// This field can be used as a filter in list requests.
string cpe_uri = 1;
// The package being described.
string package = 2;
// The version of the package being described.
// This field can be used as a filter in list requests.
Version version = 4;
}
// Note provider-assigned severity/impact ranking
enum Severity {
// Unknown Impact
SEVERITY_UNSPECIFIED = 0;
// Minimal Impact
MINIMAL = 1;
// Low Impact
LOW = 2;
// Medium Impact
MEDIUM = 3;
// High Impact
HIGH = 4;
// Critical Impact
CRITICAL = 5;
}
// The CVSS score for this Vulnerability.
float cvss_score = 2;
// Note provider assigned impact of the vulnerability
Severity severity = 3;
// All information about the package to specifically identify this
// vulnerability. One entry per (version range and cpe_uri) the
// package vulnerability has manifested in.
repeated Detail details = 4;
}

View File

@@ -0,0 +1,224 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
import "google/devtools/containeranalysis/v1alpha1/source_context.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// Provenance of a build. Contains all information needed to verify the full
// details about the build from source to completion.
message BuildProvenance {
// Unique identifier of the build.
string id = 1;
// ID of the project.
string project_id = 2;
// Commands requested by the build.
repeated Command commands = 5;
// Output of the build.
repeated Artifact built_artifacts = 6;
// Time at which the build was created.
google.protobuf.Timestamp create_time = 7;
// Time at which execution of the build was started.
google.protobuf.Timestamp start_time = 8;
// Time at which execution of the build was finished.
google.protobuf.Timestamp finish_time = 9;
// E-mail address of the user who initiated this build. Note that this was the
// user's e-mail address at the time the build was initiated; this address may
// not represent the same end-user for all time.
string creator = 11;
// Google Cloud Storage bucket where logs were written.
string logs_bucket = 13;
// Details of the Source input to the build.
Source source_provenance = 14;
// Trigger identifier if the build was triggered automatically; empty if not.
string trigger_id = 15;
// Special options applied to this build. This is a catch-all field where
// build providers can enter any desired additional details.
map<string, string> build_options = 16;
// Version string of the builder at the time this build was executed.
string builder_version = 17;
}
// Source describes the location of the source used for the build.
message Source {
// Source location information.
oneof source {
// If provided, get the source from this location in in Google Cloud
// Storage.
StorageSource storage_source = 1;
// If provided, get source from this location in a Cloud Repo.
RepoSource repo_source = 2;
}
// If provided, the input binary artifacts for the build came from this
// location.
StorageSource artifact_storage_source = 4;
// Hash(es) of the build source, which can be used to verify that the original
// source integrity was maintained in the build.
//
// The keys to this map are file paths used as build source and the values
// contain the hash values for those files.
//
// If the build source came in a single package such as a gzipped tarfile
// (.tar.gz), the FileHash will be for the single path to that file.
map<string, FileHashes> file_hashes = 3;
// If provided, the source code used for the build came from this location.
SourceContext context = 7;
// If provided, some of the source code used for the build may be found in
// these locations, in the case where the source repository had multiple
// remotes or submodules. This list will not include the context specified in
// the context field.
repeated SourceContext additional_contexts = 8;
}
// Container message for hashes of byte content of files, used in Source
// messages to verify integrity of source input to the build.
message FileHashes {
// Collection of file hashes.
repeated Hash file_hash = 1;
}
// Container message for hash values.
message Hash {
// Specifies the hash algorithm, if any.
enum HashType {
// No hash requested.
NONE = 0;
// A sha256 hash.
SHA256 = 1;
}
// The type of hash that was performed.
HashType type = 1;
// The hash value.
bytes value = 2;
}
// StorageSource describes the location of the source in an archive file in
// Google Cloud Storage.
message StorageSource {
// Google Cloud Storage bucket containing source (see [Bucket Name
// Requirements]
// (https://cloud.google.com/storage/docs/bucket-naming#requirements)).
string bucket = 1;
// Google Cloud Storage object containing source.
string object = 2;
// Google Cloud Storage generation for the object.
int64 generation = 3;
}
// RepoSource describes the location of the source in a Google Cloud Source
// Repository.
message RepoSource {
// ID of the project that owns the repo.
string project_id = 1;
// Name of the repo.
string repo_name = 2;
// A revision within the source repository must be specified in
// one of these ways.
oneof revision {
// Name of the branch to build.
string branch_name = 3;
// Name of the tag to build.
string tag_name = 4;
// Explicit commit SHA to build.
string commit_sha = 5;
}
}
// Command describes a step performed as part of the build pipeline.
message Command {
// Name of the command, as presented on the command line, or if the command is
// packaged as a Docker container, as presented to `docker pull`.
string name = 1;
// Environment variables set before running this Command.
repeated string env = 2;
// Command-line arguments used when executing this Command.
repeated string args = 3;
// Working directory (relative to project source root) used when running
// this Command.
string dir = 4;
// Optional unique identifier for this Command, used in wait_for to reference
// this Command as a dependency.
string id = 5;
// The ID(s) of the Command(s) that this Command depends on.
repeated string wait_for = 6;
}
// Artifact describes a build product.
message Artifact {
// Name of the artifact. This may be the path to a binary or jar file, or in
// the case of a container build, the name used to push the container image to
// Google Container Registry, as presented to `docker push`.
//
// This field is deprecated in favor of the plural `names` field; it continues
// to exist here to allow existing BuildProvenance serialized to json in
// google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to
// deserialize back into proto.
string name = 1;
// Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
// container.
string checksum = 2;
// Artifact ID, if any; for container images, this will be a URL by digest
// like gcr.io/projectID/imagename@sha256:123456
string id = 3;
// Related artifact names. This may be the path to a binary or jar file, or in
// the case of a container build, the name used to push the container image to
// Google Container Registry, as presented to `docker push`. Note that a
// single Artifact ID can have multiple names, for example if two tags are
// applied to one image.
repeated string names = 4;
}

View File

@@ -0,0 +1,141 @@
// Copyright 2017 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.containeranalysis.v1alpha1;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1alpha1";
option objc_class_prefix = "GCA";
// A SourceContext is a reference to a tree of files. A SourceContext together
// with a path point to a unique revision of a single file or directory.
message SourceContext {
// A SourceContext can refer any one of the following types of repositories.
oneof context {
// A SourceContext referring to a revision in a Google Cloud Source Repo.
CloudRepoSourceContext cloud_repo = 1;
// A SourceContext referring to a Gerrit project.
GerritSourceContext gerrit = 2;
// A SourceContext referring to any third party Git repo (e.g., GitHub).
GitSourceContext git = 3;
}
// Labels with user defined metadata.
map<string, string> labels = 4;
}
// An alias to a repo revision.
message AliasContext {
// The type of an alias.
enum Kind {
// Unknown.
KIND_UNSPECIFIED = 0;
// Git tag.
FIXED = 1;
// Git branch.
MOVABLE = 2;
// Used to specify non-standard aliases. For example, if a Git repo has a
// ref named "refs/foo/bar".
OTHER = 4;
}
// The alias kind.
Kind kind = 1;
// The alias name.
string name = 2;
}
// A CloudRepoSourceContext denotes a particular revision in a Google Cloud
// Source Repo.
message CloudRepoSourceContext {
// The ID of the repo.
RepoId repo_id = 1;
// A revision in a Cloud Repo can be identified by either its revision ID or
// its alias.
oneof revision {
// A revision ID.
string revision_id = 2;
// An alias, which may be a branch or tag.
AliasContext alias_context = 3;
}
}
// A SourceContext referring to a Gerrit project.
message GerritSourceContext {
// The URI of a running Gerrit instance.
string host_uri = 1;
// The full project name within the host. Projects may be nested, so
// "project/subproject" is a valid project name. The "repo name" is
// the hostURI/project.
string gerrit_project = 2;
// A revision in a Gerrit project can be identified by either its revision ID
// or its alias.
oneof revision {
// A revision (commit) ID.
string revision_id = 3;
// An alias, which may be a branch or tag.
AliasContext alias_context = 4;
}
}
// A GitSourceContext denotes a particular revision in a third party Git
// repository (e.g., GitHub).
message GitSourceContext {
// Git repository URL.
string url = 1;
// Required.
// Git commit hash.
string revision_id = 2;
}
// A unique identifier for a Cloud Repo.
message RepoId {
// A cloud repo can be identified by either its project ID and repository name
// combination, or its globally unique identifier.
oneof id {
// A combination of a project ID and a repo name.
ProjectRepoId project_repo_id = 1;
// A server-assigned, globally unique identifier.
string uid = 2;
}
}
// Selects a repo using a Google Cloud Platform project ID (e.g.,
// winged-cargo-31) and a repo name within that project.
message ProjectRepoId {
// The ID of the project.
string project_id = 1;
// The name of the repo. Leave empty for the default repo.
string repo_name = 2;
}

View File

@@ -0,0 +1,969 @@
// Copyright 2017 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.remoteexecution.v1test;
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.RemoteExecution.V1Test";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteexecution/v1test;remoteexecution";
option java_multiple_files = true;
option java_outer_classname = "RemoteExecutionProto";
option java_package = "com.google.devtools.remoteexecution.v1test";
option objc_class_prefix = "REX";
// The Remote Execution API is used to execute an
// [Action][google.devtools.remoteexecution.v1test.Action] on the remote
// workers.
//
// As with other services in the Remote Execution API, any call may return an
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
// information about when the client should retry the request; clients SHOULD
// respect the information provided.
service Execution {
// Execute an action remotely.
//
// In order to execute an action, the client must first upload all of the
// inputs, as well as the
// [Command][google.devtools.remoteexecution.v1test.Command] to run, into the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
// It then calls `Execute` with an
// [Action][google.devtools.remoteexecution.v1test.Action] referring to them.
// The server will run the action and eventually return the result.
//
// The input `Action`'s fields MUST meet the various canonicalization
// requirements specified in the documentation for their types so that it has
// the same digest as other logically equivalent `Action`s. The server MAY
// enforce the requirements and return errors if a non-canonical input is
// received. It MAY also proceed without verifying some or all of the
// requirements, such as for performance reasons. If the server does not
// verify the requirement, then it will treat the `Action` as distinct from
// another logically equivalent action if they hash differently.
//
// Returns a [google.longrunning.Operation][google.longrunning.Operation]
// describing the resulting execution, with eventual `response`
// [ExecuteResponse][google.devtools.remoteexecution.v1test.ExecuteResponse].
// The `metadata` on the operation is of type
// [ExecuteOperationMetadata][google.devtools.remoteexecution.v1test.ExecuteOperationMetadata].
//
// To query the operation, you can use the
// [Operations API][google.longrunning.Operations.GetOperation]. If you wish
// to allow the server to stream operations updates, rather than requiring
// client polling, you can use the
// [Watcher API][google.watcher.v1.Watcher.Watch] with the Operation's `name`
// as the `target`.
//
// When using the Watcher API, the initial `data` will be the `Operation` at
// the time of the request. Updates will be provided periodically by the
// server until the `Operation` completes, at which point the response message
// will (assuming no error) be at `data.response`.
//
// The server NEED NOT implement other methods or functionality of the
// Operation and Watcher APIs.
//
// Errors discovered during creation of the `Operation` will be reported
// as gRPC Status errors, while errors that occurred while running the
// action will be reported in the `status` field of the `ExecuteResponse`. The
// server MUST NOT set the `error` field of the `Operation` proto.
// The possible errors include:
// * `INVALID_ARGUMENT`: One or more arguments are invalid.
// * `FAILED_PRECONDITION`: One or more errors occurred in setting up the
// action requested, such as a missing input or command or no worker being
// available. The client may be able to fix the errors and retry.
// * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run
// the action.
// * `UNAVAILABLE`: Due to a transient condition, such as all workers being
// occupied (and the server does not support a queue), the action could not
// be started. The client should retry.
// * `INTERNAL`: An internal error occurred in the execution engine or the
// worker.
// * `DEADLINE_EXCEEDED`: The execution timed out.
//
// In the case of a missing input or command, the server SHOULD additionally
// send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail
// where, for each requested blob not present in the CAS, there is a
// `Violation` with a `type` of `MISSING` and a `subject` of
// `"blobs/{hash}/{size}"` indicating the digest of the missing blob.
rpc Execute(ExecuteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = { post: "/v1test/{instance_name=**}/actions:execute" body: "*" };
}
}
// The action cache API is used to query whether a given action has already been
// performed and, if so, retrieve its result. Unlike the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage],
// which addresses blobs by their own content, the action cache addresses the
// [ActionResult][google.devtools.remoteexecution.v1test.ActionResult] by a
// digest of the encoded [Action][google.devtools.remoteexecution.v1test.Action]
// which produced them.
//
// The lifetime of entries in the action cache is implementation-specific, but
// the server SHOULD assume that more recently used entries are more likely to
// be used again. Additionally, action cache implementations SHOULD ensure that
// any blobs referenced in the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]
// are still valid when returning a result.
//
// As with other services in the Remote Execution API, any call may return an
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
// information about when the client should retry the request; clients SHOULD
// respect the information provided.
service ActionCache {
// Retrieve a cached execution result.
//
// Errors:
// * `NOT_FOUND`: The requested `ActionResult` is not in the cache.
rpc GetActionResult(GetActionResultRequest) returns (ActionResult) {
option (google.api.http) = { get: "/v1test/{instance_name=**}/actionResults/{action_digest.hash}/{action_digest.size_bytes}" };
}
// Upload a new execution result.
//
// This method is intended for servers which implement the distributed cache
// independently of the
// [Execution][google.devtools.remoteexecution.v1test.Execution] API. As a
// result, it is OPTIONAL for servers to implement.
//
// Errors:
// * `NOT_IMPLEMENTED`: This method is not supported by the server.
// * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
// entry to the cache.
rpc UpdateActionResult(UpdateActionResultRequest) returns (ActionResult) {
option (google.api.http) = { put: "/v1test/{instance_name=**}/actionResults/{action_digest.hash}/{action_digest.size_bytes}" body: "action_result" };
}
}
// The CAS (content-addressable storage) is used to store the inputs to and
// outputs from the execution service. Each piece of content is addressed by the
// digest of its binary data.
//
// Most of the binary data stored in the CAS is opaque to the execution engine,
// and is only used as a communication medium. In order to build an
// [Action][google.devtools.remoteexecution.v1test.Action],
// however, the client will need to also upload the
// [Command][google.devtools.remoteexecution.v1test.Command] and input root
// [Directory][google.devtools.remoteexecution.v1test.Directory] for the Action.
// The Command and Directory messages must be marshalled to wire format and then
// uploaded under the hash as with any other piece of content. In practice, the
// input root directory is likely to refer to other Directories in its
// hierarchy, which must also each be uploaded on their own.
//
// For small file uploads the client should group them together and call
// [BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs]
// on chunks of no more than 10 MiB. For large uploads, the client must use the
// [Write method][google.bytestream.ByteStream.Write] of the ByteStream API. The
// `resource_name` is `{instance_name}/uploads/{uuid}/blobs/{hash}/{size}`,
// where `instance_name` is as described in the next paragraph, `uuid` is a
// version 4 UUID generated by the client, and `hash` and `size` are the
// [Digest][google.devtools.remoteexecution.v1test.Digest] of the blob. The
// `uuid` is used only to avoid collisions when multiple clients try to upload
// the same file (or the same client tries to upload the file multiple times at
// once on different threads), so the client MAY reuse the `uuid` for uploading
// different blobs. The `resource_name` may optionally have a trailing filename
// (or other metadata) for a client to use if it is storing URLs, as in
// `{instance}/uploads/{uuid}/blobs/{hash}/{size}/foo/bar/baz.cc`. Anything
// after the `size` is ignored.
//
// A single server MAY support multiple instances of the execution system, each
// with their own workers, storage, cache, etc. The exact relationship between
// instances is up to the server. If the server does, then the `instance_name`
// is an identifier, possibly containing multiple path segments, used to
// distinguish between the various instances on the server, in a manner defined
// by the server. For servers which do not support multiple instances, then the
// `instance_name` is the empty path and the leading slash is omitted, so that
// the `resource_name` becomes `uploads/{uuid}/blobs/{hash}/{size}`.
//
// When attempting an upload, if another client has already completed the upload
// (which may occur in the middle of a single upload if another client uploads
// the same blob concurrently), the request will terminate immediately with
// a response whose `committed_size` is the full size of the uploaded file
// (regardless of how much data was transmitted by the client). If the client
// completes the upload but the
// [Digest][google.devtools.remoteexecution.v1test.Digest] does not match, an
// `INVALID_ARGUMENT` error will be returned. In either case, the client should
// not attempt to retry the upload.
//
// For downloading blobs, the client must use the
// [Read method][google.bytestream.ByteStream.Read] of the ByteStream API, with
// a `resource_name` of `"{instance_name}/blobs/{hash}/{size}"`, where
// `instance_name` is the instance name (see above), and `hash` and `size` are
// the [Digest][google.devtools.remoteexecution.v1test.Digest] of the blob.
//
// The lifetime of entries in the CAS is implementation specific, but it SHOULD
// be long enough to allow for newly-added and recently looked-up entries to be
// used in subsequent calls (e.g. to
// [Execute][google.devtools.remoteexecution.v1test.Execution.Execute]).
//
// As with other services in the Remote Execution API, any call may return an
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
// information about when the client should retry the request; clients SHOULD
// respect the information provided.
service ContentAddressableStorage {
// Determine if blobs are present in the CAS.
//
// Clients can use this API before uploading blobs to determine which ones are
// already present in the CAS and do not need to be uploaded again.
//
// There are no method-specific errors.
rpc FindMissingBlobs(FindMissingBlobsRequest) returns (FindMissingBlobsResponse) {
option (google.api.http) = { post: "/v1test/{instance_name=**}/blobs:findMissing" body: "*" };
}
// Upload many blobs at once.
//
// The client MUST NOT upload blobs with a combined total size of more than 10
// MiB using this API. Such requests should either be split into smaller
// chunks or uploaded using the
// [ByteStream API][google.bytestream.ByteStream], as appropriate.
//
// This request is equivalent to calling [UpdateBlob][] on each individual
// blob, in parallel. The requests may succeed or fail independently.
//
// Errors:
// * `INVALID_ARGUMENT`: The client attempted to upload more than 10 MiB of
// data.
//
// Individual requests may return the following errors, additionally:
// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.
// * `INVALID_ARGUMENT`: The
// [Digest][google.devtools.remoteexecution.v1test.Digest] does not match the
// provided data.
rpc BatchUpdateBlobs(BatchUpdateBlobsRequest) returns (BatchUpdateBlobsResponse) {
option (google.api.http) = { post: "/v1test/{instance_name=**}/blobs:batchUpdate" body: "*" };
}
// Fetch the entire directory tree rooted at a node.
//
// This request must be targeted at a
// [Directory][google.devtools.remoteexecution.v1test.Directory] stored in the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]
// (CAS). The server will enumerate the `Directory` tree recursively and
// return every node descended from the root.
// The exact traversal order is unspecified and, unless retrieving subsequent
// pages from an earlier request, is not guaranteed to be stable across
// multiple invocations of `GetTree`.
//
// If part of the tree is missing from the CAS, the server will return the
// portion present and omit the rest.
//
// * `NOT_FOUND`: The requested tree root is not present in the CAS.
rpc GetTree(GetTreeRequest) returns (GetTreeResponse) {
option (google.api.http) = { get: "/v1test/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" };
}
}
// An `Action` captures all the information about an execution which is required
// to reproduce it.
//
// `Action`s are the core component of the [Execution] service. A single
// `Action` represents a repeatable action that can be performed by the
// execution service. `Action`s can be succinctly identified by the digest of
// their wire format encoding and, once an `Action` has been executed, will be
// cached in the action cache. Future requests can then use the cached result
// rather than needing to run afresh.
//
// When a server completes execution of an
// [Action][google.devtools.remoteexecution.v1test.Action], it MAY choose to
// cache the [result][google.devtools.remoteexecution.v1test.ActionResult] in
// the [ActionCache][google.devtools.remoteexecution.v1test.ActionCache] unless
// `do_not_cache` is `true`. Clients SHOULD expect the server to do so. By
// default, future calls to [Execute][] the same `Action` will also serve their
// results from the cache. Clients must take care to understand the caching
// behaviour. Ideally, all `Action`s will be reproducible so that serving a
// result from cache is always desirable and correct.
message Action {
// The digest of the [Command][google.devtools.remoteexecution.v1test.Command]
// to run, which MUST be present in the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
Digest command_digest = 1;
// The digest of the root
// [Directory][google.devtools.remoteexecution.v1test.Directory] for the input
// files. The files in the directory tree are available in the correct
// location on the build machine before the command is executed. The root
// directory, as well as every subdirectory and content blob referred to, MUST
// be in the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
Digest input_root_digest = 2;
// A list of the output files that the client expects to retrieve from the
// action. Only the listed files, as well as directories listed in
// `output_directories`, will be returned to the client as output.
// Other files that may be created during command execution are discarded.
//
// The paths are specified using forward slashes (`/`) as path separators,
// even if the execution platform natively uses a different separator. The
// path MUST NOT include a trailing slash.
//
// In order to ensure consistent hashing of the same Action, the output paths
// MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
// bytes).
repeated string output_files = 3;
// A list of the output directories that the client expects to retrieve from
// the action. Only the contents of the indicated directories (recursively
// including the contents of their subdirectories) will be
// returned, as well as files listed in `output_files`. Other files that may
// be created during command execution are discarded.
//
// The paths are specified using forward slashes (`/`) as path separators,
// even if the execution platform natively uses a different separator. The
// path MUST NOT include a trailing slash, unless the path is `"/"` (which,
// although not recommended, can be used to capture the entire working
// directory tree, including inputs).
//
// In order to ensure consistent hashing of the same Action, the output paths
// MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
// bytes).
repeated string output_directories = 4;
// The platform requirements for the execution environment. The server MAY
// choose to execute the action on any worker satisfying the requirements, so
// the client SHOULD ensure that running the action on any such worker will
// have the same result.
Platform platform = 5;
// A timeout after which the execution should be killed. If the timeout is
// absent, then the client is specifying that the execution should continue
// as long as the server will let it. The server SHOULD impose a timeout if
// the client does not specify one, however, if the client does specify a
// timeout that is longer than the server's maximum timeout, the server MUST
// reject the request.
//
// The timeout is a part of the
// [Action][google.devtools.remoteexecution.v1test.Action] message, and
// therefore two `Actions` with different timeouts are different, even if they
// are otherwise identical. This is because, if they were not, running an
// `Action` with a lower timeout than is required might result in a cache hit
// from an execution run with a longer timeout, hiding the fact that the
// timeout is too short. By encoding it directly in the `Action`, a lower
// timeout will result in a cache miss and the execution timeout will fail
// immediately, rather than whenever the cache entry gets evicted.
google.protobuf.Duration timeout = 6;
// If true, then the `Action`'s result cannot be cached.
bool do_not_cache = 7;
}
// A `Command` is the actual command executed by a worker running an
// [Action][google.devtools.remoteexecution.v1test.Action].
//
// Except as otherwise required, the environment (such as which system
// libraries or binaries are available, and what filesystems are mounted where)
// is defined by and specific to the implementation of the remote execution API.
message Command {
// An `EnvironmentVariable` is one variable to set in the running program's
// environment.
message EnvironmentVariable {
// The variable name.
string name = 1;
// The variable value.
string value = 2;
}
// The arguments to the command. The first argument must be the path to the
// executable, which must be either a relative path, in which case it is
// evaluated with respect to the input root, or an absolute path. The `PATH`
// environment variable, or similar functionality on other systems, is not
// used to determine which executable to run.
//
// The working directory will always be the input root.
repeated string arguments = 1;
// The environment variables to set when running the program. The worker may
// provide its own default environment variables; these defaults can be
// overridden using this field. Additional variables can also be specified.
//
// In order to ensure that equivalent `Command`s always hash to the same
// value, the environment variables MUST be lexicographically sorted by name.
// Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
repeated EnvironmentVariable environment_variables = 2;
}
// A `Platform` is a set of requirements, such as hardware, operating system, or
// compiler toolchain, for an
// [Action][google.devtools.remoteexecution.v1test.Action]'s execution
// environment. A `Platform` is represented as a series of key-value pairs
// representing the properties that are required of the platform.
//
// This message is currently being redeveloped since it is an overly simplistic
// model of platforms.
message Platform {
// A single property for the environment. The server is responsible for
// specifying the property `name`s that it accepts. If an unknown `name` is
// provided in the requirements for an
// [Action][google.devtools.remoteexecution.v1test.Action], the server SHOULD
// reject the execution request. If permitted by the server, the same `name`
// may occur multiple times.
//
// The server is also responsible for specifying the interpretation of
// property `value`s. For instance, a property describing how much RAM must be
// available may be interpreted as allowing a worker with 16GB to fulfill a
// request for 8GB, while a property describing the OS environment on which
// the action must be performed may require an exact match with the worker's
// OS.
//
// The server MAY use the `value` of one or more properties to determine how
// it sets up the execution environment, such as by making specific system
// files available to the worker.
message Property {
// The property name.
string name = 1;
// The property value.
string value = 2;
}
// The properties that make up this platform. In order to ensure that
// equivalent `Platform`s always hash to the same value, the properties MUST
// be lexicographically sorted by name, and then by value. Sorting of strings
// is done by code point, equivalently, by the UTF-8 bytes.
repeated Property properties = 1;
}
// A `Directory` represents a directory node in a file tree, containing zero or
// more children [FileNodes][google.devtools.remoteexecution.v1test.FileNode]
// and [DirectoryNodes][google.devtools.remoteexecution.v1test.DirectoryNode].
// Each `Node` contains its name in the directory, the digest of its content
// (either a file blob or a `Directory` proto), as well as possibly some
// metadata about the file or directory.
//
// In order to ensure that two equivalent directory trees hash to the same
// value, the following restrictions MUST be obeyed when constructing a
// a `Directory`:
// - Every child in the directory must have a path of exactly one segment.
// Multiple levels of directory hierarchy may not be collapsed.
// - Each child in the directory must have a unique path segment (file name).
// - The files and directories in the directory must each be sorted in
// lexicographical order by path. The path strings must be sorted by code
// point, equivalently, by UTF-8 bytes.
//
// A `Directory` that obeys the restrictions is said to be in canonical form.
//
// As an example, the following could be used for a file named `bar` and a
// directory named `foo` with an executable file named `baz` (hashes shortened
// for readability):
//
// ```json
// // (Directory proto)
// {
// files: [
// {
// name: "bar",
// digest: {
// hash: "4a73bc9d03...",
// size: 65534
// }
// }
// ],
// directories: [
// {
// name: "foo",
// digest: {
// hash: "4cf2eda940...",
// size: 43
// }
// }
// ]
// }
//
// // (Directory proto with hash "4cf2eda940..." and size 43)
// {
// files: [
// {
// name: "baz",
// digest: {
// hash: "b2c941073e...",
// size: 1294,
// },
// is_executable: true
// }
// ]
// }
// ```
message Directory {
// The files in the directory.
repeated FileNode files = 1;
// The subdirectories in the directory.
repeated DirectoryNode directories = 2;
}
// A `FileNode` represents a single file and associated metadata.
message FileNode {
// The name of the file.
string name = 1;
// The digest of the file's content.
Digest digest = 2;
// True if file is executable, false otherwise.
bool is_executable = 4;
}
// A `DirectoryNode` represents a child of a
// [Directory][google.devtools.remoteexecution.v1test.Directory] which is itself
// a `Directory` and its associated metadata.
message DirectoryNode {
// The name of the directory.
string name = 1;
// The digest of the
// [Directory][google.devtools.remoteexecution.v1test.Directory] object
// represented. See [Digest][google.devtools.remoteexecution.v1test.Digest]
// for information about how to take the digest of a proto message.
Digest digest = 2;
}
// A content digest. A digest for a given blob consists of the size of the blob
// and its hash. The hash algorithm to use is defined by the server, but servers
// SHOULD use SHA-256.
//
// The size is considered to be an integral part of the digest and cannot be
// separated. That is, even if the `hash` field is correctly specified but
// `size_bytes` is not, the server MUST reject the request.
//
// The reason for including the size in the digest is as follows: in a great
// many cases, the server needs to know the size of the blob it is about to work
// with prior to starting an operation with it, such as flattening Merkle tree
// structures or streaming it to a worker. Technically, the server could
// implement a separate metadata store, but this results in a significantly more
// complicated implementation as opposed to having the client specify the size
// up-front (or storing the size along with the digest in every message where
// digests are embedded). This does mean that the API leaks some implementation
// details of (what we consider to be) a reasonable server implementation, but
// we consider this to be a worthwhile tradeoff.
//
// When a `Digest` is used to refer to a proto message, it always refers to the
// message in binary encoded form. To ensure consistent hashing, clients and
// servers MUST ensure that they serialize messages according to the following
// rules, even if there are alternate valid encodings for the same message.
// - Fields are serialized in tag order.
// - There are no unknown fields.
// - There are no duplicate fields.
// - Fields are serialized according to the default semantics for their type.
//
// Most protocol buffer implementations will always follow these rules when
// serializing, but care should be taken to avoid shortcuts. For instance,
// concatenating two messages to merge them may produce duplicate fields.
message Digest {
// The hash. In the case of SHA-256, it will always be a lowercase hex string
// exactly 64 characters long.
string hash = 1;
// The size of the blob, in bytes.
int64 size_bytes = 2;
}
// An ActionResult represents the result of an
// [Action][google.devtools.remoteexecution.v1test.Action] being run.
message ActionResult {
// The output files of the action. For each output file requested, if the
// corresponding file existed after the action completed, a single entry will
// be present in the output list.
//
// If the action does not produce the requested output, or produces a
// directory where a regular file is expected or vice versa, then that output
// will be omitted from the list. The server is free to arrange the output
// list as desired; clients MUST NOT assume that the output list is sorted.
repeated OutputFile output_files = 2;
// The output directories of the action. For each output directory requested,
// if the corresponding directory existed after the action completed, a single
// entry will be present in the output list, which will contain the digest of
// a [Tree][google.devtools.remoteexecution.v1.test.Tree] message containing
// the directory tree.
repeated OutputDirectory output_directories = 3;
// The exit code of the command.
int32 exit_code = 4;
// The standard output buffer of the action. The server will determine, based
// on the size of the buffer, whether to return it in raw form or to return
// a digest in `stdout_digest` that points to the buffer. If neither is set,
// then the buffer is empty. The client SHOULD NOT assume it will get one of
// the raw buffer or a digest on any given request and should be prepared to
// handle either.
bytes stdout_raw = 5;
// The digest for a blob containing the standard output of the action, which
// can be retrieved from the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
// See `stdout_raw` for when this will be set.
Digest stdout_digest = 6;
// The standard error buffer of the action. The server will determine, based
// on the size of the buffer, whether to return it in raw form or to return
// a digest in `stderr_digest` that points to the buffer. If neither is set,
// then the buffer is empty. The client SHOULD NOT assume it will get one of
// the raw buffer or a digest on any given request and should be prepared to
// handle either.
bytes stderr_raw = 7;
// The digest for a blob containing the standard error of the action, which
// can be retrieved from the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
// See `stderr_raw` for when this will be set.
Digest stderr_digest = 8;
}
// An `OutputFile` is similar to a
// [FileNode][google.devtools.remoteexecution.v1test.FileNode], but it is
// tailored for output as part of an `ActionResult`. It allows a full file path
// rather than only a name, and allows the server to include content inline.
//
// `OutputFile` is binary-compatible with `FileNode`.
message OutputFile {
// The full path of the file relative to the input root, including the
// filename. The path separator is a forward slash `/`.
string path = 1;
// The digest of the file's content.
Digest digest = 2;
// The raw content of the file.
//
// This field may be used by the server to provide the content of a file
// inline in an
// [ActionResult][google.devtools.remoteexecution.v1test.ActionResult] and
// avoid requiring that the client make a separate call to
// [ContentAddressableStorage.GetBlob] to retrieve it.
//
// The client SHOULD NOT assume that it will get raw content with any request,
// and always be prepared to retrieve it via `digest`.
bytes content = 3;
// True if file is executable, false otherwise.
bool is_executable = 4;
}
// A `Tree` contains all the
// [Directory][google.devtools.remoteexecution.v1test.Directory] protos in a
// single directory Merkle tree, compressed into one message.
message Tree {
// The root directory in the tree.
Directory root = 1;
// All the child directories: the directories referred to by the root and,
// recursively, all its children. In order to reconstruct the directory tree,
// the client must take the digests of each of the child directories and then
// build up a tree starting from the `root`.
repeated Directory children = 2;
}
// An `OutputDirectory` is the output in an `ActionResult` corresponding to a
// directory's full contents rather than a single file.
message OutputDirectory {
// The full path of the directory relative to the input root, including the
// filename. The path separator is a forward slash `/`.
string path = 1;
// DEPRECATED: This field is deprecated and should no longer be used.
Digest digest = 2;
// The digest of the encoded
// [Tree][google.devtools.remoteexecution.v1test.Tree] proto containing the
// directory's contents.
Digest tree_digest = 3;
}
// A request message for
// [Execution.Execute][google.devtools.remoteexecution.v1test.Execution.Execute].
message ExecuteRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// The action to be performed.
Action action = 2;
// If true, the action will be executed anew even if its result was already
// present in the cache. If false, the result may be served from the
// [ActionCache][google.devtools.remoteexecution.v1test.ActionCache].
bool skip_cache_lookup = 3;
// DEPRECATED: This field should be ignored by clients and servers and will be
// removed.
int32 total_input_file_count = 4;
// DEPRECATED: This field should be ignored by clients and servers and will be
// removed.
int64 total_input_file_bytes = 5;
}
// A `LogFile` is a log stored in the CAS.
message LogFile {
// The digest of the log contents.
Digest digest = 1;
// This is a hint as to the purpose of the log, and is set to true if the log
// is human-readable text that can be usefully displayed to a user, and false
// otherwise. For instance, if a command-line client wishes to print the
// server logs to the terminal for a failed action, this allows it to avoid
// displaying a binary file.
bool human_readable = 2;
}
// The response message for
// [Execution.Execute][google.devtools.remoteexecution.v1test.Execution.Execute],
// which will be contained in the [response
// field][google.longrunning.Operation.response] of the
// [Operation][google.longrunning.Operation].
message ExecuteResponse {
// The result of the action.
ActionResult result = 1;
// True if the result was served from cache, false if it was executed.
bool cached_result = 2;
// If the status has a code other than `OK`, it indicates that the action did
// not finish execution. For example, if the operation times out during
// execution, the status will have a `DEADLINE_EXCEEDED` code. Servers MUST
// use this field for errors in execution, rather than the error field on the
// `Operation` object.
//
// If the status code is other than `OK`, then the result MUST NOT be cached.
// For an error status, the `result` field is optional; the server may
// populate the output-, stdout-, and stderr-related fields if it has any
// information available, such as the stdout and stderr of a timed-out action.
google.rpc.Status status = 3;
// An optional list of additional log outputs the server wishes to provide. A
// server can use this to return execution-specific logs however it wishes.
// This is intended primarily to make it easier for users to debug issues that
// may be outside of the actual job execution, such as by identifying the
// worker executing the action or by providing logs from the worker's setup
// phase. The keys SHOULD be human readable so that a client can display them
// to a user.
map<string, LogFile> server_logs = 4;
}
// Metadata about an ongoing
// [execution][google.devtools.remoteexecution.v1test.Execution.Execute], which
// will be contained in the [metadata
// field][google.longrunning.Operation.response] of the
// [Operation][google.longrunning.Operation].
message ExecuteOperationMetadata {
// The current stage of execution.
enum Stage {
UNKNOWN = 0;
// Checking the result against the cache.
CACHE_CHECK = 1;
// Currently idle, awaiting a free machine to execute.
QUEUED = 2;
// Currently being executed by a worker.
EXECUTING = 3;
// Finished execution.
COMPLETED = 4;
}
Stage stage = 1;
// The digest of the [Action][google.devtools.remoteexecution.v1test.Action]
// being executed.
Digest action_digest = 2;
// If set, the client can use this name with
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
// standard output.
string stdout_stream_name = 3;
// If set, the client can use this name with
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
// standard error.
string stderr_stream_name = 4;
}
// A request message for
// [ActionCache.GetActionResult][google.devtools.remoteexecution.v1test.ActionCache.GetActionResult].
message GetActionResultRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// The digest of the [Action][google.devtools.remoteexecution.v1test.Action]
// whose result is requested.
Digest action_digest = 2;
}
// A request message for
// [ActionCache.UpdateActionResult][google.devtools.remoteexecution.v1test.ActionCache.UpdateActionResult].
message UpdateActionResultRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// The digest of the [Action][google.devtools.remoteexecution.v1test.Action]
// whose result is being uploaded.
Digest action_digest = 2;
// The [ActionResult][google.devtools.remoteexecution.v1test.ActionResult]
// to store in the cache.
ActionResult action_result = 3;
}
// A request message for
// [ContentAddressableStorage.FindMissingBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.FindMissingBlobs].
message FindMissingBlobsRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// A list of the blobs to check.
repeated Digest blob_digests = 2;
}
// A response message for
// [ContentAddressableStorage.FindMissingBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.FindMissingBlobs].
message FindMissingBlobsResponse {
// A list of the blobs requested *not* present in the storage.
repeated Digest missing_blob_digests = 2;
}
// A single request message for
// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs].
message UpdateBlobRequest {
// The digest of the blob. This MUST be the digest of `data`.
Digest content_digest = 1;
// The raw binary data.
bytes data = 2;
}
// A request message for
// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs].
message BatchUpdateBlobsRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// The individual upload requests.
repeated UpdateBlobRequest requests = 2;
}
// A response message for
// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs].
message BatchUpdateBlobsResponse {
// A response corresponding to a single blob that the client tried to upload.
message Response {
// The digest to which this response corresponds.
Digest blob_digest = 1;
// The result of attempting to upload that blob.
google.rpc.Status status = 2;
}
// The responses to the requests.
repeated Response responses = 1;
}
// A request message for
// [ContentAddressableStorage.GetTree][google.devtools.remoteexecution.v1test.ContentAddressableStorage.GetTree].
message GetTreeRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;
// The digest of the root, which must be an encoded
// [Directory][google.devtools.remoteexecution.v1test.Directory] message
// stored in the
// [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage].
Digest root_digest = 2;
// A maximum page size to request. If present, the server will request no more
// than this many items. Regardless of whether a page size is specified, the
// server may place its own limit on the number of items to be returned and
// require the client to retrieve more items using a subsequent request.
int32 page_size = 3;
// A page token, which must be a value received in a previous
// [GetTreeResponse][google.devtools.remoteexecution.v1test.GetTreeResponse].
// If present, the server will use it to return the following page of results.
string page_token = 4;
}
// A response message for
// [ContentAddressableStorage.GetTree][google.devtools.remoteexecution.v1test.ContentAddressableStorage.GetTree].
message GetTreeResponse {
// The directories descended from the requested root.
repeated Directory directories = 1;
// If present, signifies that there are more results which the client can
// retrieve by passing this as the page_token in a subsequent
// [request][google.devtools.remoteexecution.v1test.GetTreeRequest].
// If empty, signifies that this is the last page of results.
string next_page_token = 2;
}
// Details for the tool used to call the API.
message ToolDetails {
// Name of the tool, e.g. bazel.
string tool_name = 1;
// Version of the tool used for the request, e.g. 5.0.3.
string tool_version = 2;
}
// An optional Metadata to attach to any RPC request to tell the server about an
// external context of the request. The server may use this for logging or other
// purposes. To use it, the client attaches the header to the call using the
// canonical proto serialization:
// name: google.devtools.remoteexecution.v1test.requestmetadata-bin
// contents: the base64 encoded binary RequestMetadata message.
message RequestMetadata {
// The details for the tool invoking the requests.
ToolDetails tool_details = 1;
// An identifier that ties multiple requests to the same action.
// For example, multiple requests to the CAS, Action Cache, and Execution
// API are used in order to compile foo.cc.
string action_id = 2;
// An identifier that ties multiple actions together to a final result.
// For example, multiple actions are required to build and run foo_test.
string tool_invocation_id = 3;
// An identifier to tie multiple tool invocations together. For example,
// runs of foo_test, bar_test and baz_test on a post-submit of a given patch.
string correlated_invocations_id = 4;
}

View File

@@ -0,0 +1,465 @@
// Copyright 2017 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;
import "google/api/annotations.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 go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
// Design doc: https://goo.gl/oojM5H
//
// Loosely speaking, the Bots interface monitors a collection of workers (think
// of them as "computers" for a moment). This collection is known as a "farm,"
// and its purpose is to perform work on behalf of a client.
//
// Each worker runs a small program known as a "bot" that allows it to be
// controlled by the server. This interface contains only methods that are
// called by the bots themselves; admin functionality is out of scope for this
// interface.
//
// More precisely, we use the term "worker" to refer to the physical "thing"
// running the bot. We use the term "worker," and not "machine" or "computer,"
// since a worker may consist of more than one machine - e.g., a computer with
// multiple attached devices, or even a cluster of computers, with only one of
// them running the bot. Conversely, a single machine may host several bots, in
// which case each bot has a "worker" corresponding to the slice of the machine
// being managed by that bot.
//
// The main resource in the Bots interface is not, surprisingly, a Bot - it is a
// BotSession, which represents a period of time in which a bot is in continuous
// contact with the server (see the BotSession message for more information).
// The parent of a bot session can be thought of as an instance of a farm. That
// is, one endpoint may be able to manage many farms for many users. For
// example, for a farm managed through GCP, the parent resource will typically
// take the form "projects/{project_id}". This is referred to below as "the farm
// resource."
service Bots {
// CreateBotSession is called when the bot first joins the farm, and
// 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" };
}
// 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" };
}
// PostBotEventTemp may be called by the bot to indicate that some exceptional
// event has occurred. This method is subject to change or removal in future
// 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: "*" };
}
}
// A bot session represents the state of a bot while in continuous contact with
// the server for a period of time. The session includes information about the
// worker - that is, the *worker* (the physical or virtual hardware) is
// considered to be a property of the bot (the software agent running on that
// hardware), which is the reverse of real life, but more natural from the point
// of the view of this API, which communicates solely with the bot and not
// directly with the underlying worker.
message BotSession {
// The bot session name, as selected by the server. Output only during a call
// to CreateBotSession.
string name = 1;
// A unique bot ID within the farm used to persistently identify this bot over
// time (i.e., over multiple sessions). This ID must be unique within a
// farm. Typically, the bot ID will be the same as the name of the primary
// device in the worker (e.g., what you'd get from typing `uname -n` on *nix),
// but this is not required since a single device may allow multiple bots to
// run on it, each with access to different resources. What is important is
// that this ID is meaningful to humans, who might need to hunt a physical
// machine down to fix it.
//
// When CreateBotSession is successfully called with a bot_id, all prior
// sessions with the same ID are invalidated. If a bot attempts to update an
// invalid session, the server must reject that request, and may also
// quarantine the other bot with the same bot IDs (ie, stop sending it new
// leases and alert an admin).
string bot_id = 2;
// The status of the bot. This must be populated in every call to
// UpdateBotSession.
BotStatus status = 3;
// A description of the worker hosting this bot. The Worker message is used
// here in the Status context (see Worker for more information). If multiple
// bots are running on the worker, this field should only describe the
// resources accessible from this bot.
//
// During the call to CreateBotSession, the server may make arbitrary changes
// to the worker's `server_properties` field (see that field for more
// information). Otherwise, this field is input-only.
Worker worker = 4;
// A list of all leases that are a part of this session. See the Lease message
// for details.
repeated Lease leases = 5;
// The time at which this bot session will expire, unless the bot calls
// UpdateBotSession again. Output only.
google.protobuf.Timestamp expire_time = 6;
// The version of the bot code currently running. The server may use this
// information to issue an admin action to tell the bot to update itself.
string version = 7;
}
// A Lease is a lease that the scheduler has assigned to this bot. If the bot
// notices (by UpdateBotSession) that it has any leases in the PENDING state, it
// should call UpdateBotSession to put the leases into the ACTIVE state and
// start executing their assignments.
//
// All fields in this message are output-only, *except* the `state` and `status`
// fields. Note that repeated fields can only be updated as a unit, so on every
// update the bot must provide an update for *all* the leases the server expects
// it to report on.
//
// The scheduler *should* ensure that all leases scheduled to a bot can actually
// be accepted, but race conditions may occur. In such cases, the bot should
// attempt to accept the leases in the order they are listed by the server, to
// allow the server to control priorities.
//
// The server will remove COMPLETED leases from time to time, after which the
// bot shouldn't report on them any more (the server will ignore superfluous
// COMPLETED records).
message Lease {
// The assignment, which is typically a resource that can be accessed through
// some other services. The assignment must be meaningful to the bot based
// solely on this name, either because the bot only understands one type of
// assignment (e.g., tasks served through the Tasks interface) or through some
// implementation-defined schema.
//
// For example, if the worker is executing a Task as defined by the Tasks
// interface, this field might be projects/{projectid}/tasks/{taskid}.
// However, it the worker is being assigned pull from a *queue* of tasks, the
// resource would be the name of the queue, something like
// projects/{projectid}/locations/{locationid}/queues/{queueid}. That queue
// may then provide the bot with tasks through another interface, which the
// bot then processes through the [Tasks]
// [google.devtools.remoteworkers.v1test2.Tasks] interface.
//
// Note that the assignment may be a [full resource name]
// [https://cloud.google.com/apis/design/resource_names#full_resource_name] if
// it should be accessed through an endpoint that is not already known to the
// bot.
string assignment = 1;
// The state of the lease. See LeaseState for more information.
LeaseState state = 2;
// The final status of the lease (should be populated by the bot if the state
// is completed). This is the status of the lease, not of any task represented
// by the lease. For example, if the bot could not accept the lease because it
// asked for some resource the bot didn't have, this status will be
// FAILED_PRECONDITION. But if the assignment in the lease didn't execute
// correctly, this field will be `OK` while the failure of the assignment must
// be tracked elsewhere (e.g., through the Tasks interface).
google.rpc.Status status = 3;
// The requirements that are being claimed by this lease. This field may be
// omitted by the server if the lease is not pending.
Worker requirements = 4;
// The time at which this lease expires. The server *may* extend this over
// time, but due to race conditions, the bot is not *required* to respect any
// expiry date except the first one.
google.protobuf.Timestamp expire_time = 5;
// While the `assignment` field is a resource name that allows the bot to
// get the actual assignment, the server can also optionally include the
// assignment itself inline in order to save a round trip to the server.
//
// This doesn't necessarily need to be the resource pointed to by
// `assignment`. For example, if the assignment is a task, this field could
// be task.description, not the entire task, since that's all the bot needs
// to know to get started. As with `assignment` itself, all that's necessary
// is that the bot knows how to handle the type of message received here.
//
// This field may be omitted by the server if the lease is not in the
// `PENDING` state.
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.
// If this message proves to be sufficient, it will be renamed in the alpha or
// beta release of this API.
//
// This message (suitably marshalled into a protobuf.Any) can be used as the
// inline_assignment field in a lease; the lease assignment field should simply
// be `"admin"` in these cases.
//
// This message is heavily based on Swarming administration tasks from the LUCI
// project (http://github.com/luci/luci-py/appengine/swarming).
message AdminTemp {
// Possible administration actions.
enum Command {
// Illegal value.
UNSPECIFIED = 0;
// Download and run a new version of the bot. `arg` will be a resource
// accessible via `ByteStream.Read` to obtain the new bot code.
BOT_UPDATE = 1;
// Restart the bot without downloading a new version. `arg` will be a
// message to log.
BOT_RESTART = 2;
// Shut down the bot. `arg` will be a task resource name (similar to those
// in tasks.proto) that the bot can use to tell the server that it is
// terminating.
BOT_TERMINATE = 3;
// Restart the host computer. `arg` will be a message to log.
HOST_RESTART = 4;
}
// The admin action; see `Command` for legal values.
Command command = 1;
// The argument to the admin action; see `Command` for semantics.
string arg = 2;
}
// Request message for CreateBotSession.
message CreateBotSessionRequest {
// The farm resource.
string parent = 1;
// The bot session to create. Server-assigned fields like name must be unset.
BotSession bot_session = 2;
}
// Request message for UpdateBotSession.
message UpdateBotSessionRequest {
// The bot session name. Must match bot_session.name.
string name = 1;
// The bot session resource to update.
BotSession bot_session = 2;
// The fields on the bot that should be updated. See the BotSession resource
// for which fields are updatable by which caller.
google.protobuf.FieldMask update_mask = 3;
}
// Request message for PostBotEventTemp
message PostBotEventTempRequest {
// Types of bot events.
enum Type {
// Illegal value.
UNSPECIFIED = 0;
// Interesting but harmless event.
INFO = 1;
// Error condition.
ERROR = 2;
}
// The bot session name.
string name = 1;
// The type of bot event.
Type type = 2;
// A human-readable message.
string msg = 3;
}
// A coarse description of the status of the bot that the server uses to
// determine whether to assign the bot new leases.
enum BotStatus {
// Default value; do not use.
BOT_STATUS_UNSPECIFIED = 0;
// The bot is healthy, and will accept leases as normal.
OK = 1;
// The bot is unhealthy and will not accept new leases. For example, the bot
// may have detected that available disk space is too low. This situation may
// resolve itself, but will typically require human intervention.
UNHEALTHY = 2;
// The bot has been asked to reboot the host. The bot will not accept new
// leases; once all leases are complete, this session will no longer be
// updated but the bot will be expected to establish a new session after the
// reboot completes.
HOST_REBOOTING = 3;
// The bot has been asked to shut down. As with HOST_REBOOTING, once all
// leases are completed, the session will no longer be updated and the bot
// will not be expected to establish a new session.
//
// Bots are typically only asked to shut down if its host computer will be
// modified in some way, such as deleting a VM.
BOT_TERMINATING = 4;
}
// The state of the lease. All leases start in the PENDING state. A bot can
// change PENDING to ACTIVE or (in the case of an error) COMPLETED, or from
// ACTIVE to COMPLETED. The server can change PENDING or ACTIVE to CANCELLED if
// it wants the bot to release its resources - for example, if the bot needs to
// be quarantined (it's producing bad output) or a cell needs to be drained.
enum LeaseState {
// Default value; do not use.
LEASE_STATE_UNSPECIFIED = 0;
// Pending: the server expects the bot to accept this lease. This may only be
// set by the server.
PENDING = 1;
// Active: the bot has accepted this lease. This may only be set by the bot.
ACTIVE = 2;
// Completed: the bot is no longer leased. This may only be set by the bot,
// and the status field must be populated iff the state is COMPLETED.
COMPLETED = 4;
// Cancelled: The bot should immediately release all resources associated with
// the lease. This may only be set by the server.
CANCELLED = 5;
}

View File

@@ -0,0 +1,180 @@
// Copyright 2017 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;
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
// Describes a shell-style task to execute.
message CommandTask {
// Describes the inputs to a shell-style task.
message Inputs {
// An environment variable required by this task.
message EnvironmentVariable {
// The envvar name.
string name = 1;
// The envvar value.
string value = 2;
}
// The command itself to run (e.g., argv)
repeated string arguments = 1;
// The input filesystem to be set up prior to the task beginning. The
// contents should be a repeated set of FileMetadata messages though other
// formats are allowed if better for the implementation (eg, a LUCI-style
// .isolated file).
//
// This field is repeated since implementations might want to cache the
// metadata, in which case it may be useful to break up portions of the
// filesystem that change frequently (eg, specific input files) from those
// that don't (eg, standard header files).
repeated Digest files = 2;
// All environment variables required by the task.
repeated EnvironmentVariable environment_variables = 3;
}
// Describes the expected outputs of the command.
message Outputs {
// A list of expected files, relative to the execution root.
repeated string files = 1;
// A list of expected directories, relative to the execution root.
repeated string directories = 2;
}
// Describes the timeouts associated with this task.
message Timeouts {
// This specifies the maximum time that the task can run, excluding the
// time required to download inputs or upload outputs. That is, the worker
// will terminate the task if it runs longer than this.
google.protobuf.Duration execution = 1;
// This specifies the maximum amount of time the task can be idle - that is,
// go without generating some output in either stdout or stderr. If the
// process is silent for more than the specified time, the worker will
// terminate the task.
google.protobuf.Duration idle = 2;
// If the execution or IO timeouts are exceeded, the worker will try to
// gracefully terminate the task and return any existing logs. However,
// tasks may be hard-frozen in which case this process will fail. This
// timeout specifies how long to wait for a terminated task to shut down
// gracefully (e.g. via SIGTERM) before we bring down the hammer (e.g.
// SIGKILL on *nix, CTRL_BREAK_EVENT on Windows).
google.protobuf.Duration shutdown = 3;
}
// The inputs to the task.
Inputs inputs = 1;
// The expected outputs from the task.
Outputs expected_outputs = 4;
// The timeouts of this task.
Timeouts timeouts = 5;
}
// Describes the actual outputs from the task.
message CommandOutputs {
// exit_code is only fully reliable if the status' code is OK. If the task
// exceeded its deadline or was cancelled, the process may still produce an
// exit code as it is cancelled, and this will be populated, but a successful
// (zero) is unlikely to be correct unless the status code is OK.
int32 exit_code = 1;
// The output files. The blob referenced by the digest should contain
// one of the following (implementation-dependent):
// * A marshalled DirectoryMetadata of the returned filesystem
// * A LUCI-style .isolated file
Digest outputs = 2;
}
// Can be used as part of CompleteRequest.metadata, or are part of a more
// sophisticated message.
message CommandOverhead {
// The elapsed time between calling Accept and Complete. The server will also
// have its own idea of what this should be, but this excludes the overhead of
// the RPCs and the bot response time.
google.protobuf.Duration duration = 1;
// The amount of time *not* spent executing the command (ie
// uploading/downloading files).
google.protobuf.Duration overhead = 2;
}
// The metadata for a file. Similar to the equivalent message in the Remote
// Execution API.
message FileMetadata {
// The path of this file. If this message is part of the
// CommandResult.output_files fields, the path is relative to the execution
// root and must correspond to an entry in CommandTask.outputs.files. If this
// message is part of a Directory message, then the path is relative to the
// root of that directory.
string path = 1;
// A pointer to the contents of the file. The method by which a client
// retrieves the contents from a CAS system is not defined here.
Digest digest = 2;
// If the file is small enough, its contents may also or alternatively be
// listed here.
bytes contents = 3;
// Properties of the file
bool is_executable = 4;
}
// The metadata for a directory. Similar to the equivalent message in the Remote
// Execution API.
message DirectoryMetadata {
// The path of the directory, as in [FileMetadata.path][google.devtools.remoteworkers.v1test2.FileMetadata.path].
string path = 1;
// A pointer to the contents of the directory, in the form of a marshalled
// Directory message.
Digest digest = 2;
}
// A reference to the contents of a file or a directory. If the latter, the has
// refers to the hash of a marshalled Directory message. Similar to the
// equivalent message in the Remote Execution API.
message Digest {
// A string-encoded hash (eg "1a2b3c", not the byte array [0x1a, 0x2b, 0x3c])
// using an implementation-defined hash algorithm (eg SHA-256).
string hash = 1;
// The size of the contents. While this is not strictly required as part of an
// identifier (after all, any given hash will have exactly one canonical
// size), it's useful in almost all cases when one might want to send or
// retrieve blobs of content and is included here for this reason.
int64 size_bytes = 2;
}
// The contents of a directory. Similar to the equivalent message in the Remote
// Execution API.
message Directory {
// The files in this directory
repeated FileMetadata files = 1;
// Any subdirectories
repeated DirectoryMetadata directories = 2;
}

View File

@@ -0,0 +1,153 @@
// Copyright 2017 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;
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/rpc/status.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
// Design doc: https://goo.gl/oojM5H
//
// The Tasks interface defines tasks to execute and the results of these tasks.
// It does not include the metadata surrounding tasks; that is, the Task message
// represents *what* to be executed and *what* was the result of that execution,
// but not *how* to execute that task. For example this interface does not
// explain what platform the task should be run on, what priority it may have in
// any queue, etc.
//
// NB: we are not using google.rpc.batch since that's designed specifically for
// batch execution of RPC methods, and so is semantically quite different from
// our more general concept (though an RPC method could certainly be described
// by a Task in this interface).
service Tasks {
// GetTask reads the current state of the task. Tasks must be created through
// 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/*}" };
}
// UpdateTaskResult updates the result.
rpc UpdateTaskResult(UpdateTaskResultRequest) returns (TaskResult) {
option (google.api.http) = { patch: "/v1test2/{name=**/tasks/*/result}" body: "result" };
}
// AddTaskLog creates a new streaming log. The log is streamed and marked as
// completed through other interfaces (i.e., ByteStream). This can be called
// 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: "*" };
}
}
// A Task represents a unit of work. Its result and logs are defined as
// subresources.
//
// If all the `Any` fields are populated, this can be a very large message, and
// clients may not want the entire message returned on every call to every
// method. Such clients should request partial responses
// (https://cloud.google.com/apis/design/design_patterns#partial_response) and
// servers should implement partial responses in order to reduce unnecessry
// overhead.
message Task {
// The name of this task. Output only.
string name = 1;
// The actual task to perform. For example, this could be CommandTask to run a
// command line.
google.protobuf.Any description = 2;
// Handles to logs. The key is a human-readable name like `stdout`, and the
// handle is a resource name that can be passed to ByteStream or other
// accessors.
//
// An implementation may define some logs by default (like `stdout`), and may
// allow clients to add new logs via AddTaskLog.
map<string, string> logs = 3;
}
// The result and metadata of the task.
message TaskResult {
// The name of the task result; must be a name of a `Task` followed by
// `/result`.
string name = 1;
// The result may be updated several times; the client must only set
// `complete` to true to indicate that no further updates are allowed.
// If this is not true, the `status` field must not be examined since its zero
// value is equivalent to `OK`.
//
// Once a task is completed, it must not be updated with further results,
// though the implementation may choose to continue to receive logs.
bool complete = 2;
// The final status of the task itself. For example, if task.description
// included a timeout which was violated, status.code may be
// DEADLINE_EXCEEDED. This field can only be read if `complete` is true.
google.rpc.Status status = 3;
// Any non-log output, such as output files and exit codes. See
// CommandResult as an example.
google.protobuf.Any output = 4;
// Any information about how the command was executed, eg runtime. See
// CommandOverhead as an example.
google.protobuf.Any meta = 5;
}
// Request message for `GetTask`.
message GetTaskRequest {
// The task name.
string name = 1;
}
// Request message for `UpdateTaskResult`.
message UpdateTaskResultRequest {
// The task result name; must match `result.name`.
string name = 1;
// The result being updated.
TaskResult result = 2;
// The fields within `result` that are specified.
google.protobuf.FieldMask update_mask = 3;
// If this is being updated by a bot from BotManager, the source should be
// bot.session_id. That way, if two bots accidentally get the same name, we'll
// know to reject updates from the older one.
string source = 4;
}
// Request message for `AddTaskLog`.
message AddTaskLogRequest {
// The name of the task that will own the new log.
string name = 1;
// The human-readable name of the log, like `stdout` or a relative file path.
string log_id = 2;
}
// Response message for `AddTaskLog`.
message AddTaskLogResponse {
// The handle for the new log, as would be returned in Task.logs.
string handle = 1;
}

View File

@@ -0,0 +1,182 @@
// Copyright 2017 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.source.v1;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.DevTools.Source.V1";
option go_package = "google.golang.org/genproto/googleapis/devtools/source/v1;source";
option java_multiple_files = true;
option java_outer_classname = "SourceContextProto";
option java_package = "com.google.devtools.source.v1";
option php_namespace = "Google\\Cloud\\DevTools\\Source\\V1";
// A SourceContext is a reference to a tree of files. A SourceContext together
// with a path point to a unique revision of a single file or directory.
message SourceContext {
// A SourceContext can refer any one of the following types of repositories.
oneof context {
// A SourceContext referring to a revision in a cloud repo.
CloudRepoSourceContext cloud_repo = 1;
// A SourceContext referring to a snapshot in a cloud workspace.
CloudWorkspaceSourceContext cloud_workspace = 2;
// A SourceContext referring to a Gerrit project.
GerritSourceContext gerrit = 3;
// A SourceContext referring to any third party Git repo (e.g. GitHub).
GitSourceContext git = 6;
}
}
// An ExtendedSourceContext is a SourceContext combined with additional
// details describing the context.
message ExtendedSourceContext {
// Any source context.
SourceContext context = 1;
// Labels with user defined metadata.
map<string, string> labels = 2;
}
// An alias to a repo revision.
message AliasContext {
// The type of an Alias.
enum Kind {
// Do not use.
ANY = 0;
// Git tag
FIXED = 1;
// Git branch
MOVABLE = 2;
// OTHER is used to specify non-standard aliases, those not of the kinds
// above. For example, if a Git repo has a ref named "refs/foo/bar", it
// is considered to be of kind OTHER.
OTHER = 4;
}
// The alias kind.
Kind kind = 1;
// The alias name.
string name = 2;
}
// A CloudRepoSourceContext denotes a particular revision in a cloud
// repo (a repo hosted by the Google Cloud Platform).
message CloudRepoSourceContext {
// The ID of the repo.
RepoId repo_id = 1;
// A revision in a cloud repository can be identified by either its revision
// ID or its Alias.
oneof revision {
// A revision ID.
string revision_id = 2;
// The name of an alias (branch, tag, etc.).
string alias_name = 3;
// An alias, which may be a branch or tag.
AliasContext alias_context = 4;
}
}
// A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.
message CloudWorkspaceSourceContext {
// The ID of the workspace.
CloudWorkspaceId workspace_id = 1;
// The ID of the snapshot.
// An empty snapshot_id refers to the most recent snapshot.
string snapshot_id = 2;
}
// A SourceContext referring to a Gerrit project.
message GerritSourceContext {
// The URI of a running Gerrit instance.
string host_uri = 1;
// The full project name within the host. Projects may be nested, so
// "project/subproject" is a valid project name.
// The "repo name" is hostURI/project.
string gerrit_project = 2;
// A revision in a Gerrit project can be identified by either its revision ID
// or its alias.
oneof revision {
// A revision (commit) ID.
string revision_id = 3;
// The name of an alias (branch, tag, etc.).
string alias_name = 4;
// An alias, which may be a branch or tag.
AliasContext alias_context = 5;
}
}
// A GitSourceContext denotes a particular revision in a third party Git
// repository (e.g. GitHub).
message GitSourceContext {
// Git repository URL.
string url = 1;
// Git commit hash.
// required.
string revision_id = 2;
}
// A unique identifier for a cloud repo.
message RepoId {
// A cloud repository can be identified by either its project ID and
// repository name combination, or its globally unique identifier.
oneof id {
// A combination of a project ID and a repo name.
ProjectRepoId project_repo_id = 1;
// A server-assigned, globally unique identifier.
string uid = 2;
}
}
// Selects a repo using a Google Cloud Platform project ID
// (e.g. winged-cargo-31) and a repo name within that project.
message ProjectRepoId {
// The ID of the project.
string project_id = 1;
// The name of the repo. Leave empty for the default repo.
string repo_name = 2;
}
// A CloudWorkspaceId is a unique identifier for a cloud workspace.
// A cloud workspace is a place associated with a repo where modified files
// can be stored before they are committed.
message CloudWorkspaceId {
// The ID of the repo containing the workspace.
RepoId repo_id = 1;
// The unique name of the workspace within the repo. This is the name
// chosen by the client in the Source API's CreateWorkspace method.
string name = 2;
}

View File

@@ -0,0 +1,165 @@
// Copyright 2017 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.sourcerepo.v1;
import "google/api/annotations.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/sourcerepo/v1;sourcerepo";
option java_multiple_files = true;
option java_outer_classname = "SourceRepoProto";
option java_package = "com.google.devtools.sourcerepo.v1";
// The Source Repo API service.
service SourceRepo {
// Returns all repos belonging to a project. The sizes of the repos are
// not set by ListRepos. To get the size of a repo, use GetRepo.
rpc ListRepos(ListReposRequest) returns (ListReposResponse) {
option (google.api.http) = { get: "/v1/{name=projects/*}/repos" };
}
// Returns information about a repo.
rpc GetRepo(GetRepoRequest) returns (Repo) {
option (google.api.http) = { get: "/v1/{name=projects/*/repos/**}" };
}
// Creates a repo in the given project with the given name.
//
// If the named repository already exists, `CreateRepo` returns
// `ALREADY_EXISTS`.
rpc CreateRepo(CreateRepoRequest) returns (Repo) {
option (google.api.http) = { post: "/v1/{parent=projects/*}/repos" body: "repo" };
}
// Deletes a repo.
rpc DeleteRepo(DeleteRepoRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { delete: "/v1/{name=projects/*/repos/**}" };
}
// Sets the access control policy on the specified resource. Replaces any
// existing policy.
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = { post: "/v1/{resource=projects/*/repos/**}:setIamPolicy" body: "*" };
}
// Gets the access control policy for a resource.
// Returns an empty policy if the resource exists and does not have a policy
// set.
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = { get: "/v1/{resource=projects/*/repos/**}:getIamPolicy" };
}
// Returns permissions that a caller has on the specified resource.
// If the resource does not exist, this will return an empty set of
// permissions, not a NOT_FOUND error.
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = { post: "/v1/{resource=projects/*/repos/**}:testIamPermissions" body: "*" };
}
}
// A repository (or repo) is a Git repository storing versioned source content.
message Repo {
// Resource name of the repository, of the form
// `projects/<project>/repos/<repo>`. The repo name may contain slashes.
// eg, `projects/myproject/repos/name/with/slash`
string name = 1;
// The disk usage of the repo, in bytes. Read-only field. Size is only
// returned by GetRepo.
int64 size = 2;
// URL to clone the repository from Google Cloud Source Repositories.
// Read-only field.
string url = 3;
// How this repository mirrors a repository managed by another service.
// Read-only field.
MirrorConfig mirror_config = 4;
}
// Configuration to automatically mirror a repository from another
// hosting service, for example GitHub or BitBucket.
message MirrorConfig {
// URL of the main repository at the other hosting service.
string url = 1;
// ID of the webhook listening to updates to trigger mirroring.
// Removing this webhook from the other hosting service will stop
// Google Cloud Source Repositories from receiving notifications,
// and thereby disabling mirroring.
string webhook_id = 2;
// ID of the SSH deploy key at the other hosting service.
// Removing this key from the other service would deauthorize
// Google Cloud Source Repositories from mirroring.
string deploy_key_id = 3;
}
// Request for GetRepo.
message GetRepoRequest {
// The name of the requested repository. Values are of the form
// `projects/<project>/repos/<repo>`.
string name = 1;
}
// Request for ListRepos.
message ListReposRequest {
// The project ID whose repos should be listed. Values are of the form
// `projects/<project>`.
string name = 1;
// Maximum number of repositories to return; between 1 and 500.
// If not set or zero, defaults to 100 at the server.
int32 page_size = 2;
// Resume listing repositories where a prior ListReposResponse
// left off. This is an opaque token that must be obtained from
// a recent, prior ListReposResponse's next_page_token field.
string page_token = 3;
}
// Response for ListRepos. The size is not set in the returned repositories.
message ListReposResponse {
// The listed repos.
repeated Repo repos = 1;
// If non-empty, additional repositories exist within the project. These
// can be retrieved by including this value in the next ListReposRequest's
// page_token field.
string next_page_token = 2;
}
// Request for CreateRepo
message CreateRepoRequest {
// The project in which to create the repo. Values are of the form
// `projects/<project>`.
string parent = 1;
// The repo to create. Only name should be set; setting other fields
// is an error. The project in the name should match the parent field.
Repo repo = 2;
}
// Request for DeleteRepo.
message DeleteRepoRequest {
// The name of the repo to delete. Values are of the form
// `projects/<project>/repos/<repo>`.
string name = 1;
}