discovery.proto 2.8 KB

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