discovery.proto 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. syntax = "proto3";
  15. package grafeas.v1beta1.discovery;
  16. import "google/devtools/containeranalysis/v1beta1/common/common.proto";
  17. import "google/protobuf/timestamp.proto";
  18. import "google/rpc/status.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/discovery;discovery";
  20. option java_multiple_files = true;
  21. option java_package = "io.grafeas.v1beta1.discovery";
  22. option objc_class_prefix = "GRA";
  23. // A note that indicates a type of analysis a provider would perform. This note
  24. // exists in a provider's project. A `Discovery` occurrence is created in a
  25. // consumer's project at the start of analysis.
  26. message Discovery {
  27. // Required. Immutable. The kind of analysis that is handled by this
  28. // discovery.
  29. grafeas.v1beta1.NoteKind analysis_kind = 1;
  30. }
  31. // Details of a discovery occurrence.
  32. message Details {
  33. // Required. Analysis status for the discovered resource.
  34. Discovered discovered = 1;
  35. }
  36. // Provides information about the analysis status of a discovered resource.
  37. message Discovered {
  38. // Whether the resource is continuously analyzed.
  39. enum ContinuousAnalysis {
  40. // Unknown.
  41. CONTINUOUS_ANALYSIS_UNSPECIFIED = 0;
  42. // The resource is continuously analyzed.
  43. ACTIVE = 1;
  44. // The resource is ignored for continuous analysis.
  45. INACTIVE = 2;
  46. }
  47. // Whether the resource is continuously analyzed.
  48. ContinuousAnalysis continuous_analysis = 1;
  49. // The last time continuous analysis was done for this resource.
  50. google.protobuf.Timestamp last_analysis_time = 2;
  51. // Analysis status for a resource. Currently for initial analysis only (not
  52. // updated in continuous analysis).
  53. enum AnalysisStatus {
  54. // Unknown.
  55. ANALYSIS_STATUS_UNSPECIFIED = 0;
  56. // Resource is known but no action has been taken yet.
  57. PENDING = 1;
  58. // Resource is being analyzed.
  59. SCANNING = 2;
  60. // Analysis has finished successfully.
  61. FINISHED_SUCCESS = 3;
  62. // Analysis has finished unsuccessfully, the analysis itself is in a bad
  63. // state.
  64. FINISHED_FAILED = 4;
  65. // The resource is known not to be supported
  66. FINISHED_UNSUPPORTED = 5;
  67. }
  68. // The status of discovery for the resource.
  69. AnalysisStatus analysis_status = 3;
  70. // When an error is encountered this will contain a LocalizedMessage under
  71. // details to show to the user. The LocalizedMessage is output only and
  72. // populated by the API.
  73. google.rpc.Status analysis_status_error = 4;
  74. }