Firebase Update

This commit is contained in:
Lukas Nowy
2018-12-22 23:30:39 +01:00
parent befb44764d
commit acffe619b3
11523 changed files with 1614327 additions and 930246 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,161 @@
// 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 PublishBuildToolEventStreamRequest)
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,961 @@
// Copyright 2018 Google LLC.
//
// 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/api/httpbody.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/field_mask.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";
// Creates and manages builds on Google Cloud Platform.
//
// The main concept used by this API is a `Build`, which describes the location
// of the source to build, how to build the source, and where to store the
// built artifacts, if any.
//
// 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.
//
// This method returns a long-running `Operation`, which includes the build
// ID. Pass the build ID to `GetBuild` to determine the build status (such as
// `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 (such as `SUCCESS`,
// `FAILURE`, or `WORKING`), 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 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 specified build.
//
// This method 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; therefore 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 Google 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"
};
}
// Returns 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`s.
//
// This API is experimental.
rpc ListBuildTriggers(ListBuildTriggersRequest) returns (ListBuildTriggersResponse) {
option (google.api.http) = {
get: "/v1/projects/{project_id}/triggers"
};
}
// Deletes a `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 a `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"
};
}
}
// Specifies a build to retry.
message RetryBuildRequest {
// ID of the project.
string project_id = 1;
// Build ID of the original build.
string id = 2;
}
// 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;
}
// Location of the source in an archive file in Google Cloud Storage.
message StorageSource {
// Google Cloud Storage bucket containing the source (see
// [Bucket Name
// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
string bucket = 1;
// Google Cloud Storage object containing the 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;
}
// Location of the source in a Google Cloud Source Repository.
message RepoSource {
// ID of the project that owns the Cloud Source Repository. If omitted, the
// project ID requesting the build is assumed.
string project_id = 1;
// Name of the Cloud Source Repository. If omitted, the name "default" is
// assumed.
string repo_name = 2;
// A revision within the Cloud 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.
//
// This must be a relative path. If a step's `dir` is specified and is an
// absolute path, this value is ignored for that step's execution.
string dir = 7;
}
// Location of the source in a supported storage service.
message Source {
// Location of source.
oneof source {
// If provided, get the source from this location in Google Cloud Storage.
StorageSource storage_source = 2;
// If provided, get the source from this location in a Cloud Source
// Repository.
RepoSource repo_source = 3;
}
}
// 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;
// Output only. Stores timing information for pushing the specified image.
TimeSpan push_timing = 4;
}
// A step in the build pipeline.
message BuildStep {
// Required. The name of the container image that will run this particular
// build step.
//
// If the image is 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, the `args`
// are used as arguments to that entrypoint. If the image does not define
// an entrypoint, the first element in args is used as the entrypoint,
// and the remainder will be used as arguments.
repeated string args = 3;
// Working directory to use when running this step's container.
//
// If this value is a relative path, it is relative to the build's working
// directory. If this value is absolute, it may be outside the build's working
// directory, in which case the contents of the path may not be persisted
// across build step executions, unless a `volume` for that path is specified.
//
// If the build specifies a `RepoSource` with `dir` and a step with a `dir`,
// which specifies an absolute path, the `RepoSource` `dir` is ignored for
// the step's execution.
string dir = 4;
// 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;
// Entrypoint to be used instead of the build step image's default entrypoint.
// If unset, the image's default entrypoint is used.
string entrypoint = 7;
// A list of environment variables which are encrypted using a Cloud Key
// Management Service crypto key. These values must be specified in the
// build's `Secret`.
repeated string secret_env = 8;
// List of volumes to mount into the build step.
//
// Each volume is created as an empty volume prior to execution of the
// build step. Upon completion of the build, volumes and their contents are
// discarded.
//
// Using a named volume in only one step is not valid as it is indicative
// of a build request with an incorrect configuration.
repeated Volume volumes = 9;
// Output only. Stores timing information for executing this build step.
TimeSpan timing = 10;
// Output only. Stores timing information for pulling this build step's
// builder image only.
TimeSpan pull_timing = 13;
// Time limit for executing this build step. If not defined, the step has no
// time limit and will be allowed to continue to run until either it completes
// or the build itself times out.
google.protobuf.Duration timeout = 11;
// Output only. Status of the build step. At this time, build step status is
// only updated on build completion; step status is not updated in real-time
// as the build progresses.
Build.Status status = 12;
}
// 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;
}
// Artifacts created by the build pipeline.
message Results {
// Container images that were built as a part of the build.
repeated BuiltImage images = 2;
// List of build step digests, in the order corresponding to build step
// indices.
repeated string build_step_images = 3;
// Path to the artifact manifest. Only populated when artifacts are uploaded.
string artifact_manifest = 4;
// Number of artifacts uploaded. Only populated when artifacts are uploaded.
int64 num_artifacts = 5;
// List of build step outputs, produced by builder images, in the order
// corresponding to build step indices.
//
// [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders)
// can produce this output by writing to `$BUILDER_OUTPUT/output`.
// Only the first 4KB of data is stored.
repeated bytes build_step_outputs = 6;
}
// An artifact that was uploaded during a build. This
// is a single record in the artifact manifest JSON file.
message ArtifactResult {
// The path of an artifact in a Google Cloud Storage bucket, with the
// generation number. For example,
// `gs://mybucket/path/to/output.jar#generation`.
string location = 1;
// The file hash of the artifact.
repeated FileHashes file_hash = 2;
}
// A build resource in the Cloud Build 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 where to store
// the built artifacts.
//
// 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 or build step.
enum Status {
// Status of the build is unknown.
STATUS_UNKNOWN = 0;
// Build or step is queued; work has not yet begun.
QUEUED = 1;
// Build or step is being executed.
WORKING = 2;
// Build or step finished successfully.
SUCCESS = 3;
// Build or step failed to complete successfully.
FAILURE = 4;
// Build or step failed due to an internal cause.
INTERNAL_ERROR = 5;
// Build or step took longer than was allowed.
TIMEOUT = 6;
// Build or step was canceled by a user.
CANCELLED = 7;
}
// Output only. Unique identifier of the build.
string id = 1;
// Output only. ID of the project.
string project_id = 16;
// Output only. Status of the build.
Status status = 2;
// Output only. Customer-readable message about the current status.
string status_detail = 24;
// The location of the source files to build.
Source source = 3;
// Required. The operations to be performed on the workspace.
repeated BuildStep steps = 11;
// Output only. Results of the build.
Results results = 10;
// Output only. Time at which the request to create the build was received.
google.protobuf.Timestamp create_time = 6;
// Output only. Time at which execution of the build was started.
google.protobuf.Timestamp start_time = 7;
// Output only. 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.
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 are 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 status is marked
// `FAILURE`.
repeated string images = 13;
// Artifacts produced by the build that should be uploaded upon
// successful completion of all build steps.
Artifacts artifacts = 37;
// 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;
// Output only. A permanent fixed identifier for source.
SourceProvenance source_provenance = 21;
// Output only. The ID of the `BuildTrigger` that triggered this build, if it
// was triggered automatically.
string build_trigger_id = 22;
// Special options for this build.
BuildOptions options = 23;
// Output only. URL to logs for this build in Google Cloud Console.
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 Key Management Service.
repeated Secret secrets = 32;
// Output only. 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 images,
// these keys will not be included.
map<string, TimeSpan> timing = 33;
}
// Artifacts produced by a build that should be uploaded upon
// successful completion of all build steps.
message Artifacts {
// Files in the workspace to upload to Cloud Storage upon successful
// completion of all build steps.
message ArtifactObjects {
// Cloud Storage bucket and optional object path, in the form
// "gs://bucket/path/to/somewhere/". (see [Bucket Name
// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
//
// Files in the workspace matching any path pattern will be uploaded to
// Cloud Storage with this location as a prefix.
string location = 1;
// Path globs used to match files in the build's workspace.
repeated string paths = 2;
// Output only. Stores timing information for pushing all artifact objects.
TimeSpan timing = 3;
}
// 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 = 1;
// A list of objects to be uploaded to Cloud Storage upon successful
// completion of all build steps.
//
// Files in the workspace matching specified paths globs will be uploaded to
// the specified Cloud Storage location using the builder service account's
// credentials.
//
// The location and generation of the uploaded objects will be stored in the
// Build resource's results field.
//
// If any objects fail to be pushed, the build is marked FAILURE.
ArtifactObjects objects = 2;
}
// 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;
// Output only. Hash(es) of the build source, which can be used to verify that
// the originalsource integrity was maintained in the build. Note that
// `FileHashes` willonly 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.
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;
// Use a md5 hash.
MD5 = 2;
}
// The type of hash that was performed.
HashType type = 1;
// The hash value.
bytes value = 2;
}
// 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
// 64 KB in size. There can be at most 100 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 {
// Output only. Unique identifier of the trigger.
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;
}
// Output only. Time when the trigger was created.
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;
// ignored_files and included_files are file glob matches using
// http://godoc/pkg/path/filepath#Match extended with support for "**".
//
// If ignored_files and changed files are both empty, then they are
// not used to determine whether or not to trigger a build.
//
// If ignored_files is not empty, then we ignore any files that match
// any of the ignored_file globs. If the change has no files that are
// outside of the ignored_files globs, then we do not trigger a build.
repeated string ignored_files = 15;
// If any of the files altered in the commit pass the ignored_files
// filter and included_files is empty, then as far as this filter is
// concerned, we should trigger the build.
//
// If any of the files altered in the commit pass the ignored_files
// filter and included_files is not empty, then we make sure that at
// least one of those files matches a included_files glob. If not,
// then we do not trigger a build.
repeated string included_files = 16;
}
// 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;
}
// Specifies the logging mode.
enum LoggingMode {
// The service determines the logging mode. The default is `LEGACY`. Do not
// rely on the default logging behavior as it may change in the future.
LOGGING_UNSPECIFIED = 0;
// Stackdriver logging and Cloud Storage logging are enabled.
LEGACY = 1;
// Only Cloud Storage logging is enabled.
GCS_ONLY = 2;
}
// Requested hash for SourceProvenance.
repeated Hash.HashType source_provenance_hash = 1;
// Requested verifiability options.
VerifyOption requested_verify_option = 2;
// Compute Engine machine type on which to run the build.
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;
// Option to specify behavior when there is an error in the substitution
// checks.
SubstitutionOption substitution_option = 4;
// Option to define build log streaming behavior to Google Cloud
// Storage.
LogStreamingOption log_streaming_option = 5;
// Option to specify a `WorkerPool` for the build. User specifies the pool
// with the format "[WORKERPOOL_PROJECT_ID]/[WORKERPOOL_NAME]".
// This is an experimental field.
string worker_pool = 7;
// Option to specify the logging mode, which determines where the logs are
// stored.
LoggingMode logging = 11;
// A list of global environment variable definitions that will exist for all
// build steps in this build. If a variable is defined in both globally and in
// a build step, the variable will use the build step value.
//
// The elements are of the form "KEY=VALUE" for the environment variable "KEY"
// being given the value "VALUE".
repeated string env = 12;
// A list of global environment variables, which are encrypted using a Cloud
// Key Management Service crypto key. These values must be specified in the
// build's `Secret`. These variables will be available to all build steps
// in this build.
repeated string secret_env = 13;
// Global list of volumes to mount for ALL build steps
//
// Each volume is created as an empty volume prior to starting the build
// process. Upon completion of the build, volumes and their contents are
// discarded. Global volume names and paths cannot conflict with the volumes
// defined a build step.
//
// Using a global volume in a build with only one step is not valid as
// it is indicative of a build request with an incorrect configuration.
repeated Volume volumes = 14;
}

View File

@ -0,0 +1,174 @@
// Copyright 2018 Google LLC.
//
// 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 guaranteed 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,454 @@
// Copyright 2018 Google LLC.
//
// 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/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option cc_enable_arenas = true;
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;
// Column within a line. The first column in a line as the value `1`.
// Agents that do not support setting breakpoints on specific columns ignore
// this field.
int32 column = 3;
}
// 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, where stack_frames[0] represents the most
// recently entered function.
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 distinguish 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 distinguish 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.
repeated google.devtools.source.v1.ExtendedSourceContext ext_source_contexts = 13 [deprecated = true];
// 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,209 @@
// Copyright 2018 Google LLC.
//
// 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 [deprecated = true];
// 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,207 @@
// Copyright 2018 Google LLC
//
// 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/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2;cloudprofiler";
// Manage the collection of continuous profiling data provided by profiling
// agents running in the cloud or by 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 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".
rpc CreateProfile(CreateProfileRequest) returns (Profile) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/profiles"
body: "*"
};
}
// CreateOfflineProfile creates a new profile resource in the offline mode.
// The client provides the profile to create along with the profile bytes, the
// server records it.
rpc CreateOfflineProfile(CreateOfflineProfileRequest) returns (Profile) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/profiles:createOffline"
body: "profile"
};
}
// UpdateProfile updates the profile bytes and labels on the profile resource
// created in the online mode. Updating the bytes for profiles created in the
// offline mode is currently not supported: the profile content must be
// provided at the time of the profile creation.
rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
option (google.api.http) = {
patch: "/v2/{profile.name=projects/*/profiles/*}"
body: "profile"
};
}
}
// CreateProfileRequest describes a profile resource online creation request.
// The deployment field must be populated. 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.
message CreateProfileRequest {
// Parent project to create the profile in.
string parent = 4;
// Deployment details.
Deployment deployment = 1;
// One or more profile types that the agent is capable of providing.
repeated ProfileType profile_type = 2;
}
// CreateOfflineProfileRequest describes a profile resource offline creation
// request. Profile field must be set.
message CreateOfflineProfileRequest {
// Parent project to create the profile in.
string parent = 1;
// Contents of the profile to create.
Profile profile = 2;
}
// UpdateProfileRequest contains the profile to update.
message UpdateProfileRequest {
// Profile to update
Profile profile = 1;
// Field mask used to specify the fields to be overwritten. Currently only
// profile_bytes and labels fields are supported by UpdateProfile, so only
// those fields can be specified in the mask. When no mask is provided, all
// fields are overwritten.
google.protobuf.FieldMask update_mask = 2;
}
// Profile resource.
message Profile {
// Output only. Opaque, server-assigned, unique ID for this profile.
string name = 1;
// Type of profile.
// For offline mode, this must be specified when creating the profile. For
// online mode it is assigned and returned by the server.
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;
// Input only. 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;
// Input only. 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.
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;
// In-use heap profile. Represents a snapshot of the allocations that are
// live at the time of the profiling.
HEAP = 3;
// Single-shot collection of all thread stacks.
THREADS = 4;
// Synchronization contention profile.
CONTENTION = 5;
// Peak heap profile.
PEAK_HEAP = 6;
// Heap allocation profile. It represents the aggregation of all allocations
// made over the duration of the profile. All allocations are included,
// including those that might have been freed by the end of the profiling
// interval. The profile is in particular useful for garbage collecting
// languages to understand which parts of the code create most of the garbage
// collection pressure to see if those can be optimized.
HEAP_ALLOC = 7;
}

View File

