1// Copyright 2018 The Grafeas Authors. All rights reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package grafeas.v1beta1.discovery; 18 19import "google/devtools/containeranalysis/v1beta1/common/common.proto"; 20import "google/protobuf/timestamp.proto"; 21import "google/rpc/status.proto"; 22 23option go_package = "cloud.google.com/go/containeranalysis/apiv1beta1/containeranalysispb;containeranalysispb"; 24option java_multiple_files = true; 25option java_package = "io.grafeas.v1beta1.discovery"; 26option objc_class_prefix = "GRA"; 27 28// A note that indicates a type of analysis a provider would perform. This note 29// exists in a provider's project. A `Discovery` occurrence is created in a 30// consumer's project at the start of analysis. 31message Discovery { 32 // Required. Immutable. The kind of analysis that is handled by this 33 // discovery. 34 grafeas.v1beta1.NoteKind analysis_kind = 1; 35} 36 37// Details of a discovery occurrence. 38message Details { 39 // Required. Analysis status for the discovered resource. 40 Discovered discovered = 1; 41} 42 43// Provides information about the analysis status of a discovered resource. 44message Discovered { 45 // Whether the resource is continuously analyzed. 46 enum ContinuousAnalysis { 47 // Unknown. 48 CONTINUOUS_ANALYSIS_UNSPECIFIED = 0; 49 // The resource is continuously analyzed. 50 ACTIVE = 1; 51 // The resource is ignored for continuous analysis. 52 INACTIVE = 2; 53 } 54 55 // Whether the resource is continuously analyzed. 56 ContinuousAnalysis continuous_analysis = 1; 57 58 // The last time continuous analysis was done for this resource. 59 google.protobuf.Timestamp last_analysis_time = 2; 60 61 // Analysis status for a resource. Currently for initial analysis only (not 62 // updated in continuous analysis). 63 enum AnalysisStatus { 64 // Unknown. 65 ANALYSIS_STATUS_UNSPECIFIED = 0; 66 // Resource is known but no action has been taken yet. 67 PENDING = 1; 68 // Resource is being analyzed. 69 SCANNING = 2; 70 // Analysis has finished successfully. 71 FINISHED_SUCCESS = 3; 72 // Analysis has finished unsuccessfully, the analysis itself is in a bad 73 // state. 74 FINISHED_FAILED = 4; 75 // The resource is known not to be supported 76 FINISHED_UNSUPPORTED = 5; 77 } 78 79 // The status of discovery for the resource. 80 AnalysisStatus analysis_status = 3; 81 82 // When an error is encountered this will contain a LocalizedMessage under 83 // details to show to the user. The LocalizedMessage is output only and 84 // populated by the API. 85 google.rpc.Status analysis_status_error = 4; 86} 87