assets.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. syntax = "proto3";
  16. package google.cloud.asset.v1p2beta1;
  17. import "google/api/annotations.proto";
  18. import "google/iam/v1/policy.proto";
  19. import "google/protobuf/any.proto";
  20. import "google/protobuf/struct.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option cc_enable_arenas = true;
  23. option csharp_namespace = "Google.Cloud.Asset.v1p2beta1";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "AssetProto";
  27. option java_package = "com.google.cloud.asset.v1p2beta1";
  28. option php_namespace = "Google\\Cloud\\Asset\\V1p2beta1";
  29. // Temporal asset. In addition to the asset, the temporal asset includes the
  30. // status of the asset and valid from and to time of it.
  31. message TemporalAsset {
  32. // The time window when the asset data and state was observed.
  33. TimeWindow window = 1;
  34. // If the asset is deleted or not.
  35. bool deleted = 2;
  36. // Asset.
  37. Asset asset = 3;
  38. }
  39. // A time window of (start_time, end_time].
  40. message TimeWindow {
  41. // Start time of the time window (exclusive).
  42. google.protobuf.Timestamp start_time = 1;
  43. // End time of the time window (inclusive).
  44. // Current timestamp if not specified.
  45. google.protobuf.Timestamp end_time = 2;
  46. }
  47. // Cloud asset. This includes all Google Cloud Platform resources,
  48. // Cloud IAM policies, and other non-GCP assets.
  49. message Asset {
  50. // The full name of the asset. For example:
  51. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  52. // See [Resource
  53. // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  54. // for more information.
  55. string name = 1;
  56. // Type of the asset. Example: "compute.googleapis.com/Disk".
  57. string asset_type = 2;
  58. // Representation of the resource.
  59. Resource resource = 3;
  60. // Representation of the actual Cloud IAM policy set on a cloud resource. For
  61. // each resource, there must be at most one Cloud IAM policy set on it.
  62. google.iam.v1.Policy iam_policy = 4;
  63. // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
  64. // represented as a list of relative resource names. Ancestry path starts with
  65. // the closest CRM ancestor and ends at root. If the asset is a CRM
  66. // project/folder/organization, this starts from the asset itself.
  67. //
  68. // Example: ["projects/123456789", "folders/5432", "organizations/1234"]
  69. repeated string ancestors = 6;
  70. }
  71. // Representation of a cloud resource.
  72. message Resource {
  73. // The API version. Example: "v1".
  74. string version = 1;
  75. // The URL of the discovery document containing the resource's JSON schema.
  76. // For example:
  77. // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
  78. // It will be left unspecified for resources without a discovery-based API,
  79. // such as Cloud Bigtable.
  80. string discovery_document_uri = 2;
  81. // The JSON schema name listed in the discovery document.
  82. // Example: "Project". It will be left unspecified for resources (such as
  83. // Cloud Bigtable) without a discovery-based API.
  84. string discovery_name = 3;
  85. // The REST URL for accessing the resource. An HTTP GET operation using this
  86. // URL returns the resource itself.
  87. // Example:
  88. // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
  89. // It will be left unspecified for resources without a REST API.
  90. string resource_url = 4;
  91. // The full name of the immediate parent of this resource. See
  92. // [Resource
  93. // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  94. // for more information.
  95. //
  96. // For GCP assets, it is the parent resource defined in the [Cloud IAM policy
  97. // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
  98. // For example:
  99. // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
  100. //
  101. // For third-party assets, it is up to the users to define.
  102. string parent = 5;
  103. // The content of the resource, in which some sensitive fields are scrubbed
  104. // away and may not be present.
  105. google.protobuf.Struct data = 6;
  106. }