@ -0,0 +1,285 @@
// 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/path`
// * `/http/redirected_url`
// * `/http/request/size`
// * `/http/response/size`
// * `/http/route`
// * `/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,105 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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,994 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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";
import "google/rpc/status.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/*}/occurrences:vulnerabilitySummary"
};
}
// 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: "*"
additional_bindings {
post: "/v1alpha1/{resource=projects/*/occurrences/*}: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: "*"
additional_bindings {
post: "/v1alpha1/{resource=projects/*/occurrences/*}: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: "*"
additional_bindings {
post: "/v1alpha1/{resource=projects/*/occurrences/*}:testIamPermissions"
body: "*"
}
};
}
// Creates a new `Operation`.
rpc CreateOperation(CreateOperationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha1/{parent=projects/*}/operations"
body: "*"
};
}
// Updates an existing operation returns an error if operation
// does not exist. The only valid operations are to update mark the done bit
// change the result.
rpc UpdateOperation(UpdateOperationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1alpha1/{name=projects/*/operations/*}"
body: "*"
};
}
// Gets a specific scan configuration for a project.
rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) {
option (google.api.http) = {
get: "/v1alpha1/{name=projects/*/scan_configs/*}"
};
}
// Lists scan configurations for a project.
rpc ListScanConfigs(ListScanConfigsRequest)
returns (ListScanConfigsResponse) {
option (google.api.http) = {
get: "/v1alpha1/{parent=projects/*}/scan_configs"
};
}
// Updates the scan configuration to a new value.
rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) {
option (google.api.http) = {
patch: "/v1alpha1/{name=projects/*/scan_configs/*}"
body: "scan_config"
};
}
}
// `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;
// The resource for which the `Occurrence` applies.
Resource resource = 17;
// 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;
// Describes an attestation of an artifact.
AttestationAuthority.Attestation attestation = 16;
}
// 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;
}
// Resource is an entity that can have metadata. E.g., a Docker image.
message Resource {
// The name of the resource. E.g., the name of a Docker image - "Debian".
string name = 1;
// The unique URI of the resource. E.g.,
// "https://gcr.io/project/image@sha256:foo" for a Docker image.
string uri = 2;
// The hash of the resource content. E.g., the Docker digest.
Hash content_hash = 3;
}
// 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;
// This represents a logical "role" that can attest to artifacts.
ATTESTATION_AUTHORITY = 8;
}
// 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;
// A note describing an attestation role.
AttestationAuthority attestation_authority = 19;
}
// 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 {
// Analysis status for a resource.
enum AnalysisStatus {
// Unknown
ANALYSIS_STATUS_UNSPECIFIED = 0;
// Resource is known but no action has been taken yet.
PENDING = 1;
// Resource is being analyzed.
SCANNING = 2;
// Analysis has finished successfully.
FINISHED_SUCCESS = 3;
// Analysis has finished unsuccessfully, the analysis itself is in a bad
// state.
FINISHED_FAILED = 4;
// Analysis will not happen, the resource is not supported.
UNSUPPORTED_RESOURCE = 5;
}
// Output only. An operation that indicates the status of the current scan.
google.longrunning.Operation operation = 1;
// The status of discovery for the resource.
AnalysisStatus analysis_status = 5;
// When an error is encountered this will contain a LocalizedMessage under
// details to show to the user. The LocalizedMessage output only and
// populated by the API.
google.rpc.Status analysis_status_error = 6;
}
// 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 Build based signatures, this is a PEM encoded public
// key. To verify the Cloud Build 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;
}
// An attestation wrapper with a PGP-compatible signature.
// This message only supports `ATTACHED` signatures, where the payload that is
// signed is included alongside the signature itself in the same file.
message PgpSignedAttestation {
// Type (for example schema) of the attestation payload that was signed.
enum ContentType {
// `ContentType` is not set.
CONTENT_TYPE_UNSPECIFIED = 0;
// Atomic format attestation signature. See
// https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
// The payload extracted from `signature` is a JSON blob conforming to the
// linked schema.
SIMPLE_SIGNING_JSON = 1;
}
// The raw content of the signature, as output by GNU Privacy Guard (GPG) or
// equivalent. Since this message only supports attached signatures, the
// payload that was signed must be attached. While the signature format
// supported is dependent on the verification implementation, currently only
// ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
// `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
// --output=signature.gpg payload.json` will create the signature content
// expected in this field in `signature.gpg` for the `payload.json`
// attestation payload.
string signature = 1;
// Type (for example schema) of the attestation payload that was signed.
// The verifier must ensure that the provided type is one that the verifier
// supports, and that the attestation payload is a valid instantiation of that
// type (for example by validating a JSON schema).
ContentType content_type = 3;
// This field is used by verifiers to select the public key used to validate
// the signature. Note that the policy of the verifier ultimately determines
// which public keys verify a signature based on the context of the
// verification. There is no guarantee validation will succeed if the
// verifier has no key matching this ID, even if it has a key under a
// different ID that would verify the signature. Note that this ID should also
// be present in the signature content above, but that is not expected to be
// used by the verifier.
oneof key_id {
// The cryptographic fingerprint of the key used to generate the signature,
// as output by, e.g. `gpg --list-keys`. This should be the version 4, full
// 160-bit fingerprint, expressed as a 40 character hexadecimal string. See
// https://tools.ietf.org/html/rfc4880#section-12.2 for details.
// Implementations may choose to acknowledge "LONG", "SHORT", or other
// abbreviated key IDs, but only the full fingerprint is guaranteed to work.
// In gpg, the full fingerprint can be retrieved from the `fpr` field
// returned when calling --list-keys with --with-colons. For example:
// ```
// gpg --with-colons --with-fingerprint --force-v4-certs \
// --list-keys attester@example.com
// tru::1:1513631572:0:3:1:5
// pub:...<SNIP>...
// fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
// ```
// Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
string pgp_key_id = 2;
}
}
// Note kind that represents a logical attestation "role" or "authority". For
// example, an organization might have one `AttestationAuthority` for "QA" and
// one for "build". This Note is intended to act strictly as a grouping
// mechanism for the attached Occurrences (Attestations). This grouping
// mechanism also provides a security boundary, since IAM ACLs gate the ability
// for a principle to attach an Occurrence to a given Note. It also provides a
// single point of lookup to find all attached Attestation Occurrences, even if
// they don't all live in the same project.
message AttestationAuthority {
// This submessage provides human-readable hints about the purpose of the
// AttestationAuthority. Because the name of a Note acts as its resource
// reference, it is important to disambiguate the canonical name of the Note
// (which might be a UUID for security purposes) from "readable" names more
// suitable for debug output. Note that these hints should NOT be used to
// look up AttestationAuthorities in security sensitive contexts, such as when
// looking up Attestations to verify.
message AttestationAuthorityHint {
// The human readable name of this Attestation Authority, for example "qa".
string human_readable_name = 1;
}
// Occurrence that represents a single "attestation". The authenticity of an
// Attestation can be verified using the attached signature. If the verifier
// trusts the public key of the signer, then verifying the signature is
// sufficient to establish trust. In this circumstance, the
// AttestationAuthority to which this Attestation is attached is primarily
// useful for look-up (how to find this Attestation if you already know the
// Authority and artifact to be verified) and intent (which authority was this
// attestation intended to sign for).
message Attestation {
// The signature, generally over the `resource_url`, that verifies this
// attestation. The semantics of the signature veracity are ultimately
// determined by the verification engine.
oneof signature {
PgpSignedAttestation pgp_signed_attestation = 1;
}
}
AttestationAuthorityHint hint = 1;
}
// 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;
}
// Indicates various scans and whether they are turned on or off.
message ScanConfig {
// Output only. The name of the ScanConfig in the form
// “projects/{project_id}/ScanConfigs/{ScanConfig_id}".
string name = 1;
// Output only. A human-readable description of what the `ScanConfig` does.
string description = 2;
// Indicates whether the Scan is enabled.
bool enabled = 3;
}
// 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;
// The kind of occurrences to filter on.
Note.Kind kind = 6;
}
// 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: "projects/{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:
// "projects/{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;
}
// Request for creating an operation
message CreateOperationRequest {
// The project Id that this operation should be created under.
string parent = 1;
// The ID to use for this operation.
string operation_id = 2;
// The operation to create.
google.longrunning.Operation operation = 3;
}
// Request for updating an existing operation
message UpdateOperationRequest {
// The name of the Operation.
// Should be of the form "projects/{provider_id}/operations/{operation_id}".
string name = 1;
// The operation to create.
google.longrunning.Operation operation = 3;
google.protobuf.FieldMask update_mask = 4;
}
// 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;
}
// Request to get a ScanConfig.
message GetScanConfigRequest {
// The name of the ScanConfig in the form
// projects/{project_id}/scan_configs/{ScanConfig_id}
// instead.
string name = 1;
}
// Request to list the available scan configurations.
message ListScanConfigsRequest {
// This containers the project Id i.e.: projects/{project_id}
// instead.
string parent = 1;
// The filter expression.
string filter = 2;
// The number of items to return.
int32 page_size = 3;
// The page token to use for the next request.
string page_token = 4;
}
// A list of ScanConfigs for the project.
message ListScanConfigsResponse {
// The set of scan configs
repeated ScanConfig scan_configs = 1;
// A page token to pass in order to get more scans.
string next_page_token = 2;
}
// A request to update a ScanConfig.
message UpdateScanConfigRequest {
// The scan config to update of the form
// projects/{project_id}/scan_configs/{ScanConfig_id}
// instead.
string name = 1;
// The new scan configuration
ScanConfig scan_config = 2;
google.protobuf.FieldMask update_mask = 3;
}

View File

@ -0,0 +1,150 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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,182 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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;
// Whether this Detail is obsolete. Occurrences are expected not to point to
// obsolete details.
bool is_obsolete = 11;
}
// 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 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.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,132 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.attestation;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/attestation;attestation";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.attestation";
option objc_class_prefix = "GRA";
// An attestation wrapper with a PGP-compatible signature. This message only
// supports `ATTACHED` signatures, where the payload that is signed is included
// alongside the signature itself in the same file.
message PgpSignedAttestation {
// The raw content of the signature, as output by GNU Privacy Guard (GPG) or
// equivalent. Since this message only supports attached signatures, the
// payload that was signed must be attached. While the signature format
// supported is dependent on the verification implementation, currently only
// ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
// `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
// --output=signature.gpg payload.json` will create the signature content
// expected in this field in `signature.gpg` for the `payload.json`
// attestation payload.
string signature = 1;
// Type (for example schema) of the attestation payload that was signed.
enum ContentType {
// `ContentType` is not set.
CONTENT_TYPE_UNSPECIFIED = 0;
// Atomic format attestation signature. See
// https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
// The payload extracted from `signature` is a JSON blob conforming to the
// linked schema.
SIMPLE_SIGNING_JSON = 1;
}
// Type (for example schema) of the attestation payload that was signed.
// The verifier must ensure that the provided type is one that the verifier
// supports, and that the attestation payload is a valid instantiation of that
// type (for example by validating a JSON schema).
ContentType content_type = 3;
// This field is used by verifiers to select the public key used to validate
// the signature. Note that the policy of the verifier ultimately determines
// which public keys verify a signature based on the context of the
// verification. There is no guarantee validation will succeed if the
// verifier has no key matching this ID, even if it has a key under a
// different ID that would verify the signature. Note that this ID should also
// be present in the signature content above, but that is not expected to be
// used by the verifier.
oneof key_id {
// The cryptographic fingerprint of the key used to generate the signature,
// as output by, e.g. `gpg --list-keys`. This should be the version 4, full
// 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
// https://tools.ietf.org/html/rfc4880#section-12.2 for details.
// Implementations may choose to acknowledge "LONG", "SHORT", or other
// abbreviated key IDs, but only the full fingerprint is guaranteed to work.
// In gpg, the full fingerprint can be retrieved from the `fpr` field
// returned when calling --list-keys with --with-colons. For example:
// ```
// gpg --with-colons --with-fingerprint --force-v4-certs \
// --list-keys attester@example.com
// tru::1:1513631572:0:3:1:5
// pub:...<SNIP>...
// fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
// ```
// Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
string pgp_key_id = 2;
}
}
// Note kind that represents a logical attestation "role" or "authority". For
// example, an organization might have one `Authority` for "QA" and one for
// "build". This Note is intended to act strictly as a grouping mechanism for
// the attached Occurrences (Attestations). This grouping mechanism also
// provides a security boundary, since IAM ACLs gate the ability for a principle
// to attach an Occurrence to a given Note. It also provides a single point of
// lookup to find all attached Attestation Occurrences, even if they don't all
// live in the same project.
message Authority {
// This submessage provides human-readable hints about the purpose of the
// Authority. Because the name of a Note acts as its resource reference, it is
// important to disambiguate the canonical name of the Note (which might be a
// UUID for security purposes) from "readable" names more suitable for debug
// output. Note that these hints should NOT be used to look up authorities in
// security sensitive contexts, such as when looking up Attestations to
// verify.
message Hint {
// The human readable name of this Attestation Authority, for example "qa".
string human_readable_name = 1;
}
// Hint hints at the purpose of the attestation authority.
Hint hint = 1;
}
// Details of an attestation occurrence.
message Details {
// Attestation for the resource.
Attestation attestation = 1;
}
// Occurrence that represents a single "attestation". The authenticity of an
// Attestation can be verified using the attached signature. If the verifier
// trusts the public key of the signer, then verifying the signature is
// sufficient to establish trust. In this circumstance, the Authority to which
// this Attestation is attached is primarily useful for look-up (how to find
// this Attestation if you already know the Authority and artifact to be
// verified) and intent (which authority was this attestation intended to sign
// for).
message Attestation {
// The signature, generally over the `resource_url`, that verifies this
// attestation. The semantics of the signature veracity are ultimately
// determined by the verification engine.
oneof signature {
// A PGP signed attestation.
PgpSignedAttestation pgp_signed_attestation = 1;
}
}

View File

@ -0,0 +1,96 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.build;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/build;build";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.build";
option objc_class_prefix = "GRA";
import "google/devtools/containeranalysis/v1beta1/provenance/provenance.proto";
// Note holding the version of the provider's builder and the signature of the
// provenance message in linked BuildDetails.
message Build {
// 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 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`. In JSON, this is base-64
// encoded.
bytes 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;
// 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;
}
// The type of the key, either stored in `public_key` or referenced in
// `key_id`
KeyType key_type = 4;
}
// Details of a build occurrence.
message Details {
// The actual provenance for the build.
grafeas.v1beta1.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;
}

View File

@ -0,0 +1,50 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/common;common";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.common";
option objc_class_prefix = "GRA";
// Kind represents the kinds of notes supported.
enum NoteKind {
// Unknown.
NOTE_KIND_UNSPECIFIED = 0;
// The note and occurrence represent a package vulnerability.
VULNERABILITY = 1;
// The note and occurrence assert build provenance.
BUILD = 2;
// This represents an image basis relationship.
IMAGE = 3;
// This represents a package installed via a package manager.
PACKAGE = 4;
// The note and occurrence track deployment events.
DEPLOYMENT = 5;
// The note and occurrence track the initial discovery status of a resource.
DISCOVERY = 6;
// This represents a logical "role" that can attest to artifacts.
ATTESTATION = 7;
}
// Metadata for any related URL information.
message RelatedUrl {
// Specific URL associated with the resource.
string url = 1;
// Label to describe usage of the URL.
string label = 2;
}

View File

@ -0,0 +1,186 @@
// Copyright 2018 Google LLC
//
// 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.v1beta1;
import "google/api/annotations.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1;containeranalysis";
option java_multiple_files = true;
option java_package = "com.google.containeranalysis.v1beta1";
option objc_class_prefix = "GCA";
// Retrieves analysis results of Cloud components such as Docker container
// images. The Container Analysis API is an implementation of the
// [Grafeas](grafeas.io) API.
//
// Analysis results are stored as a series of occurrences. An `Occurrence`
// contains information about a specific analysis instance on a resource. An
// occurrence refers to a `Note`. A note contains details describing the
// analysis and is generally stored in a separate project, called a `Provider`.
// Multiple occurrences can refer to the same note.
//
// For example, an SSL vulnerability could affect multiple images. In this case,
// there would be one note for the vulnerability and an occurrence for each
// image with the vulnerability referring to that note.
service ContainerAnalysisV1Beta1 {
// 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.
//
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
// occurrences.
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v1beta1/{resource=projects/*/notes/*}:setIamPolicy"
body: "*"
additional_bindings {
post: "/v1beta1/{resource=projects/*/occurrences/*}: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.
//
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
// occurrences.
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v1beta1/{resource=projects/*/notes/*}:getIamPolicy"
body: "*"
additional_bindings {
post: "/v1beta1/{resource=projects/*/occurrences/*}:getIamPolicy"
body: "*"
}
};
}
// Returns the permissions that a caller has on the specified note or
// occurrence. Requires list permission on the project (for example,
// `containeranalysis.notes.list`).
//
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
// occurrences.
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = {
post: "/v1beta1/{resource=projects/*/notes/*}:testIamPermissions"
body: "*"
additional_bindings {
post: "/v1beta1/{resource=projects/*/occurrences/*}:testIamPermissions"
body: "*"
}
};
}
// Gets the specified scan configuration.
rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/scanConfigs/*}"
};
}
// Lists scan configurations for the specified project.
rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*}/scanConfigs"
};
}
// Updates the specified scan configuration.
rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) {
option (google.api.http) = {
put: "/v1beta1/{name=projects/*/scanConfigs/*}"
body: "scan_config"
};
}
}
// A scan configuration specifies whether Cloud components in a project have a
// particular type of analysis being run. For example, it can configure whether
// vulnerability scanning is being done on Docker images or not.
message ScanConfig {
// Output only. The name of the scan configuration in the form of
// `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
string name = 1;
// Output only. A human-readable description of what the scan configuration
// does.
string description = 2;
// Whether the scan is enabled.
bool enabled = 3;
// Output only. The time this scan config was created.
google.protobuf.Timestamp create_time = 4;
// Output only. The time this scan config was last updated.
google.protobuf.Timestamp update_time = 5;
}
// Request to get a scan configuration.
message GetScanConfigRequest {
// The name of the scan configuration in the form of
// `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
string name = 1;
}
// Request to list scan configurations.
message ListScanConfigsRequest {
// The name of the project to list scan configurations for in the form of
// `projects/[PROJECT_ID]`.
string parent = 1;
// The filter expression.
string filter = 2;
// The number of scan configs 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 for listing scan configurations.
message ListScanConfigsResponse {
// The scan configurations requested.
repeated ScanConfig scan_configs = 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;
}
// A request to update a scan configuration.
message UpdateScanConfigRequest {
// The name of the scan configuration in the form of
// `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
string name = 1;
// The updated scan configuration.
ScanConfig scan_config = 2;
}

View File

@ -0,0 +1,74 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.deployment;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/deployment;deployment";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.deployment";
option objc_class_prefix = "GRA";
import "google/protobuf/timestamp.proto";
// An artifact that can be deployed in some runtime.
message Deployable {
// Resource URI for the artifact being deployed.
repeated string resource_uri = 1;
}
// Details of a deployment occurrence.
message Details {
// Deployment history for the resource.
Deployment deployment = 1;
}
// The period during which some deployable was active in a runtime.
message Deployment {
// 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 = 4;
// 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;
// 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;
}
// Platform hosting this deployment.
Platform platform = 7;
// next_id = 8;
}

View File

@ -0,0 +1,85 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.discovery;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/discovery;discovery";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.discovery";
option objc_class_prefix = "GRA";
import "google/devtools/containeranalysis/v1beta1/common/common.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
// 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.
message Discovery {
// The kind of analysis that is handled by this discovery.
grafeas.v1beta1.NoteKind analysis_kind = 1;
}
// Details of a discovery occurrence.
message Details {
// Analysis status for the discovered resource.
Discovered discovered = 1;
}
// Provides information about the analysis status of a discovered resource.
message Discovered {
// Whether the resource is continuously analyzed.
enum ContinuousAnalysis {
// Unknown.
CONTINUOUS_ANALYSIS_UNSPECIFIED = 0;
// The resource is continuously analyzed.
ACTIVE = 1;
// The resource is ignored for continuous analysis.
INACTIVE = 2;
}
// Whether the resource is continuously analyzed.
ContinuousAnalysis continuous_analysis = 1;
// The last time continuous analysis was done for this resource.
google.protobuf.Timestamp last_analysis_time = 2;
// Analysis status for a resource. Currently for initial analysis only (not
// updated in continuous analysis).
enum AnalysisStatus {
// Unknown.
ANALYSIS_STATUS_UNSPECIFIED = 0;
// Resource is known but no action has been taken yet.
PENDING = 1;
// Resource is being analyzed.
SCANNING = 2;
// Analysis has finished successfully.
FINISHED_SUCCESS = 3;
// Analysis has finished unsuccessfully, the analysis itself is in a bad
// state.
FINISHED_FAILED = 4;
// The resource is known not to be supported
FINISHED_UNSUPPORTED = 5;
}
// The status of discovery for the resource.
AnalysisStatus analysis_status = 3;
// When an error is encountered this will contain a LocalizedMessage under
// details to show to the user. The LocalizedMessage is output only and
// populated by the API.
google.rpc.Status analysis_status_error = 4;
}

View File

@ -0,0 +1,502 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/grafeas;grafeas";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1";
option objc_class_prefix = "GRA";
import "google/api/annotations.proto";
import "google/devtools/containeranalysis/v1beta1/attestation/attestation.proto";
import "google/devtools/containeranalysis/v1beta1/build/build.proto";
import "google/devtools/containeranalysis/v1beta1/common/common.proto";
import "google/devtools/containeranalysis/v1beta1/deployment/deployment.proto";
import "google/devtools/containeranalysis/v1beta1/discovery/discovery.proto";
import "google/devtools/containeranalysis/v1beta1/image/image.proto";
import "google/devtools/containeranalysis/v1beta1/package/package.proto";
import "google/devtools/containeranalysis/v1beta1/provenance/provenance.proto";
import "google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
// [Grafeas](grafeas.io) API.
//
// Retrieves analysis results of Cloud components such as Docker container
// images.
//
// Analysis results are stored as a series of occurrences. An `Occurrence`
// contains information about a specific analysis instance on a resource. An
// occurrence refers to a `Note`. A note contains details describing the
// analysis and is generally stored in a separate project, called a `Provider`.
// Multiple occurrences can refer to the same note.
//
// For example, an SSL vulnerability could affect multiple images. In this case,
// there would be one note for the vulnerability and an occurrence for each
// image with the vulnerability referring to that note.
service GrafeasV1Beta1 {
// Gets the specified occurrence.
rpc GetOccurrence(GetOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/occurrences/*}"
};
};
// Lists occurrences for the specified project.
rpc ListOccurrences(ListOccurrencesRequest)
returns (ListOccurrencesResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*}/occurrences"
};
};
// Deletes the specified occurrence. For example, use this method to delete an
// occurrence when the occurrence is no longer applicable for the given
// resource.
rpc DeleteOccurrence(DeleteOccurrenceRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/occurrences/*}"
};
};
// Creates a new occurrence.
rpc CreateOccurrence(CreateOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*}/occurrences"
body: "occurrence"
};
};
// Creates new occurrences in batch.
rpc BatchCreateOccurrences(BatchCreateOccurrencesRequest)
returns (BatchCreateOccurrencesResponse) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*}/occurrences:batchCreate"
body: "*"
};
};
// Updates the specified occurrence.
rpc UpdateOccurrence(UpdateOccurrenceRequest) returns (Occurrence) {
option (google.api.http) = {
patch: "/v1beta1/{name=projects/*/occurrences/*}"
body: "occurrence"
};
};
// Gets the note attached to the specified occurrence. Consumer projects can
// use this method to get a note that belongs to a provider project.
rpc GetOccurrenceNote(GetOccurrenceNoteRequest) returns (Note) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/occurrences/*}/notes"
};
};
// Gets the specified note.
rpc GetNote(GetNoteRequest) returns (Note) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/notes/*}"
};
};
// Lists notes for the specified project.
rpc ListNotes(ListNotesRequest) returns (ListNotesResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*}/notes"
};
};
// Deletes the specified note.
rpc DeleteNote(DeleteNoteRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/notes/*}"
};
};
// Creates a new note.
rpc CreateNote(CreateNoteRequest) returns (Note) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*}/notes"
body: "note"
};
};
// Creates new notes in batch.
rpc BatchCreateNotes(BatchCreateNotesRequest)
returns (BatchCreateNotesResponse) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*}/notes:batchCreate"
body: "*"
};
};
// Updates the specified note.
rpc UpdateNote(UpdateNoteRequest) returns (Note) {
option (google.api.http) = {
patch: "/v1beta1/{name=projects/*/notes/*}"
body: "note"
};
};
// Lists occurrences referencing the specified note. Provider projects can use
// this method to get all occurrences across consumer projects referencing the
// specified note.
rpc ListNoteOccurrences(ListNoteOccurrencesRequest)
returns (ListNoteOccurrencesResponse) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/notes/*}/occurrences"
};
};
// Gets a summary of the number and severity of occurrences.
rpc GetVulnerabilityOccurrencesSummary(
GetVulnerabilityOccurrencesSummaryRequest)
returns (VulnerabilityOccurrencesSummary) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*}/occurrences:vulnerabilitySummary"
};
};
};
// An instance of an analysis type that has been found on a resource.
message Occurrence {
// Output only. The name of the occurrence in the form of
// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
string name = 1;
// Required. Immutable. The resource for which the occurrence applies.
Resource resource = 2;
// Required. Immutable. The analysis note associated with this occurrence, in
// the form of `projects[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.
grafeas.v1beta1.NoteKind kind = 4;
// 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 = 6;
// Output only. The time this occurrence was last updated.
google.protobuf.Timestamp update_time = 7;
// Required. Immutable. Describes the details of the note kind found on this
// resource.
oneof details {
// Describes a security vulnerability.
grafeas.v1beta1.vulnerability.Details vulnerability = 8;
// Describes a verifiable build.
grafeas.v1beta1.build.Details build = 9;
// Describes how this resource derives from the basis in the associated
// note.
grafeas.v1beta1.image.Details derived_image = 10;
// Describes the installation of a package on the linked resource.
grafeas.v1beta1.package.Details installation = 11;
// Describes the deployment of an artifact on a runtime.
grafeas.v1beta1.deployment.Details deployment = 12;
// Describes when a resource was discovered.
grafeas.v1beta1.discovery.Details discovered = 13;
// Describes an attestation of an artifact.
grafeas.v1beta1.attestation.Details attestation = 14;
}
// next_id = 15;
}
// An entity that can have metadata. For example, a Docker image.
message Resource {
// The name of the resource. For example, the name of a Docker image -
// "Debian".
string name = 1;
// The unique URI of the resource. For example,
// `https://gcr.io/project/image@sha256:foo` for a Docker image.
string uri = 2;
// The hash of the resource content. For example, the Docker digest.
grafeas.v1beta1.provenance.Hash content_hash = 3;
// next_id = 4;
}
// A type of analysis that can be done for a resource.
message Note {
// Output only. The name of the note in the form of
// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
string name = 1;
// A one sentence description of this note.
string short_description = 2;
// A detailed description of this note.
string long_description = 3;
// Output only. The type of analysis. This field can be used as a filter in
// list requests.
grafeas.v1beta1.NoteKind kind = 4;
// URLs associated with this note.
repeated grafeas.v1beta1.RelatedUrl related_url = 5;
// Time of expiration for this note. Empty if note does not expire.
google.protobuf.Timestamp expiration_time = 6;
// Output only. The time this note was created. This field can be used as a
// filter in list requests.
google.protobuf.Timestamp create_time = 7;
// 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 = 8;
// Other notes related to this note.
repeated string related_note_names = 9;
// Required. Immutable. The type of analysis this note represents.
oneof type {
// A note describing a package vulnerability.
grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10;
// A note describing build provenance for a verifiable build.
grafeas.v1beta1.build.Build build = 11;
// A note describing a base image.
grafeas.v1beta1.image.Basis base_image = 12;
// A note describing a package hosted by various package managers.
grafeas.v1beta1.package.Package package = 13;
// A note describing something that can be deployed.
grafeas.v1beta1.deployment.Deployable deployable = 14;
// A note describing the initial analysis of a resource.
grafeas.v1beta1.discovery.Discovery discovery = 15;
// A note describing an attestation role.
grafeas.v1beta1.attestation.Authority attestation_authority = 16;
}
// next_id = 17;
}
// Request to get an occurrence.
message GetOccurrenceRequest {
// The name of the occurrence in the form of
// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
string name = 1;
}
// Request to list occurrences.
message ListOccurrencesRequest {
// The name of the project to list occurrences for in the form of
// `projects/[PROJECT_ID]`.
string parent = 1;
// 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;
// next_id = 7;
}
// Response for listing 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 create a new occurrence.
message CreateOccurrenceRequest {
// The name of the project in the form of `projects/[PROJECT_ID]`, under which
// the occurrence is to be created.
string parent = 1;
// The occurrence to create.
Occurrence occurrence = 2;
}
// Request to update an occurrence.
message UpdateOccurrenceRequest {
// The name of the occurrence in the form of
// `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
// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
string name = 1;
}
// Request to get the note to which the specified occurrence is attached.
message GetOccurrenceNoteRequest {
// The name of the occurrence in the form of
// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
string name = 1;
}
// Request to list notes.
message ListNotesRequest {
// The name of the project to list notes for in the form of
// `projects/[PROJECT_ID]`.
string parent = 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 for listing notes.
message ListNotesResponse {
// The notes 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
// results.
string next_page_token = 2;
}
// Request to delete a note.
message DeleteNoteRequest {
// The name of the note in the form of
// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
string name = 1;
}
// Request to create a new note.
message CreateNoteRequest {
// The name of the project in the form of `projects/[PROJECT_ID]`, under which
// the note is to be created.
string parent = 1;
// The ID to use for this note.
string note_id = 2;
// The note to create.
Note note = 3;
}
// Request to update a note.
message UpdateNoteRequest {
// The name of the note in the form of
// `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 for a note.
message ListNoteOccurrencesRequest {
// The name of the note to list occurrences for in the form of
// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
string name = 1;
// 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 for listing occurrences for a note.
message ListNoteOccurrencesResponse {
// The occurrences attached to the specified note.
repeated Occurrence occurrences = 1;
// Token to provide to skip to a particular spot in the list.
string next_page_token = 2;
}
// Request to create notes in batch.
message BatchCreateNotesRequest {
// The name of the project in the form of `projects/[PROJECT_ID]`, under which
// the notes are to be created.
string parent = 1;
// The notes to create.
map<string, Note> notes = 2;
}
// Response for creating notes in batch.
message BatchCreateNotesResponse {
// The notes that were created.
repeated Note notes = 1;
}
// Request to create occurrences in batch.
message BatchCreateOccurrencesRequest {
// The name of the project in the form of `projects/[PROJECT_ID]`, under which
// the occurrences are to be created.
string parent = 1;
// The occurrences to create.
repeated Occurrence occurrences = 2;
}
// Response for creating occurrences in batch.
message BatchCreateOccurrencesResponse {
// The occurrences that were created.
repeated Occurrence occurrences = 1;
}
// Request to get a vulnerability summary for some set of occurrences.
message GetVulnerabilityOccurrencesSummaryRequest {
// The name of the project to get a vulnerability summary for in the form of
// `projects/[PROJECT_ID]`.
string parent = 1;
// The filter expression.
string filter = 2;
}
// A summary of how many vulnerability occurrences there are per resource and
// severity type.
message VulnerabilityOccurrencesSummary {
// A listing by resource of the number of fixable and total vulnerabilities.
repeated FixableTotalByDigest counts = 1;
// Per resource and severity counts of fixable and total vulnerabilites.
message FixableTotalByDigest {
// The affected resource.
Resource resource = 1;
// The severity for this count. SEVERITY_UNSPECIFIED indicates total across
// all severities.
grafeas.v1beta1.vulnerability.Severity severity = 2;
// The number of fixable vulnerabilities associated with this resource.
int64 fixable_count = 3;
// The total number of vulnerabilities associated with this resource.
int64 total_count = 4;
}
}

View File

@ -0,0 +1,144 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.image;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/image;image";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.image";
option objc_class_prefix = "GRA";
// 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.
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.
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;
}
// Details of an image occurrence.
message Details {
// The child image derived from the base image.
Derived derived_image = 1;
}
// 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.
int32 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,127 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.package;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/package;package";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.pkg";
option objc_class_prefix = "GRA";
// Instruction set architectures supported by various package managers.
enum Architecture {
// Unknown architecture.
ARCHITECTURE_UNSPECIFIED = 0;
// X86 architecture.
X86 = 1;
// X64 architecture.
X64 = 2;
}
// 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.
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 = 5;
// The distribution channel-specific description of this package.
string description = 6;
}
// 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.
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;
}
// Details of a package occurrence.
message Details {
// Where the package was installed.
Installation installation = 1;
}
// 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;
}
// Version contains structured information about the version of a package.
message Version {
// 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;
// Whether this is an ordinary package version or a sentinel MIN/MAX version.
enum VersionKind {
// Unknown.
VERSION_KIND_UNSPECIFIED = 0;
// A standard package version, defined by the other fields.
NORMAL = 1;
// A special version representing negative infinity, other fields are
// ignored.
MINIMUM = 2;
// A special version representing positive infinity, other fields are
// ignored.
MAXIMUM = 3;
};
// Distinguish between sentinel MIN/MAX versions and normal versions. If
// kind is not NORMAL, then the other fields are ignored.
VersionKind kind = 4;
}

View File

@ -0,0 +1,164 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.provenance;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/provenance;provenance";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.provenance";
option objc_class_prefix = "GRA";
import "google/protobuf/timestamp.proto";
import "google/devtools/containeranalysis/v1beta1/source/source.proto";
// 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 = 3;
// Output of the build.
repeated Artifact built_artifacts = 4;
// Time at which the build was created.
google.protobuf.Timestamp create_time = 5;
// Time at which execution of the build was started.
google.protobuf.Timestamp start_time = 6;
// Time at which execution of the build was finished.
google.protobuf.Timestamp end_time = 7;
// 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 = 8;
// URI where any logs for this provenance were written.
string logs_uri = 9;
// Details of the Source input to the build.
Source source_provenance = 10;
// Trigger identifier if the build was triggered automatically; empty if not.
string trigger_id = 11;
// 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 = 12;
// Version string of the builder at the time this build was executed.
string builder_version = 13;
// next_id = 14
}
// Source describes the location of the source used for the build.
message Source {
// If provided, the input binary artifacts for the build came from this
// location.
string artifact_storage_source_uri = 1;
// 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 = 2;
// If provided, the source code used for the build came from this location.
grafeas.v1beta1.source.SourceContext context = 3;
// 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 grafeas.v1beta1.source.SourceContext additional_contexts = 4;
}
// 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 {
// Unknown.
HASH_TYPE_UNSPECIFIED = 0;
// A SHA-256 hash.
SHA256 = 1;
}
// The type of hash that was performed.
HashType type = 1;
// The hash value.
bytes value = 2;
}
// 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 {
// Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
// container.
string checksum = 1;
// Artifact ID, if any; for container images, this will be a URL by digest
// like `gcr.io/projectID/imagename@sha256:123456`.
string id = 2;
// 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 = 3;
}

View File

@ -0,0 +1,134 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.source;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/source;source";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.source";
option objc_class_prefix = "GRA";
// 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;
// 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,145 @@
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// 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 grafeas.v1beta1.vulnerability;
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/vulnerability;vulnerability";
option java_multiple_files = true;
option java_package = "io.grafeas.v1beta1.vulnerability";
option objc_class_prefix = "GRA";
import "google/devtools/containeranalysis/v1beta1/common/common.proto";
import "google/devtools/containeranalysis/v1beta1/package/package.proto";
// Note provider-assigned severity/impact ranking.
enum Severity {
// Unknown.
SEVERITY_UNSPECIFIED = 0;
// Minimal severity.
MINIMAL = 1;
// Low severity.
LOW = 2;
// Medium severity.
MEDIUM = 3;
// High severity.
HIGH = 4;
// Critical severity.
CRITICAL = 5;
}
// Vulnerability provides metadata about a security vulnerability.
message Vulnerability {
// The CVSS score for this vulnerability.
float cvss_score = 1;
// Note provider assigned impact of the vulnerability.
Severity severity = 2;
// 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 = 3;
// 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.
string cpe_uri = 1;
// The name of the package where the vulnerability was found.
string package = 2;
// The min version of the package in which the vulnerability exists.
grafeas.v1beta1.package.Version min_affected_version = 3;
// The max version of the package in which the vulnerability exists.
grafeas.v1beta1.package.Version max_affected_version = 4;
// The severity (eg: distro assigned severity) for this vulnerability.
string severity_name = 5;
// A vendor-specific description of this note.
string description = 6;
// The fix for this specific package version.
VulnerabilityLocation fixed_location = 7;
// The type of package; whether native or non native(ruby gems, node.js
// packages etc).
string package_type = 8;
// Whether this detail is obsolete. Occurrences are expected not to point to
// obsolete details.
bool is_obsolete = 9;
}
}
// Details of a vulnerability occurrence.
message Details {
// The type of package; whether native or non native(ruby gems, node.js
// packages etc)
string type = 1;
// Output only. The note provider assigned Severity of the vulnerability.
Severity severity = 2;
// 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 = 3;
// The set of affected locations and their fixes (if available) within the
// associated resource.
repeated PackageIssue package_issue = 4;
// Output only. A one sentence description of this vulnerability.
string short_description = 5;
// Output only. A detailed description of this vulnerability.
string long_description = 6;
// Output only. URLs related to this vulnerability.
repeated grafeas.v1beta1.RelatedUrl related_urls = 7;
}
// 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 (e.g., 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.
string cpe_uri = 1;
// The package being described.
string package = 2;
// The version of the package being described.
grafeas.v1beta1.package.Version version = 3;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,354 @@
// Copyright 2018 Google LLC
//
// 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/devtools/remoteworkers/v1test2/worker.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersBots";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Design doc: https://goo.gl/oojM5H
//
// 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 {
// A short string uniquely identifing the lease within this bot session.
string id = 7;
// The actual work to be performed, if any. May be omitted by the server if
// the lease is not in the `PENDING` state. The message must be meaningful to
// the bot. Output only (must only be set by the server).
google.protobuf.Any payload = 8;
// Any result the bot wishes to provide about the lease. Must not be changed
// after the first call with the lease in the `COMPLETED` or `CANCELLED`
// state. Input only (must only be set by the bot, will not be echoed by the
// server).
google.protobuf.Any result = 9;
// 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
// communicated via the `result` field.
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;
// DEPRECATED. The assignment should be provided to the bot via the `payload`
// field. Clients that wish to use a simple name (such as a queue of work
// provided elsewhere) should define a custom message type and encode it into
// `payload`.
string assignment = 1 [deprecated = true];
// DEPRECATED. Use `payload` instead.
google.protobuf.Any inline_assignment = 6 [deprecated = true];
}
// 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,257 @@
// Copyright 2018 Google LLC
//
// 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/any.proto";
import "google/protobuf/duration.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersCommands";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Describes a shell-style task to execute, suitable for providing as the Bots
// interface's `Lease.payload` field.
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).
//
// This field should be passed directly to the underlying operating system,
// and so it must be sensible to that operating system. For example, on
// Windows, the first argument might be "C:\Windows\System32\ping.exe" -
// that is, using drive letters and backslashes. A command for a *nix
// system, on the other hand, would use forward slashes.
//
// All other fields in the RWAPI must consistently use forward slashes,
// since those fields may be interpretted by both the service and the bot.
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. All paths
// MUST be delimited by forward slashes.
repeated string files = 1;
// A list of expected directories, relative to the execution root. All paths
// MUST be delimited by forward slashes.
repeated string directories = 2;
// The destination to which any stdout should be sent. The method by which
// the bot should send the stream contents to that destination is not
// defined in this API. As examples, the destination could be a file
// referenced in the `files` field in this message, or it could be a URI
// that must be written via the ByteStream API.
string stdout_destination = 3;
// The destination to which any stderr should be sent. The method by which
// the bot should send the stream contents to that destination is not
// defined in this API. As examples, the destination could be a file
// referenced in the `files` field in this message, or it could be a URI
// that must be written via the ByteStream API.
string stderr_destination = 4;
}
// 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;
}
// DEPRECATED - use CommandResult instead.
// 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;
}
// DEPRECATED - use CommandResult instead.
// 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;
}
// All information about the execution of a command, suitable for providing as
// the Bots interface's `Lease.result` field.
message CommandResult {
// An overall status for the command. For example, if the command timed out,
// this might have a code of DEADLINE_EXCEEDED; if it was killed by the OS for
// memory exhaustion, it might have a code of RESOURCE_EXHAUSTED.
google.rpc.Status status = 1;
// The exit code of the process. An exit code of "0" should only be trusted if
// `status` has a code of OK (otherwise it may simply be unset).
int32 exit_code = 2;
// 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 = 3;
// 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 = 4 [deprecated = true];
// The amount of time *not* spent executing the command (ie
// uploading/downloading files).
google.protobuf.Duration overhead = 5 [deprecated = true];
// Implementation-dependent statistics about the task. Both servers and bots
// may define messages which can be encoded here; bots are free to provide
// statistics in multiple formats, and servers are free to choose one or more
// of the values to process and ignore others. In particular, it is *not*
// considered an error for the bot to provide the server with a field that it
// doesn't know about.
repeated google.protobuf.Any statistics = 6;
}
// 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
// CommandOutputs.outputs 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. All paths MUST be delimited by forward slashes.
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;
}
// The CommandTask and CommandResult messages assume the existence of a service
// that can serve blobs of content, identified by a hash and size known as a
// "digest." The method by which these blobs may be retrieved is not specified
// here, but a model implementation is in the Remote Execution API's
// "ContentAddressibleStorage" interface.
//
// In the context of the RWAPI, a Digest will virtually always refer to the
// contents of a file or a directory. The latter is represented by the
// byte-encoded Directory message.
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,161 @@
// Copyright 2018 Google LLC
//
// 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 csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersTasks";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// DEPRECATED. GetTask should be replaced by Lease.payload, UpdateTaskResult by
// Lease.result and logs should be precreated prior to sending to the bot (eg,
// via CommandTask.expected_outputs.stdout_destination).
service Tasks {
// DEPRECATED - use Lease.payload instead.
// 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/*}"
};
}
// DEPRECATED - use Lease.result instead.
// UpdateTaskResult updates the result.
rpc UpdateTaskResult(UpdateTaskResultRequest) returns (TaskResult) {
option (google.api.http) = {
patch: "/v1test2/{name=**/tasks/*/result}"
body: "result"
};
}
// DEPRECATED - precreate logs prior to sending to bot.
// 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: "*"
};
}
}
// DEPRECATED - use Lease.payload instead.
// 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;
}
// DEPRECATED - use Lease.assignment_result instead.
// 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,175 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.devtools.remoteworkers.v1test2;
option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2";
option go_package = "google.golang.org/genproto/googleapis/devtools/remoteworkers/v1test2;remoteworkers";
option java_multiple_files = true;
option java_outer_classname = "RemoteWorkersWorker";
option java_package = "com.google.devtools.remoteworkers.v1test2";
option objc_class_prefix = "RW";
// Describes a worker, which is a list of one or more devices and the
// connections between them. A device could be a computer, a phone, or even an
// accelerator like a GPU; it's up to the farm administrator to decide how to
// model their farm. For example, if a farm only has one type of GPU, the GPU
// could be modelled as a "has_gpu" property on its host computer; if it has
// many subproperties itself, it might be better to model it as a separate
// device.
//
// The first device in the worker is the "primary device" - that is, the device
// running a bot and which is responsible for actually executing commands. All
// other devices are considered to be attached devices, and must be controllable
// by the primary device.
//
// This message (and all its submessages) can be used in two contexts:
//
// * Status: sent by the bot to report the current capabilities of the device to
// allow reservation matching.
// * Request: sent by a client to request a device with certain capabilities in
// a reservation.
//
// Several of the fields in this message have different semantics depending on
// which of which of these contexts it is used. These semantics are described
// below.
//
// Several messages in Worker and its submessages have the concept of keys and
// values, such as `Worker.Property` and `Device.Property`. All keys are simple
// strings, but certain keys are "standard" keys and should be broadly supported
// across farms and implementations; these are listed below each relevant
// message. Bot implementations or farm admins may add *additional* keys, but
// these SHOULD all begin with an underscore so they do not conflict with
// standard keys that may be added in the future.
//
// Keys are not context sensitive.
//
// See http://goo.gl/NurY8g for more information on the Worker message.
message Worker {
// A global property; see the `properties` field for more information.
message Property {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * pool: different workers can be reserved for different purposes. For
// example, an admin might want to segregate long-running integration tests
// from short-running unit tests, so unit tests will always get some
// throughput. To support this, the server can assign different values for
// `pool` (such as "itest" and "utest") to different workers, and then have
// jobs request workers from those pools.
string key = 1;
// The property's value.
string value = 2;
}
// A configuration request or report; see the `configs` field for more
// information.
message Config {
// For general information on keys, see the documentation to `Worker`.
//
// The current set of standard keys are:
//
// * DockerImage: the image of the container. When being reported by the
// bot, the empty value should always be included if the bot is able to pull
// its own images; the bot may optionally *also* report images that are
// present in its cache. When being requested in a lease, the value is the
// URI of the image (eg `gcr.io/user/image@sha256:hash`).
string key = 1;
// The configuration'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;
// Bots can be configured in certain ways when accepting leases. For example,
// many leases are executed inside a Docker container. To support this, the
// bot needs to be able to report that it has Docker installed (and knows how
// to execute something inside a container), and the task submitter needs to
// specify which image should be used to start the container. Similarly, a
// lease may be able to run as one of several users on the worker; in such
// cases, the bot needs to report what users are available, and the submitter
// needs to choose one.
//
// Therefore, when this message is reported by the bot to the service, each
// key represents a *type* of configuration that the bot knows how to set,
// while each *value* represents a legal value for that configuration (the
// empty string is interpretted as a wildcard, such as for Docker images).
// When this message is sent by the server to the bot in the context of a
// lease, it represents a command to the bot to apply the setting. Keys may
// be repeated during reporting but not in a lease.
repeated Config configs = 3;
}
// 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;
}

View File

@ -0,0 +1,381 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/coverage.proto";
import "google/devtools/resultstore/v2/file.proto";
import "google/devtools/resultstore/v2/test_suite.proto";
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// An action that happened as part of a configured target. This action could be
// a build, a test, or another type of action.
// Each parent ConfiguredTarget resource should have at least one Action as its
// child resource before the invocation is finalized. ResultStore is a tool to
// store build & test results. ConfiguredTarget proto by itself does not contain
// enough fields to fully represent such results. For a simple build, at least
// one build action is required to represent the build result.
message Action {
// The resource ID components that identify the Action.
message Id {
// The Invocation ID.
string invocation_id = 1;
// The Target ID.
string target_id = 2;
// The Configuration ID.
string configuration_id = 3;
// The Action ID.
string action_id = 4;
}
// The resource name. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}/actions/${ACTION_ID}
string name = 1;
// The resource ID components that identify the Action. They must match the
// resource name after proper encoding.
Id id = 2;
// The status of the action.
StatusAttributes status_attributes = 3;
// The timing of the whole action. For TestActions, the start time may be
// before the test actually started, and the duration may last until after the
// test actually finished.
Timing timing = 4;
// The type of the action. The type of an action may not change over the
// lifetime of the invocation. If one of these fields is to be set, it must be
// set in the CreateAction method. It may be set to an empty message that is
// populated in later methods or post-processing. A generic "untyped" action
// can be created by not setting any of these fields. An untyped action will
// be untyped for the lifetime of the invocation.
oneof action_type {
// Used only when this action represents a build action.
BuildAction build_action = 9;
// Only for test actions.
TestAction test_action = 10;
}
// General attributes of the action.
ActionAttributes action_attributes = 5;
// A list of resources that this action depended upon. May be used to provide
// the cause of a build failure in the case of a failed build action.
repeated Dependency action_dependencies = 14;
// Arbitrary name-value pairs.
// This is implemented as a multi-map. Multiple properties are allowed with
// the same key. Properties will be returned in lexicographical order by key.
repeated Property properties = 7;
// A list of file references for action level files.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
// Files with the following reserved file IDs cause specific post-processing
// or have special handling:
//
// For build actions:
// stdout: The stdout of the action
// stderr: The stderr of the action
// baseline.lcov: Baseline coverage file to be parsed by the server. This
// uses a stripped down implementation of the LCOV standard.
// http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
//
// For test actions:
// test.xml: The test suite / test case data in XML format.
// test.log: The combined stdout and stderr of the test process.
// test.lcov: Coverage file to be parsed by the server. This uses a stripped
// down implementation of the LCOV standard.
// http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
repeated File files = 8;
// Coverage data was collected while running the build or test action. This
// usually includes line coverage, and may also include branch coverage.
// For test actions, this is usually only for the source files which were
// actually executed by that particular action.
// For build actions, this is the baseline coverage, which captures the
// instrumented files and lines, without any lines being executed. This
// ensures files that are never covered at all are included.
ActionCoverage coverage = 11;
// ResultStore will read and parse Files with reserved IDs listed above. Read
// and parse errors for all these Files are reported here.
// This is implemented as a map, with one FileProcessingErrors for each file.
// Typically produced when parsing Files, but may also be provided directly
// by clients.
repeated FileProcessingErrors file_processing_errors = 13;
}
// A build action, such as building a java library.
message BuildAction {
// The type of the action. This is intended to be a clue as to how the output
// of the action should be parsed. For example "javac" for a Java compile
// action.
string type = 1;
// The "primary" input artifact processed by this action. E.g., the .cc file
// of a C++ compile action. Empty string ("") if the action has no input
// artifacts or no "primary" input artifact.
string primary_input_path = 2;
// The "primary" output artifact processed by this action. E.g., the .o file
// of a C++ compile action. Empty string ("") if the action has no output
// artifacts or no "primary" output artifact.
string primary_output_path = 3;
}
// A test action, such as running a JUnit4 test binary.
message TestAction {
// Timing data for execution of the test action.
TestTiming test_timing = 1;
// If the test is divided up into shards to improve performance, set this to
// indicate which shard this test action is for. Value must be in interval
// [0, total_shard_count). Defaults to 0, which is appropriate if all test
// cases are run in the same process.
int32 shard_number = 2;
// If the user requested that every test be run multiple times, as is often
// done to measure flakiness, set this to indicate which run this test action
// is for. Value must be in interval [0, total_run_count). Defaults to 0,
// which is appropriate if multiple runs were not requested.
int32 run_number = 3;
// If flaky tests are automatically retried, set this to indicate which
// attempt this test action is for. (e.g. 0 for the first attempt, 1 for
// second, and so on). Defaults to 0, which is appropriate if this is only
// attempt.
int32 attempt_number = 4;
// A tree of test suites and test cases that were run by this test action.
// Each test case has its own status information, including stack traces.
// Typically produced by parsing an XML Log, but may also be provided directly
// by clients.
TestSuite test_suite = 5;
// Warnings for this test action.
repeated TestWarning warnings = 8;
// Estimated memory consumption of the test action, in bytes. A default value
// of 0 means there is no memory consumption estimate specified.
int64 estimated_memory_bytes = 10;
}
// General attributes of an action
message ActionAttributes {
// Strategy used for executing the action.
ExecutionStrategy execution_strategy = 1;
// Exit code of the process that ran the action. A non-zero value means
// failure.
int32 exit_code = 2;
// Where the action was run.
string hostname = 3;
// Information about the input files used in all actions under this configured
// target.
InputFileInfo input_file_info = 4;
}
// File count and size information for the input files to a configured target.
message InputFileInfo {
// The number of input files (counting every file, even if a duplicate).
int64 count = 1;
// The number of distinct input files.
int64 distinct_count = 2;
// The max number of input files allowed by the build system (counting every
// file, even if a duplicate).
int64 count_limit = 3;
// The total size of the distinct input files.
int64 distinct_bytes = 4;
// The max allowed total size of the distinct input files.
int64 distinct_byte_limit = 5;
}
// Timing data for tests executed locally on the machine running the build.
message LocalTestTiming {
// Time taken by the test process, typically surrounded by a small wrapper
// script.
google.protobuf.Duration test_process_duration = 1;
}
// Timing data for one attempt to execute a test action remotely.
message RemoteTestAttemptTiming {
// Idle period before the test process is invoked on the remote machine.
google.protobuf.Duration queue_duration = 1;
// Time to upload data dependencies from the local machine to the remote
// machine running the test, or to the distributed cache.
google.protobuf.Duration upload_duration = 2;
// Time to set up the remote machine.
// Not to be confused with setup time in
// xUnit test frameworks, which falls within the test_process_time.
google.protobuf.Duration machine_setup_duration = 3;
// Time taken by the test process, typically surrounded by a small wrapper
// script.
// For Java tests, this includes JVM setup, flag parsing, class path setup,
// parsing files to setup the suite, and finally running your test methods.
// In many cases, only a small fraction of the test process time is spent
// running the test methods.
google.protobuf.Duration test_process_duration = 4;
// Time spent retrieving test logs and any other test outputs, back to the
// local machine.
google.protobuf.Duration download_duration = 5;
}
// Timing data for the part of the test execution that is done remotely.
message RemoteTestTiming {
// Time taken locally to determine what to do.
google.protobuf.Duration local_analysis_duration = 1;
// Normally there is only one attempt, but the system may retry on internal
// errors, leading to multiple attempts.
repeated RemoteTestAttemptTiming attempts = 2;
}
// Timing data for execution of a test action. The action may be performed
// locally, on the machine running the build, or remotely.
message TestTiming {
// Test timing for either a local or remote execution.
oneof location {
// Used for local test actions.
LocalTestTiming local = 1;
// Used for remote test actions.
RemoteTestTiming remote = 2;
}
// The amount of CPU time spent by the test process executing system calls
// within the kernel, as opposed to library code. Time the test process spent
// blocked does not count towards this figure.
google.protobuf.Duration system_time_duration = 3;
// The amount of CPU time spent by the test process executing user-mode code
// outside the kernel, as opposed to library code. Time the test process
// spent blocked does not count towards this figure. You can add user_time to
// system_time to get total CPU time taken by the test process.
google.protobuf.Duration user_time_duration = 4;
// Most build systems cache build results to speed up incremental builds.
// Some also cache test results too. This indicates whether the test results
// were found in a cache, and where that cache was located.
TestCaching test_caching = 5;
}
// A warning from a test execution.
message TestWarning {
// Contains the message detailing the warning.
string warning_message = 1;
}
// Stores errors reading or parsing a file during post-processing.
message FileProcessingErrors {
// The uid of the File being read or parsed.
string file_uid = 1;
// What went wrong.
repeated FileProcessingError file_processing_errors = 3;
}
// Stores an error reading or parsing a file during post-processing.
message FileProcessingError {
// The type of error that occurred.
FileProcessingErrorType type = 1;
// Error message describing the problem.
string message = 2;
}
// Indicates how/where this Action was executed.
enum ExecutionStrategy {
// The action did not indicate how it was executed.
EXECUTION_STRATEGY_UNSPECIFIED = 0;
// The action was executed in some other form.
OTHER_ENVIRONMENT = 1;
// The action used a remote build service.
REMOTE_SERVICE = 2;
// The action was executed locally, in parallel with other actions.
LOCAL_PARALLEL = 3;
// The action was executed locally, without parallelism.
LOCAL_SEQUENTIAL = 4;
}
// Most build systems cache build results to speed up incremental builds.
// Some also cache test results too. This indicates whether the test results
// were found in a cache, and where that cache was located.
enum TestCaching {
// The implicit default enum value. Should never be set.
TEST_CACHING_UNSPECIFIED = 0;
// The test result was found in a local cache, so it wasn't run again.
LOCAL_CACHE_HIT = 1;
// The test result was found in a remote cache, so it wasn't run again.
REMOTE_CACHE_HIT = 2;
// The test result was not found in any cache, so it had to be run again.
CACHE_MISS = 3;
}
// Errors in file post-processing are categorized using this enum.
enum FileProcessingErrorType {
// Type unspecified or not listed here.
FILE_PROCESSING_ERROR_TYPE_UNSPECIFIED = 0;
// A read error occurred trying to read the file.
GENERIC_READ_ERROR = 1;
// There was an error trying to parse the file.
GENERIC_PARSE_ERROR = 2;
// File is exceeds size limit.
FILE_TOO_LARGE = 3;
// The result of parsing the file exceeded size limit.
OUTPUT_TOO_LARGE = 4;
// Read access to the file was denied by file system.
ACCESS_DENIED = 5;
// Deadline exceeded trying to read the file.
DEADLINE_EXCEEDED = 6;
// File not found.
NOT_FOUND = 7;
}

View File

@ -0,0 +1,205 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Describes the status of a resource in both enum and string form.
// Only use description when conveying additional info not captured in the enum
// name.
message StatusAttributes {
// Enum representation of the status.
Status status = 1;
// A longer description about the status.
string description = 2;
}
// A generic key-value property definition.
message Property {
// The key.
string key = 1;
// The value.
string value = 2;
}
// The timing of a particular Invocation, Action, etc. The start_time is
// specified, stop time can be calculated by adding duration to start_time.
message Timing {
// The time the resource started running. This is in UTC Epoch time.
google.protobuf.Timestamp start_time = 1;
// The duration for which the resource ran.
google.protobuf.Duration duration = 2;
}
// Represents a dependency of a resource on another resource. This can be used
// to define a graph or a workflow paradigm through resources.
message Dependency {
// The resource depended upon. It may be a Target, ConfiguredTarget, or
// Action.
oneof resource {
// The name of a target. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
// This must point to an target under the same invocation.
string target = 1;
// The name of a configured target. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
// This must point to an configured target under the same invocation.
string configured_target = 2;
// The name of an action. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}/actions/${ACTION_ID}
// This must point to an action under the same invocation.
string action = 3;
}
// A label describing this dependency.
// The label "Root Cause" is handled specially. It is used to point to the
// exact resource that caused a resource to fail.
string label = 4;
}
// These correspond to the prefix of the rule name. Eg cc_test has language CC.
enum Language {
// Language unspecified or not listed here.
LANGUAGE_UNSPECIFIED = 0;
// Not related to any particular language
NONE = 1;
// Android
ANDROID = 2;
// ActionScript (Flash)
AS = 3;
// C++ or C
CC = 4;
// Cascading-Style-Sheets
CSS = 5;
// Dart
DART = 6;
// Go
GO = 7;
// Google-Web-Toolkit
GWT = 8;
// Haskell
HASKELL = 9;
// Java
JAVA = 10;
// Javascript
JS = 11;
// Lisp
LISP = 12;
// Objective-C
OBJC = 13;
// Python
PY = 14;
// Shell (Typically Bash)
SH = 15;
// Swift
SWIFT = 16;
// Typescript
TS = 18;
// Webtesting
WEB = 19;
// Scala
SCALA = 20;
// Protocol Buffer
PROTO = 21;
}
// Status of a resource.
enum Status {
// The implicit default enum value. Should never be set.
STATUS_UNSPECIFIED = 0;
// Displays as "Building". Means the target is compiling, linking, etc.
BUILDING = 1;
// Displays as "Built". Means the target was built successfully.
// If testing was requested, it should never reach this status: it should go
// straight from BUILDING to TESTING.
BUILT = 2;
// Displays as "Broken". Means build failure such as compile error.
FAILED_TO_BUILD = 3;
// Displays as "Testing". Means the test is running.
TESTING = 4;
// Displays as "Passed". Means the test was run and passed.
PASSED = 5;
// Displays as "Failed". Means the test was run and failed.
FAILED = 6;
// Displays as "Timed out". Means the test didn't finish in time.
TIMED_OUT = 7;
// Displays as "Cancelled". Means the build or test was cancelled.
// E.g. User hit control-C.
CANCELLED = 8;
// Displays as "Tool Failed". Means the build or test had internal tool
// failure.
TOOL_FAILED = 9;
// Displays as "Incomplete". Means the build or test did not complete. This
// might happen when a build breakage or test failure causes the tool to stop
// trying to build anything more or run any more tests, with the default
// bazel --nokeep_going option or the --notest_keep_going option.
INCOMPLETE = 10;
// Displays as "Flaky". Means the aggregate status contains some runs that
// were successful, and some that were not.
FLAKY = 11;
// Displays as "Unknown". Means the tool uploading to the server died
// mid-upload or does not know the state.
UNKNOWN = 12;
// Displays as "Skipped". Means building and testing were skipped.
// (E.g. Restricted to a different configuration.)
SKIPPED = 13;
}

View File

@ -0,0 +1,66 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Represents a configuration within an Invocation associated with one or more
// ConfiguredTargets. It captures the environment and other settings that
// were used.
message Configuration {
// The resource ID components that identify the Configuration.
message Id {
// The Invocation ID.
string invocation_id = 1;
// The Configuration ID.
string configuration_id = 2;
}
// The format of this Configuration resource name must be:
// invocations/${INVOCATION_ID}/configs/${CONFIG_ID}
// The configuration ID of "default" should be preferred for the default
// configuration in a single-config invocation.
string name = 1;
// The resource ID components that identify the Configuration. They must match
// the resource name after proper encoding.
Id id = 2;
// The aggregate status for this configuration.
StatusAttributes status_attributes = 3;
// Attributes that apply only to this configuration.
ConfigurationAttributes configuration_attributes = 5;
// Arbitrary name-value pairs.
// This is implemented as a multi-map. Multiple properties are allowed with
// the same key. Properties will be returned in lexicographical order by key.
repeated Property properties = 6;
}
// Attributes that apply only to the configuration.
message ConfigurationAttributes {
// The type of cpu. (e.g. "x86", "powerpc")
string cpu = 1;
}

View File

@ -0,0 +1,90 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/file.proto";
import "google/protobuf/duration.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Each ConfiguredTarget represents data for a given configuration of a given
// target in a given Invocation.
// Every ConfiguredTarget should have at least one Action as a child resource
// before the invocation is finalized. Refer to the Action's documentation for
// more info on this.
message ConfiguredTarget {
// The resource ID components that identify the ConfiguredTarget.
message Id {
// The Invocation ID.
string invocation_id = 1;
// The Target ID.
string target_id = 2;
// The Configuration ID.
string configuration_id = 3;
}
// The resource name. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
// where ${CONFIG_ID} must match the ID of an existing Configuration under
// this Invocation.
string name = 1;
// The resource ID components that identify the ConfiguredTarget. They must
// match the resource name after proper encoding.
Id id = 2;
// The aggregate status for this configuration of this target. If testing
// was not requested, set this to the build status (e.g. BUILT or
// FAILED_TO_BUILD).
StatusAttributes status_attributes = 3;
// Captures the start time and duration of this configured target.
Timing timing = 4;
// Test specific attributes for this ConfiguredTarget.
ConfiguredTestAttributes test_attributes = 6;
// Arbitrary name-value pairs.
// This is implemented as a multi-map. Multiple properties are allowed with
// the same key. Properties will be returned in lexicographical order by key.
repeated Property properties = 7;
// A list of file references for configured target level files.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
repeated File files = 8;
}
// Attributes that apply only to test actions under this configured target.
message ConfiguredTestAttributes {
// Total number of test runs. For example, in bazel this is specified with
// --runs_per_test. Zero if runs_per_test is not used.
int32 total_run_count = 2;
// Total number of test shards. Zero if shard count was not specified.
int32 total_shard_count = 3;
// How long test is allowed to run.
google.protobuf.Duration timeout_duration = 5;
}

View File

@ -0,0 +1,103 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Describes line coverage for a file
message LineCoverage {
// Which source lines in the file represent the start of a statement that was
// instrumented to detect whether it was executed by the test.
//
// This is a bitfield where i-th bit corresponds to the i-th line. Divide line
// number by 8 to get index into byte array. Mod line number by 8 to get bit
// number (0 = LSB, 7 = MSB).
//
// A 1 denotes the line was instrumented.
// A 0 denotes the line was not instrumented.
bytes instrumented_lines = 1;
// Which of the instrumented source lines were executed by the test. Should
// include lines that were not instrumented.
//
// This is a bitfield where i-th bit corresponds to the i-th line. Divide line
// number by 8 to get index into byte array. Mod line number by 8 to get bit
// number (0 = LSB, 7 = MSB).
//
// A 1 denotes the line was executed.
// A 0 denotes the line was not executed.
bytes executed_lines = 2;
}
// Describes branch coverage for a file
message BranchCoverage {
// The field branch_present denotes the lines containing at least one branch.
//
// This is a bitfield where i-th bit corresponds to the i-th line. Divide line
// number by 8 to get index into byte array. Mod line number by 8 to get bit
// number (0 = LSB, 7 = MSB).
//
// A 1 denotes the line contains at least one branch.
// A 0 denotes the line contains no branches.
bytes branch_present = 1;
// Contains the number of branches present, only for the lines which have the
// corresponding bit set in branch_present, in a relative order ignoring
// lines which do not have any branches.
repeated int32 branches_in_line = 2;
// As each branch can have any one of the following three states: not
// executed, executed but not taken, executed and taken.
//
// This is a bitfield where i-th bit corresponds to the i-th line. Divide line
// number by 8 to get index into byte array. Mod line number by 8 to get bit
// number (0 = LSB, 7 = MSB).
//
// i-th bit of the following two byte arrays are used to denote the above
// mentioned states.
//
// not executed: i-th bit of executed == 0 && i-th bit of taken == 0
// executed but not taken: i-th bit of executed == 1 && i-th bit of taken == 0
// executed and taken: i-th bit of executed == 1 && i-th bit of taken == 1
bytes executed = 3;
// Described above.
bytes taken = 4;
}
// Describes code coverage for a particular file under test.
message FileCoverage {
// Path of source file within the SourceContext of this Invocation.
string path = 1;
// Details of lines in a file required to calculate line coverage.
LineCoverage line_coverage = 2;
// Details of branches in a file required to calculate branch coverage.
BranchCoverage branch_coverage = 3;
}
// Describes code coverage for a build or test Action. This is used to store
// baseline coverage for build Actions and test coverage for test Actions.
message ActionCoverage {
// List of coverage info for all source files that the TestResult covers.
repeated FileCoverage file_coverages = 2;
}

View File

@ -0,0 +1,66 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Summary of line coverage
message LineCoverageSummary {
// Number of lines instrumented for coverage.
int32 instrumented_line_count = 1;
// Number of instrumented lines that were executed by the test.
int32 executed_line_count = 2;
}
// Summary of branch coverage
// A branch may be:
// * not executed. Counted only in total.
// * executed but not taken. Appears in total and executed.
// * executed and taken. Appears in all three fields.
message BranchCoverageSummary {
// The number of branches present in the file.
int32 total_branch_count = 1;
// The number of branches executed out of the total branches present.
// A branch is executed when its condition is evaluated.
// This is <= total_branch_count as not all branches are executed.
int32 executed_branch_count = 2;
// The number of branches taken out of the total branches executed.
// A branch is taken when its condition is satisfied.
// This is <= executed_branch_count as not all executed branches are taken.
int32 taken_branch_count = 3;
}
// Summary of coverage in each language
message LanguageCoverageSummary {
// This summary is for all files written in this programming language.
Language language = 1;
// Summary of lines covered vs instrumented.
LineCoverageSummary line_summary = 2;
// Summary of branch coverage.
BranchCoverageSummary branch_summary = 3;
}

View File

@ -0,0 +1,107 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/protobuf/wrappers.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// The metadata for a file or an archive file entry.
message File {
// If known, the hash function used to compute this digest.
enum HashType {
// Unknown
HASH_TYPE_UNSPECIFIED = 0;
// MD5
MD5 = 1;
// SHA-1
SHA1 = 2;
// SHA-256
SHA256 = 3;
}
// The identifier of the file or archive entry.
// User-provided, must be unique for the repeated field it is in. When an
// Append RPC is called with a Files field populated, if a File already exists
// with this ID, that File will be overwritten with the new File proto.
string uid = 1;
// The URI of a file.
// This could also be the URI of an entire archive.
// Most log data doesn't need to be stored forever, so a ttl is suggested.
// Note that if you ever move or delete the file at this URI, the link from
// the server will be broken.
string uri = 2;
// (Optional) The length of the file in bytes. Allows the filesize to be
// shown in the UI. Omit if file is still being written or length is
// not known. This could also be the length of an entire archive.
google.protobuf.Int64Value length = 3;
// (Optional) The content-type (aka MIME-type) of the file. This is sent to
// the web browser so it knows how to handle the file. (e.g. text/plain,
// image/jpeg, text/html, etc). For zip archives, use "application/zip".
string content_type = 4;
// (Optional) If the above path, length, and content_type are referring to an
// archive, and you wish to refer to a particular entry within that archive,
// put the particular archive entry data here.
ArchiveEntry archive_entry = 5;
// (Optional) A url to a content display app/site for this file or archive
// entry.
string content_viewer = 6;
// (Optional) Whether to hide this file or archive entry in the UI. Defaults
// to false. A checkbox lets users see hidden files, but they're hidden by
// default.
bool hidden = 7;
// (Optional) A short description of what this file or archive entry
// contains. This description should help someone viewing the list of these
// files to understand the purpose of this file and what they would want to
// view it for.
string description = 8;
// (Optional) digest of this file in hexadecimal-like string if known.
string digest = 9;
// (Optional) The algorithm corresponding to the digest if known.
HashType hash_type = 10;
}
// Information specific to an entry in an archive.
message ArchiveEntry {
// The relative path of the entry within the archive.
string path = 1;
// (Optional) The uncompressed length of the archive entry in bytes. Allows
// the entry size to be shown in the UI. Omit if the length is not known.
google.protobuf.Int64Value length = 2;
// (Optional) The content-type (aka MIME-type) of the archive entry. (e.g.
// text/plain, image/jpeg, text/html, etc). This is sent to the web browser
// so it knows how to handle the entry.
string content_type = 3;
}

View File

@ -0,0 +1,53 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/file.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Represents a set of files within an Invocation. Can contain other file sets.
message FileSet {
// The resource ID components that identify the FileSet.
message Id {
// The Invocation ID.
string invocation_id = 1;
// The FileSet ID.
string file_set_id = 2;
}
// The format of this FileSet resource name must be:
// invocations/${INVOCATION_ID}/fileSets/${FILE_SET_ID}
string name = 1;
// The resource ID components that identify the file set. They must match the
// resource name after proper encoding.
Id id = 2;
// List of names of other file sets that are referenced from this one.
// Each name must point to a file set under the same invocation. The name
// format must be: invocations/${INVOCATION_ID}/fileSets/${FILE_SET_ID}
repeated string file_sets = 3;
// Files that are contained within this file set.
repeated File files = 4;
}

View File

@ -0,0 +1,156 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/coverage_summary.proto";
import "google/devtools/resultstore/v2/file.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// An Invocation typically represents the result of running a tool. Each has a
// unique ID, typically generated by the server. Target resources under each
// Invocation contain the bulk of the data.
message Invocation {
// The resource ID components that identify the Invocation.
message Id {
// The Invocation ID.
string invocation_id = 1;
}
// The resource name. Its format must be:
// invocations/${INVOCATION_ID}
string name = 1;
// The resource ID components that identify the Invocation. They must match
// the resource name after proper encoding.
Id id = 2;
// The aggregate status of the invocation.
StatusAttributes status_attributes = 3;
// When this invocation started and its duration.
Timing timing = 4;
// Attributes of this invocation.
InvocationAttributes invocation_attributes = 5;
// The workspace the tool was run in.
WorkspaceInfo workspace_info = 6;
// Arbitrary name-value pairs.
// This is implemented as a multi-map. Multiple properties are allowed with
// the same key. Properties will be returned in lexicographical order by key.
repeated Property properties = 7;
// A list of file references for invocation level files.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
// Use this field to specify build logs, and other invocation level logs.
repeated File files = 8;
// Summary of aggregate coverage across all Actions in this Invocation.
// the server populates this for you in the post-processing phase.
repeated LanguageCoverageSummary coverage_summaries = 9;
}
// If known, represents the state of the user/build-system workspace.
message WorkspaceContext {
}
// Describes the workspace under which the tool was invoked, this includes
// information that was fed into the command, the source code referenced, and
// the tool itself.
message WorkspaceInfo {
// Data about the workspace that might be useful for debugging.
WorkspaceContext workspace_context = 1;
// Where the tool was invoked
string hostname = 3;
// The client's working directory where the build/test was run from.
string working_directory = 4;
// Tools should set tool_tag to the name of the tool or use case.
string tool_tag = 5;
// The command lines invoked. The first command line is the one typed by the
// user, then each one after that should be an expansion of the previous
// command line.
repeated CommandLine command_lines = 7;
}
// The command and arguments that produced this Invocation.
message CommandLine {
// A label describing this command line.
string label = 1;
// The command-line tool that is run: argv[0].
string tool = 2;
// The arguments to the above tool: argv[1]...argv[N].
repeated string args = 3;
// The actual command that was run with the tool. (e.g. "build", or "test")
// Omit if the tool doesn't accept a command.
// This is a duplicate of one of the fields in args.
string command = 4;
}
// Attributes that apply to all invocations.
message InvocationAttributes {
// The project ID this invocation is associated with. This must be
// set in the CreateInvocation call, and can't be changed.
string project_id = 1;
// The list of users in the command chain. The first user in this sequence
// is the one who instigated the first command in the chain.
repeated string users = 2;
// Labels to categorize this invocation.
// This is implemented as a set. All labels will be unique. Any duplicate
// labels added will be ignored. Labels will be returned in lexicographical
// order. Labels should be short, easy to read, and you
// shouldn't have more than a handful.
// Labels should match regex \w([- \w]*\w)?
// Labels should not be used for unique properties such as unique IDs.
// Use properties in cases that don't meet these conditions.
repeated string labels = 3;
// This field describes the overall context or purpose of this invocation.
// It will be used in the UI to give users more information about
// how or why this invocation was run.
string description = 4;
// If this Invocation was run in the context of a larger Continuous
// Integration build or other automated system, this field may contain more
// information about the greater context.
repeated InvocationContext invocation_contexts = 6;
}
// Describes the invocation context which includes a display name and URL.
message InvocationContext {
// A human readable name for the context under which this Invocation was run.
string display_name = 1;
// A URL pointing to a UI containing more information
string url = 2;
}

View File

@ -0,0 +1,432 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/api/annotations.proto";
import "google/devtools/resultstore/v2/action.proto";
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/configuration.proto";
import "google/devtools/resultstore/v2/configured_target.proto";
import "google/devtools/resultstore/v2/file_set.proto";
import "google/devtools/resultstore/v2/invocation.proto";
import "google/devtools/resultstore/v2/target.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// This is the interface used to download information from the database.
//
// Most APIs require setting a response FieldMask via the 'fields' URL query
// parameter or the X-Goog-FieldMask HTTP/gRPC header.
// Each resource in this interface carries a name field that
// identifies the resource.
service ResultStoreDownload {
// Retrieves the invocation with the given name.
//
// An error will be reported in the following cases:
// - If the invocation is not found.
// - If the given invocation name is badly formatted.
// - If no field mask was given.
rpc GetInvocation(GetInvocationRequest) returns (Invocation) {
option (google.api.http) = {
get: "/v2/{name=invocations/*}"
};
}
// Searches for invocations matching the given query parameters.
//
//
// An error will be reported in the following cases:
// - If a query string is not provided
// - If no field mask was given.
rpc SearchInvocations(SearchInvocationsRequest)
returns (SearchInvocationsResponse) {
option (google.api.http) = {
get: "/v2/invocations:search"
};
}
// Retrieves the configuration with the given name.
//
// An error will be reported in the following cases:
// - If the configuration or its parent invocation is not found.
// - If the given configuration name is badly formatted.
// - If no field mask was given.
rpc GetConfiguration(GetConfigurationRequest) returns (Configuration) {
option (google.api.http) = {
get: "/v2/{name=invocations/*/configs/*}"
};
}
// Retrieves all configurations for a parent invocation.
// This might be limited by user or server,
// in which case a continuation token is provided.
//
// An error will be reported in the following cases:
// - If the parent invocation is not found.
// - If the given parent invocation name is badly formatted.
// - If no field mask was given.
rpc ListConfigurations(ListConfigurationsRequest)
returns (ListConfigurationsResponse) {
option (google.api.http) = {
get: "/v2/{parent=invocations/*}/configs"
};
}
// Retrieves the target with the given name.
//
// An error will be reported in the following cases:
// - If the target or its parent invocation is not found.
// - If the given target name is badly formatted.
// - If no field mask was given.
rpc GetTarget(GetTargetRequest) returns (Target) {
option (google.api.http) = {
get: "/v2/{name=invocations/*/targets/*}"
};
}
// Retrieves all targets for a parent invocation. This might be limited by
// user or server, in which case a continuation token is provided.
//
// An error will be reported in the following cases:
// - If the parent is not found.
// - If the given parent name is badly formatted.
// - If no field mask was given.
rpc ListTargets(ListTargetsRequest) returns (ListTargetsResponse) {
option (google.api.http) = {
get: "/v2/{parent=invocations/*}/targets"
};
}
// Retrieves the configured target with the given name.
//
// An error will be reported in the following cases:
// - If the configured target is not found.
// - If the given name is badly formatted.
// - If no field mask was given.
rpc GetConfiguredTarget(GetConfiguredTargetRequest)
returns (ConfiguredTarget) {
option (google.api.http) = {
get: "/v2/{name=invocations/*/targets/*/configuredTargets/*}"
};
}
// Retrieves all configured targets for a parent invocation/target.
// This might be limited by user or server, in which case a continuation
// token is provided. Supports '-' for targetId meaning all targets.
//
// An error will be reported in the following cases:
// - If the parent is not found.
// - If the given parent name is badly formatted.
// - If no field mask was given.
rpc ListConfiguredTargets(ListConfiguredTargetsRequest) returns (ListConfiguredTargetsResponse) {
option (google.api.http) = {
get: "/v2/{parent=invocations/*/targets/*}/configuredTargets"
};
}
// Retrieves the action with the given name.
//
// An error will be reported in the following cases:
// - If the action is not found.
// - If the given name is badly formatted.
// - If no field mask was given.
rpc GetAction(GetActionRequest) returns (Action) {
option (google.api.http) = {
get: "/v2/{name=invocations/*/targets/*/configuredTargets/*/actions/*}"
};
}
// Retrieves all actions for a parent invocation/target/configuration.
// This might be limited by user or server, in which case a continuation
// token is provided. Supports '-' for configurationId to mean all
// actions for all configurations for a target, or '-' for targetId and
// configurationId to mean all actions for all configurations and all targets.
// Does not support targetId '-' with a specified configuration.
//
// An error will be reported in the following cases:
// - If the parent is not found.
// - If the given parent name is badly formatted.
// - If no field mask was given.
rpc ListActions(ListActionsRequest) returns (ListActionsResponse) {
option (google.api.http) = {
get: "/v2/{parent=invocations/*/targets/*/configuredTargets/*}/actions"
};
}
// Retrieves the file set with the given name.
//
// An error will be reported in the following cases:
// - If the file set or its parent invocation is not found.
// - If the given file set name is badly formatted.
// - If no field mask was given.
rpc GetFileSet(GetFileSetRequest) returns (FileSet) {
option (google.api.http) = {
get: "/v2/{name=invocations/*/fileSets/*}"
};
}
// Retrieves all file sets for a parent invocation.
// This might be limited by user or server,
// in which case a continuation token is provided.
//
// An error will be reported in the following cases:
// - If the parent invocation is not found.
// - If the given parent invocation name is badly formatted.
// - If no field mask was given.
rpc ListFileSets(ListFileSetsRequest) returns (ListFileSetsResponse) {
option (google.api.http) = {
get: "/v2/{parent=invocations/*}/fileSets"
};
}
}
// Request passed into GetInvocation
message GetInvocationRequest {
// The name of the invocation to retrieve. It must match this format:
// invocations/${INVOCATION_ID}
// where INVOCATION_ID must be an RFC 4122-compliant random UUID.
string name = 1;
}
// Request passed into SearchInvocations
message SearchInvocationsRequest {
// The maximum number of items to return. Zero means all, but may be capped by
// the server.
int32 page_size = 1;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous Search request, if
// any.
string page_token = 2;
// Absolute number of results to skip.
int64 offset = 3;
}
// A filtering query string.
string query = 4;
// The project id to search under.
string project_id = 5;
}
// Response from calling SearchInvocations
message SearchInvocationsResponse {
// Invocations matching the search, possibly capped at request.page_size or a
// server limit.
repeated Invocation invocations = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results.
string next_page_token = 2;
}
// Request passed into GetConfiguration
message GetConfigurationRequest {
// The name of the configuration to retrieve. It must match this format:
// invocations/${INVOCATION_ID}/configs/${CONFIGURATION_ID}
string name = 1;
}
// Request passed into ListConfigurations
message ListConfigurationsRequest {
// The invocation name of the configurations to retrieve.
// It must match this format: invocations/${INVOCATION_ID}
string parent = 1;
// The maximum number of items to return.
// Zero means all, but may be capped by the server.
int32 page_size = 2;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous List request, if any.
string page_token = 3;
// Absolute number of results to skip.
int64 offset = 4;
}
}
// Response from calling ListConfigurations
message ListConfigurationsResponse {
// Configurations matching the request invocation,
// possibly capped at request.page_size or a server limit.
repeated Configuration configurations = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// Request passed into GetTarget
message GetTargetRequest {
// The name of the target to retrieve. It must match this format:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string name = 1;
}
// Request passed into ListTargets
message ListTargetsRequest {
// The invocation name of the targets to retrieve. It must match this format:
// invocations/${INVOCATION_ID}
string parent = 1;
// The maximum number of items to return.
// Zero means all, but may be capped by the server.
int32 page_size = 2;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous List request, if any.
string page_token = 3;
// Absolute number of results to skip.
int64 offset = 4;
}
}
// Response from calling ListTargetsResponse
message ListTargetsResponse {
// Targets matching the request invocation,
// possibly capped at request.page_size or a server limit.
repeated Target targets = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// Request passed into GetConfiguredTarget
message GetConfiguredTargetRequest {
// The name of the configured target to retrieve. It must match this format:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIGURATION_ID}
string name = 1;
}
// Request passed into ListConfiguredTargets
message ListConfiguredTargetsRequest {
// The invocation and target name of the configured targets to retrieve.
// It must match this format:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string parent = 1;
// The maximum number of items to return.
// Zero means all, but may be capped by the server.
int32 page_size = 2;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous List request, if any.
string page_token = 3;
// Absolute number of results to skip.
int64 offset = 4;
}
}
// Response from calling ListConfiguredTargets
message ListConfiguredTargetsResponse {
// ConfiguredTargets matching the request,
// possibly capped at request.page_size or a server limit.
repeated ConfiguredTarget configured_targets = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// Request passed into GetAction
message GetActionRequest {
// The name of the action to retrieve. It must match this format:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIGURATION_ID}/actions/${ACTION_ID}
string name = 1;
}
// Request passed into ListActions
message ListActionsRequest {
// The invocation, target, and configuration name of the action to retrieve.
// It must match this format:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIGURATION_ID}
string parent = 1;
// The maximum number of items to return.
// Zero means all, but may be capped by the server.
int32 page_size = 2;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous List request, if any.
string page_token = 3;
// Absolute number of results to skip.
int64 offset = 4;
}
}
// Response from calling ListActions
message ListActionsResponse {
// Actions matching the request,
// possibly capped at request.page_size or a server limit.
repeated Action actions = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// Request passed into GetFileSet
message GetFileSetRequest {
// The name of the file set to retrieve. It must match this format:
// invocations/${INVOCATION_ID}/fileSets/${FILE_SET_ID}
string name = 1;
}
// Request passed into ListFileSets
message ListFileSetsRequest {
// The invocation name of the file sets to retrieve.
// It must match this format: invocations/${INVOCATION_ID}
string parent = 1;
// The maximum number of items to return.
// Zero means all, but may be capped by the server.
int32 page_size = 2;
// Options for pagination.
oneof page_start {
// The next_page_token value returned from a previous List request, if any.
string page_token = 3;
// Absolute number of results to skip.
int64 offset = 4;
}
}
// Response from calling ListFileSets
message ListFileSetsResponse {
// File sets matching the request,
// possibly capped at request.page_size or a server limit.
repeated FileSet file_sets = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}

View File

@ -0,0 +1,106 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/api/annotations.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// This API allows download of File messages referenced in
// ResultStore resources.
service ResultStoreFileDownload {
// Retrieves the File with the given uri.
// returns a stream of bytes to be stitched together in order.
//
// An error will be reported in the following cases:
// - If the File is not found.
// - If the given File uri is badly formatted.
rpc GetFile(GetFileRequest) returns (stream GetFileResponse) {
option (google.api.http) = {
get: "/v2/{uri=file/*}"
};
}
// Retrieves the tail of a File with the given uri.
//
// An error will be reported in the following cases:
// - If the File is not found.
// - If the given File uri is badly formatted.
rpc GetFileTail(GetFileTailRequest) returns (GetFileTailResponse) {
option (google.api.http) = {
get: "/v2/{uri=file/tail/*}"
};
}
}
// Request object for GetFile
message GetFileRequest {
// This corresponds to the uri field in the File message.
string uri = 1;
// The offset for the first byte to return in the read, relative to the start
// of the resource.
//
// A `read_offset` that is negative or greater than the size of the resource
// will cause an `OUT_OF_RANGE` error.
int64 read_offset = 2;
// The maximum number of `data` bytes the server is allowed to return in the
// sum of all `ReadResponse` messages. A `read_limit` of zero indicates that
// there is no limit, and a negative `read_limit` will cause an error.
//
// If the stream returns fewer bytes than allowed by the `read_limit` and no
// error occurred, the stream includes all data from the `read_offset` to the
// end of the resource.
int64 read_limit = 3;
}
// Response object for GetFile
message GetFileResponse {
// The file data.
bytes data = 1;
}
// Request object for GetFileTail
message GetFileTailRequest {
// This corresponds to the uri field in the File message.
string uri = 1;
// The offset for the first byte to return in the read, relative to the end
// of the resource.
//
// A `read_offset` that is negative or greater than the size of the resource
// will cause an `OUT_OF_RANGE` error.
int64 read_offset = 2;
// The maximum number of `data` bytes the server is allowed to return. The
// server will return bytes starting from the tail of the file.
//
// A `read_limit` of zero indicates that there is no limit, and a negative
// `read_limit` will cause an error.
int64 read_limit = 3;
}
// Response object for GetFileTail
message GetFileTailResponse {
// The file data, encoded with UTF-8.
bytes data = 1;
}

View File

@ -0,0 +1,636 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/api/annotations.proto";
import "google/devtools/resultstore/v2/action.proto";
import "google/devtools/resultstore/v2/configuration.proto";
import "google/devtools/resultstore/v2/configured_target.proto";
import "google/devtools/resultstore/v2/file_set.proto";
import "google/devtools/resultstore/v2/invocation.proto";
import "google/devtools/resultstore/v2/target.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// This is the interface used to upload information to the ResultStore database,
// to update that information as necessary, and to make it immutable at the end.
// Every Update and Append method supports an update_mask field for restricting
// the affected fields.
service ResultStoreUpload {
// Creates the given invocation. Generally, a unique ID will be assigned to
// the invocation's name field by the server. This is not an implicitly
// idempotent API, so a request id is required to make it idempotent.
//
// Returns an empty Invocation proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If an invocation with the same ID already exists.
rpc CreateInvocation(CreateInvocationRequest) returns (Invocation) {
option (google.api.http) = {
post: "/v2/invocations"
body: "invocation"
};
}
// Applies a standard update to the invocation identified by the given proto's
// name. For all types of fields (primitive, message, or repeated), replaces
// them with the given proto fields if they are under the given field mask
// paths. Fields that match the mask but aren't populated in the given
// invocation are cleared. This is an implicitly idempotent API.
//
// Returns an empty Invocation proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If the invocation does not exist.
// - If the invocation is finished.
// - If no field mask was given.
rpc UpdateInvocation(UpdateInvocationRequest) returns (Invocation) {
option (google.api.http) = {
patch: "/v2/{invocation.name=invocations/*}"
body: "invocation"
};
}
// Declares the invocation with the given name as finished and immutable.
// This is an implicitly idempotent API.
//
// If an Invocation is not updated for 24 hours, some time after that
// this will be called automatically.
//
// An error will be reported in the following cases:
// - If the invocation does not exist.
rpc FinishInvocation(FinishInvocationRequest)
returns (FinishInvocationResponse) {
option (google.api.http) = {
post: "/v2/{name=invocations/*}:finish"
body: "*"
};
}
// Creates the given target under the given parent invocation. The given
// target ID is URL encoded, converted to the full resource name, and assigned
// to the target's name field. This is not an implicitly idempotent API, so a
// request id is required to make it idempotent.
//
// Returns an empty Target proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If no target ID is provided.
// - If the parent invocation does not exist.
// - If the parent invocation is finished.
// - If a target with the same name already exists.
rpc CreateTarget(CreateTargetRequest) returns (Target) {
option (google.api.http) = {
post: "/v2/{parent=invocations/*}/targets"
body: "target"
};
}
// Applies a standard update to the target identified by the given proto's
// name. For all types of fields (primitive, message, or repeated), replaces
// them with the given proto fields if they are under the given field mask
// paths. Fields that match the mask but aren't populated in the given
// target are cleared. This is an implicitly idempotent API.
//
// Returns an empty Target proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If the target does not exist.
// - If the target or parent invocation is finished.
// - If no field mask was given.
rpc UpdateTarget(UpdateTargetRequest) returns (Target) {
option (google.api.http) = {
patch: "/v2/{target.name=invocations/*/targets/*}"
body: "target"
};
}
// Declares the target with the given name as finished and immutable.
// This is an implicitly idempotent API.
//
// An error will be reported in the following cases:
// - If the target does not exist.
rpc FinishTarget(FinishTargetRequest) returns (FinishTargetResponse) {
option (google.api.http) = {
post: "/v2/{name=invocations/*/targets/*}:finish"
body: "*"
};
}
// Creates the given configured target under the given parent target.
// The given configured target ID is URL encoded, converted to the full
// resource name, and assigned to the configured target's name field.
// This is not an implicitly idempotent API, so a request id is required
// to make it idempotent.
//
// Returns an empty ConfiguredTarget proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If no config ID is provided.
// - If a configured target with the same ID already exists.
// - If the parent target does not exist.
// - If the parent target or invocation is finished.
rpc CreateConfiguredTarget(CreateConfiguredTargetRequest)
returns (ConfiguredTarget) {
option (google.api.http) = {
post: "/v2/{parent=invocations/*/targets/*}/configuredTargets"
body: "configured_target"
};
}
// Applies a standard update to the configured target identified by the given
// proto's name. For all types of fields (primitive, message, or repeated),
// replaces them with the given proto fields if they are under the given
// field mask paths. Fields that match the mask but aren't populated in the
// given configured target are cleared. This is an implicitly idempotent API.
//
// Returns an empty ConfiguredTarget proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If the configured target does not exist.
// - If the parent target or invocation is finished.
// - If no field mask was given.
rpc UpdateConfiguredTarget(UpdateConfiguredTargetRequest)
returns (ConfiguredTarget) {
option (google.api.http) = {
patch: "/v2/{configured_target.name=invocations/*/targets/*/configuredTargets/*}"
body: "configured_target"
};
}
// Declares the configured target with the given name as finished and
// immutable. This is an implicitly idempotent API.
//
// An error will be reported in the following cases:
// - If the configured target does not exist.
rpc FinishConfiguredTarget(FinishConfiguredTargetRequest)
returns (FinishConfiguredTargetResponse) {
option (google.api.http) = {
post: "/v2/{name=invocations/*/targets/*/configuredTargets/*}:finish"
body: "*"
};
}
// Creates the given action under the given configured target. The given
// action ID is URL encoded, converted to the full resource name, and
// assigned to the action's name field. This is not an implicitly
// idempotent API, so a request id is required to make it idempotent.
//
// Returns an empty Action proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If no action ID provided.
// - If the parent configured target does not exist.
// - If the parent target or invocation is finished.
// - If an action with the same name already exists.
rpc CreateAction(CreateActionRequest) returns (Action) {
option (google.api.http) = {
post: "/v2/{parent=invocations/*/targets/*/configuredTargets/*}/actions"
body: "action"
};
}
// Applies a standard update to the action identified by the given
// proto's name. For all types of fields (primitive, message, or repeated),
// replaces them with the given proto fields if they are under the given
// field mask paths. Fields that match the mask but aren't populated in the
// given action are cleared. This is an implicitly idempotent API.
//
// Returns an empty Action proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If the action does not exist.
// - If the parent target or invocation is finished.
// - If no field mask was given.
rpc UpdateAction(UpdateActionRequest) returns (Action) {
option (google.api.http) = {
patch: "/v2/{action.name=invocations/*/targets/*/configuredTargets/*/actions/*}"
body: "action"
};
}
// Creates the given configuration under the given parent invocation. The
// given configuration ID is URL encoded, converted to the full resource name,
// and assigned to the configuration's name field. The configuration ID of
// "default" should be preferred for the default configuration in a
// single-config invocation. This is not an implicitly idempotent API, so a
// request id is required to make it idempotent.
//
// Returns an empty Configuration proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If no configuration ID is provided.
// - If the parent invocation does not exist.
// - If the parent invocation is finished.
// - If a configuration with the same name already exists.
rpc CreateConfiguration(CreateConfigurationRequest) returns (Configuration) {
option (google.api.http) = {
post: "/v2/{parent=invocations/*}/configs"
body: "configuration"
};
}
// Applies a standard update to the configuration identified by the given
// proto's name. For all types of fields (primitive, message, or repeated),
// replaces them with the given proto fields if they are under the given field
// mask paths. Fields that match the mask but aren't populated in the given
// configuration are cleared. This is an implicitly idempotent API.
//
// Returns an empty Configuration proto with only the name and ID fields
// populated.
//
// An error will be reported in the following cases:
// - If the configuration does not exist.
// - If the parent invocation is finished.
// - If no field mask was given.
// - If a given field mask path is not valid.
rpc UpdateConfiguration(UpdateConfigurationRequest) returns (Configuration) {
option (google.api.http) = {
patch: "/v2/{configuration.name=invocations/*/configs/*}"
body: "configuration"
};
}
// Creates the given file set under the given parent invocation. The given
// file set ID is URL encoded, converted to the full resource name, and
// assigned to the file set's name field. This is not an implicitly idempotent
// API, so a request id is required to make it idempotent.
//
// Returns an empty FileSet proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If no file set ID is provided.
// - If a file set with the same name already exists.
// - If the parent invocation does not exist.
// - If the parent invocation is finished.
rpc CreateFileSet(CreateFileSetRequest) returns (FileSet) {
option (google.api.http) = {
post: "/v2/{parent=invocations/*}/fileSets"
body: "file_set"
};
}
// Applies a standard update to the file set identified by the given proto's
// name. For all types of fields (primitive, message, or repeated), replaces
// them with the given proto fields if they are under the given field mask
// paths. Fields that match the mask but aren't populated in the given
// configuration are cleared. This is an implicitly idempotent API.
//
// Returns an empty FileSet proto with only the name and ID fields populated.
//
// An error will be reported in the following cases:
// - If the file set does not exist.
// - If the parent invocation is finished.
// - If no field mask was given.
// - If a given field mask path is not valid.
rpc UpdateFileSet(UpdateFileSetRequest) returns (FileSet) {
option (google.api.http) = {
patch: "/v2/{file_set.name=invocations/*/fileSets/*}"
body: "file_set"
};
}
}
// Request passed into CreateInvocation
message CreateInvocationRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. If set, invocation_id must also be provided.
// Restricted to 36 utf-8 bytes.
string request_id = 1;
// The invocation ID. If left empty then a new unique ID will be
// assigned by the server. If populated, a RFC 4122-compliant v4 UUID is
// preferred, but v3 or v5 UUIDs are allowed too.
string invocation_id = 2;
// The invocation to create. Its name field will be ignored, since the name
// will be derived from the id field above and assigned by the server.
Invocation invocation = 3;
// This is a token to authorize upload access to this invocation. It must be
// set to a RFC 4122-compliant v3, v4, or v5 UUID. Once this is set in
// CreateInvocation, all other upload RPCs for that Invocation and any of its
// child resources must also include the exact same token, or they will be
// rejected. The generated token should be unique to this invocation, and it
// should be kept secret.
//
// The purpose of this field is to prevent other users and tools from
// clobbering your upload intentionally or accidentally. The standard way of
// using this token is to create a second v4 UUID when the invocation_id is
// created, and storing them together during the upload. Essentially, this is
// a "password" to the invocation.
string authorization_token = 4;
// By default, Invocations are auto-finished if they are not modified for 24
// hours. If you need auto-finish to happen sooner, set this field to the time
// you'd like auto-finish to occur.
google.protobuf.Timestamp auto_finish_time = 5;
}
// Request passed into UpdateInvocation
message UpdateInvocationRequest {
// Contains the name and the fields of the invocation to be updated. The
// name format must be: invocations/${INVOCATION_ID}
Invocation invocation = 3;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into FinishInvocation
message FinishInvocationRequest {
// The name of the invocation. Its format must be:
// invocations/${INVOCATION_ID}
string name = 1;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 3;
}
// Response returned from FinishInvocation
message FinishInvocationResponse {
// The name of the invocation. Its format will be:
// invocations/${INVOCATION_ID}
string name = 1;
// The resource ID components that identify the Invocation.
Invocation.Id id = 2;
}
// Request passed into CreateTarget
message CreateTargetRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. Restricted to 36 utf-8 bytes.
string request_id = 1;
// The name of the parent invocation in which the target is created.
// Its format must be invocations/${INVOCATION_ID}
string parent = 2;
// The target identifier. It can be any UTF-8 string up to 1024 bytes long
// except for the reserved id '-'.
string target_id = 3;
// The target to create. Its name field will be ignored, since the name will
// be derived from the id field above and assigned by the server.
Target target = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into UpdateTarget
message UpdateTargetRequest {
// Contains the name and the fields of the target to be updated. The name
// format must be: invocations/${INVOCATION_ID}/targets/${TARGET_ID}
Target target = 3;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into FinishTarget
message FinishTargetRequest {
// The name of the target. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string name = 1;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 3;
}
// Response returned from FinishTarget
message FinishTargetResponse {
// The name of the target. Its format will be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string name = 1;
// The resource ID components that identify the Target.
Target.Id id = 2;
}
// Request passed into CreateConfiguredTarget
message CreateConfiguredTargetRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. Restricted to 36 utf-8 bytes.
string request_id = 1;
// The name of the parent target in which the configured target is created.
// Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string parent = 2;
// The configuration identifier. This must match the ID of an existing
// Configuration under this Invocation. Cannot be the reserved id '-'.
string config_id = 3;
// The configured target to create. Its name field will be ignored, since the
// name will be derived from the id field above and assigned by the server.
ConfiguredTarget configured_target = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into UpdateConfiguredTarget
message UpdateConfiguredTargetRequest {
// Contains the name and the fields of the configured target to be updated.
// The name format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
ConfiguredTarget configured_target = 3;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into FinishConfiguredTarget
message FinishConfiguredTargetRequest {
// The name of the configured target. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
string name = 1;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 3;
}
// Response returned from FinishConfiguredTarget
message FinishConfiguredTargetResponse {
// The name of the configured target. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
string name = 1;
// The resource ID components that identify the ConfiguredTarget.
ConfiguredTarget.Id id = 2;
}
// Request passed into CreateAction
message CreateActionRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. Restricted to 36 utf-8 bytes.
string request_id = 1;
// The name of the parent configured target in which the action is created.
// Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
string parent = 2;
// The action identifier. It can be any UTF-8 string up to 512 bytes long,
// except for the reserved id '-'.
string action_id = 3;
// The action to create. Its name field will be ignored, since the
// name will be derived from the id field above and assigned by the server.
Action action = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into UpdateAction
message UpdateActionRequest {
// Contains the name and the fields of the action to be updated. The
// name format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}/actions/${ACTION_ID}
Action action = 3;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into CreateConfiguration
message CreateConfigurationRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. Restricted to 36 utf-8 bytes.
string request_id = 1;
// The name of the parent invocation in which the configuration is created.
// Its format must be invocations/${INVOCATION_ID}
string parent = 2;
// The configuration identifier. It can be any UTF-8 string up to 256 bytes
// long. The configuration ID of "default" should be preferred for the default
// configuration in a single-config invocation. Cannot be the reserved id '-'.
string config_id = 3;
// The configuration to create. Its name field will be ignored, since the name
// will be derived from the id field above and assigned by the server.
Configuration configuration = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into UpdateConfiguration
message UpdateConfigurationRequest {
// Contains the name and fields of the configuration to be updated. The name
// format must be: invocations/${INVOCATION_ID}/configs/${CONFIG_ID}
Configuration configuration = 3;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into CreateFileSet
message CreateFileSetRequest {
// A unique identifier for this request. Must be set to a different value for
// each request that affects a given resource (eg. a random UUID). Required
// for the operation to be idempotent. This is achieved by ignoring this
// request if the last successful operation on the resource had the same
// request ID. Restricted to 36 utf-8 bytes.
string request_id = 1;
// The name of the parent invocation in which the file set is created.
// Its format must be invocations/${INVOCATION_ID}
string parent = 2;
// The file set identifier. It can be any UTF-8 string up to 256 bytes long.
string file_set_id = 3;
// The file set to create. Its name field will be ignored, since the name will
// be derived from the id field above and assigned by the server.
FileSet file_set = 4;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 5;
}
// Request passed into UpdateFileSet
message UpdateFileSetRequest {
// Contains the name and fields of the file set to be updated. The name format
// must be: invocations/${INVOCATION_ID}/fileSets/${FILE_SET_ID}
FileSet file_set = 1;
// Indicates which fields to update.
google.protobuf.FieldMask update_mask = 2;
// This is a token to authorize access to this invocation. It must be set to
// the same value that was provided in the CreateInvocationRequest.
string authorization_token = 3;
}

View File

@ -0,0 +1,140 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/file.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// Each Target represents data for a given target in a given Invocation.
// ConfiguredTarget and Action resources under each Target contain the bulk of
// the data.
message Target {
// The resource ID components that identify the Target.
message Id {
// The Invocation ID.
string invocation_id = 1;
// The Target ID.
string target_id = 2;
}
// The resource name. Its format must be:
// invocations/${INVOCATION_ID}/targets/${TARGET_ID}
string name = 1;
// The resource ID components that identify the Target. They must match the
// resource name after proper encoding.
Id id = 2;
// This is the aggregate status of the target.
StatusAttributes status_attributes = 3;
// When this target started and its duration.
Timing timing = 4;
// Attributes that apply to all targets.
TargetAttributes target_attributes = 5;
// Attributes that apply to all test actions under this target.
TestAttributes test_attributes = 6;
// Arbitrary name-value pairs.
// This is implemented as a multi-map. Multiple properties are allowed with
// the same key. Properties will be returned in lexicographical order by key.
repeated Property properties = 7;
// A list of file references for target level files.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
// Use this field to specify outputs not related to a configuration.
repeated File files = 8;
// Provides a hint to clients as to whether to display the Target to users.
// If true then clients likely want to display the Target by default.
// Once set to true, this may not be set back to false.
bool visible = 10;
}
// Attributes that apply to all targets.
message TargetAttributes {
// If known, indicates the type of this target. In bazel this corresponds
// to the rule-suffix.
TargetType type = 1;
// If known, the main language of this target, e.g. java, cc, python, etc.
Language language = 2;
// The tags attribute of the build rule. These should be short, descriptive
// words, and there should only be a few of them.
// This is implemented as a set. All tags will be unique. Any duplicate tags
// will be ignored. Tags will be returned in lexicographical order.
repeated string tags = 3;
}
// Attributes that apply only to test actions under this target.
message TestAttributes {
// Indicates how big the user indicated the test action was.
TestSize size = 1;
}
// These correspond to the suffix of the rule name. Eg cc_test has type TEST.
enum TargetType {
// Unspecified by the build system.
TARGET_TYPE_UNSPECIFIED = 0;
// An application e.g. ios_application.
APPLICATION = 1;
// A binary target e.g. cc_binary.
BINARY = 2;
// A library target e.g. java_library
LIBRARY = 3;
// A package
PACKAGE = 4;
// Any test target, in bazel that means a rule with a '_test' suffix.
TEST = 5;
}
// Indicates how big the user indicated the test action was.
enum TestSize {
// Unspecified by the user.
TEST_SIZE_UNSPECIFIED = 0;
// Unit test taking less than 1 minute.
SMALL = 1;
// Integration tests taking less than 5 minutes.
MEDIUM = 2;
// End-to-end tests taking less than 15 minutes.
LARGE = 3;
// Even bigger than LARGE.
ENORMOUS = 4;
// Something that doesn't fit into the above categories.
OTHER_SIZE = 5;
}

View File

@ -0,0 +1,199 @@
// Copyright 2018 Google LLC.
//
// 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.resultstore.v2;
import "google/devtools/resultstore/v2/common.proto";
import "google/devtools/resultstore/v2/file.proto";
option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
option java_multiple_files = true;
option java_package = "com.google.devtools.resultstore.v2";
// The result of running a test suite, as reported in a <testsuite> element of
// an XML log.
message TestSuite {
// The full name of this suite, as reported in the name attribute. For Java
// tests, this is normally the fully qualified class name. Eg.
// "com.google.common.hash.BloomFilterTest".
string suite_name = 1;
// The results of the test cases and test suites contained in this suite,
// as reported in the <testcase> and <testsuite> elements contained within
// this <testsuite>.
repeated Test tests = 2;
// Failures reported in <failure> elements within this <testsuite>.
repeated TestFailure failures = 3;
// Errors reported in <error> elements within this <testsuite>.
repeated TestError errors = 4;
// The timing for the entire TestSuite, as reported by the time attribute.
Timing timing = 6;
// Arbitrary name-value pairs, as reported in custom attributes or in a
// <properties> element within this <testsuite>. Multiple properties are
// allowed with the same key. Properties will be returned in lexicographical
// order by key.
repeated Property properties = 7;
// Files produced by this test suite, as reported by undeclared output
// annotations.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
repeated File files = 8;
}
// The result of running a test case or test suite. JUnit3 TestDecorators are
// represented as a TestSuite with a single test.
message Test {
// Either a TestCase of a TestSuite
oneof test_type {
// When this contains just a single TestCase
TestCase test_case = 1;
// When this contains a TestSuite of test cases.
TestSuite test_suite = 2;
}
}
// The result of running a test case, as reported in a <testcase> element of
// an XML log.
message TestCase {
// The result of running a test case.
enum Result {
// The implicit default enum value. Do not use.
RESULT_UNSPECIFIED = 0;
// Test case ran to completion. Look for failures or errors to determine
// whether it passed, failed, or errored.
COMPLETED = 1;
// Test case started but did not complete because the test harness received
// a signal and decided to stop running tests.
INTERRUPTED = 2;
// Test case was not started because the test harness received a SIGINT or
// timed out.
CANCELLED = 3;
// Test case was not run because the user or process running the test
// specified a filter that excluded this test case.
FILTERED = 4;
// Test case was not run to completion because the test case decided it
// should not be run (eg. due to a failed assumption in a JUnit4 test).
// Per-test setup or tear-down may or may not have run.
SKIPPED = 5;
// The test framework did not run the test case because it was labeled as
// suppressed. Eg. if someone temporarily disables a failing test.
SUPPRESSED = 6;
}
// The name of the test case, as reported in the name attribute. For Java,
// this is normally the method name. Eg. "testBasic".
string case_name = 1;
// The name of the class in which the test case was defined, as reported in
// the classname attribute. For Java, this is normally the fully qualified
// class name. Eg. "com.google.common.hash.BloomFilterTest".
string class_name = 2;
// An enum reported in the result attribute that is used in conjunction with
// failures and errors below to report the outcome.
Result result = 3;
// Failures reported in <failure> elements within this <testcase>.
repeated TestFailure failures = 4;
// Errors reported in <error> elements within this <testcase>.
repeated TestError errors = 5;
// The timing for the TestCase, as reported by the time attribute.
Timing timing = 7;
// Arbitrary name-value pairs, as reported in custom attributes or in a
// <properties> element within this <testcase>. Multiple properties are
// allowed with the same key. Properties will be returned in lexicographical
// order by key.
repeated Property properties = 8;
// Files produced by this test case, as reported by undeclared output
// annotations.
// The file IDs must be unique within this list. Duplicate file IDs will
// result in an error. Files will be returned in lexicographical order by ID.
repeated File files = 9;
}
// Represents a violated assertion, as reported in a <failure> element within a
// <testcase>. Some languages allow assertions to be made without stopping the
// test case when they're violated, leading to multiple TestFailures. For Java,
// multiple TestFailures are used to represent a chained exception.
message TestFailure {
// The exception message reported in the message attribute. Typically short,
// but may be multi-line. Eg. "Expected 'foo' but was 'bar'".
string failure_message = 1;
// The type of the exception being thrown, reported in the type attribute.
// Eg: "org.junit.ComparisonFailure"
string exception_type = 2;
// The stack trace reported as the content of the <failure> element, often in
// a CDATA block. This contains one line for each stack frame, each including
// a method/function name, a class/file name, and a line number. Most recent
// call is usually first, but not for Python stack traces. May contain the
// exception_type and message.
string stack_trace = 3;
// The expected values.
//
// These values can be diffed against the actual values. Often, there is just
// one actual and one expected value. If there is more than one, they should
// be compared as an unordered collection.
repeated string expected = 4;
// The actual values.
//
// These values can be diffed against the expected values. Often, there is
// just one actual and one expected value. If there is more than one, they
// should be compared as an unordered collection.
repeated string actual = 5;
}
// Represents an exception that prevented a test case from completing, as
// reported in an <error> element within a <testcase>. For Java, multiple
// TestErrors are used to represent a chained exception.
message TestError {
// The exception message, as reported in the message attribute. Typically
// short, but may be multi-line. Eg. "argument cannot be null".
string error_message = 1;
// The type of the exception being thrown, reported in the type attribute.
// For Java, this is a fully qualified Throwable class name.
// Eg: "java.lang.IllegalArgumentException"
string exception_type = 2;
// The stack trace reported as the content of the <error> element, often in
// a CDATA block. This contains one line for each stack frame, each including
// a method/function name, a class/file name, and a line number. Most recent
// call is usually first, but not for Python stack traces. May contain the
// exception_type and message.
string stack_trace = 3;
}

View File

@ -0,0 +1,184 @@
// Copyright 2018 Google LLC.
//
// 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 cc_enable_arenas = true;
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 [deprecated = true];
// 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 [deprecated = true];
// 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;
}