assets.proto 4.5 KB

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