xref: /aosp_15_r20/external/google-cloud-java/java-grafeas/src/main/proto/grafeas/v1/discovery.proto (revision 55e87721aa1bc457b326496a7ca40f3ea1a63287)
1// Copyright 2019 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.v1;
18
19import "google/api/field_behavior.proto";
20import "google/protobuf/timestamp.proto";
21import "google/rpc/status.proto";
22import "grafeas/v1/common.proto";
23
24option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
25option java_multiple_files = true;
26option java_package = "io.grafeas.v1";
27option objc_class_prefix = "GRA";
28
29// A note that indicates a type of analysis a provider would perform. This note
30// exists in a provider's project. A `Discovery` occurrence is created in a
31// consumer's project at the start of analysis.
32message DiscoveryNote {
33  // Required. Immutable. The kind of analysis that is handled by this
34  // discovery.
35  grafeas.v1.NoteKind analysis_kind = 1;
36}
37
38// Provides information about the analysis status of a discovered resource.
39message DiscoveryOccurrence {
40  // Whether the resource is continuously analyzed.
41  enum ContinuousAnalysis {
42    // Unknown.
43    CONTINUOUS_ANALYSIS_UNSPECIFIED = 0;
44    // The resource is continuously analyzed.
45    ACTIVE = 1;
46    // The resource is ignored for continuous analysis.
47    INACTIVE = 2;
48  }
49
50  // Whether the resource is continuously analyzed.
51  ContinuousAnalysis continuous_analysis = 1;
52
53  // Analysis status for a resource. Currently for initial analysis only (not
54  // updated in continuous analysis).
55  enum AnalysisStatus {
56    option allow_alias = true;
57
58    // Unknown.
59    ANALYSIS_STATUS_UNSPECIFIED = 0;
60    // Resource is known but no action has been taken yet.
61    PENDING = 1;
62    // Resource is being analyzed.
63    SCANNING = 2;
64    // Analysis has finished successfully.
65    FINISHED_SUCCESS = 3;
66    // Analysis has completed.
67    COMPLETE = 3;
68    // Analysis has finished unsuccessfully, the analysis itself is in a bad
69    // state.
70    FINISHED_FAILED = 4;
71    // The resource is known not to be supported.
72    FINISHED_UNSUPPORTED = 5;
73  }
74
75  // The status of discovery for the resource.
76  AnalysisStatus analysis_status = 2;
77
78  // Indicates which analysis completed successfully. Multiple types of
79  // analysis can be performed on a single resource.
80  message AnalysisCompleted {
81    repeated string analysis_type = 1;
82  }
83
84  AnalysisCompleted analysis_completed = 7;
85
86  // Indicates any errors encountered during analysis of a resource. There
87  // could be 0 or more of these errors.
88  repeated google.rpc.Status analysis_error = 8;
89
90  // When an error is encountered this will contain a LocalizedMessage under
91  // details to show to the user. The LocalizedMessage is output only and
92  // populated by the API.
93  google.rpc.Status analysis_status_error = 3;
94
95  // The CPE of the resource being scanned.
96  string cpe = 4;
97
98  // The last time this resource was scanned.
99  google.protobuf.Timestamp last_scan_time = 5;
100
101  // The time occurrences related to this discovery occurrence were archived.
102  google.protobuf.Timestamp archive_time = 6
103      [(google.api.field_behavior) = OUTPUT_ONLY];
104}
105