|
| 1 | +// Copyright 2019 Google LLC. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | +// |
| 15 | + |
| 16 | +syntax = "proto3"; |
| 17 | + |
| 18 | +package google.devtools.containeranalysis.v1; |
| 19 | + |
| 20 | +import "google/api/annotations.proto"; |
| 21 | +import "google/iam/v1/iam_policy.proto"; |
| 22 | +import "google/iam/v1/policy.proto"; |
| 23 | +import "google/protobuf/timestamp.proto"; |
| 24 | + |
| 25 | +option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1"; |
| 26 | +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis"; |
| 27 | +option java_multiple_files = true; |
| 28 | +option java_package = "com.google.containeranalysis.v1"; |
| 29 | +option objc_class_prefix = "GCA"; |
| 30 | +option ruby_package = "Google::Cloud::ContainerAnalysis::V1"; |
| 31 | + |
| 32 | +// Retrieves analysis results of Cloud components such as Docker container |
| 33 | +// images. The Container Analysis API is an implementation of the |
| 34 | +// [Grafeas](grafeas.io) API. |
| 35 | +// |
| 36 | +// Analysis results are stored as a series of occurrences. An `Occurrence` |
| 37 | +// contains information about a specific analysis instance on a resource. An |
| 38 | +// occurrence refers to a `Note`. A note contains details describing the |
| 39 | +// analysis and is generally stored in a separate project, called a `Provider`. |
| 40 | +// Multiple occurrences can refer to the same note. |
| 41 | +// |
| 42 | +// For example, an SSL vulnerability could affect multiple images. In this case, |
| 43 | +// there would be one note for the vulnerability and an occurrence for each |
| 44 | +// image with the vulnerability referring to that note. |
| 45 | +service ContainerAnalysis { |
| 46 | + // Sets the access control policy on the specified note or occurrence. |
| 47 | + // Requires `containeranalysis.notes.setIamPolicy` or |
| 48 | + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is |
| 49 | + // a note or an occurrence, respectively. |
| 50 | + // |
| 51 | + // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for |
| 52 | + // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for |
| 53 | + // occurrences. |
| 54 | + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { |
| 55 | + option (google.api.http) = { |
| 56 | + post: "/v1/{resource=projects/*/notes/*}:setIamPolicy" |
| 57 | + body: "*" |
| 58 | + additional_bindings { |
| 59 | + post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy" |
| 60 | + body: "*" |
| 61 | + } |
| 62 | + }; |
| 63 | + } |
| 64 | + |
| 65 | + // Gets the access control policy for a note or an occurrence resource. |
| 66 | + // Requires `containeranalysis.notes.setIamPolicy` or |
| 67 | + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is |
| 68 | + // a note or occurrence, respectively. |
| 69 | + // |
| 70 | + // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for |
| 71 | + // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for |
| 72 | + // occurrences. |
| 73 | + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { |
| 74 | + option (google.api.http) = { |
| 75 | + post: "/v1/{resource=projects/*/notes/*}:getIamPolicy" |
| 76 | + body: "*" |
| 77 | + additional_bindings { |
| 78 | + post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy" |
| 79 | + body: "*" |
| 80 | + } |
| 81 | + }; |
| 82 | + } |
| 83 | + |
| 84 | + // Returns the permissions that a caller has on the specified note or |
| 85 | + // occurrence. Requires list permission on the project (for example, |
| 86 | + // `containeranalysis.notes.list`). |
| 87 | + // |
| 88 | + // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for |
| 89 | + // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for |
| 90 | + // occurrences. |
| 91 | + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { |
| 92 | + option (google.api.http) = { |
| 93 | + post: "/v1/{resource=projects/*/notes/*}:testIamPermissions" |
| 94 | + body: "*" |
| 95 | + additional_bindings { |
| 96 | + post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions" |
| 97 | + body: "*" |
| 98 | + } |
| 99 | + }; |
| 100 | + } |
| 101 | +} |
0 commit comments