assets.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Copyright 2020 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. syntax = "proto3";
  15. package google.cloud.asset.v1p5beta1;
  16. import "google/api/resource.proto";
  17. import "google/cloud/orgpolicy/v1/orgpolicy.proto";
  18. import "google/iam/v1/policy.proto";
  19. import "google/identity/accesscontextmanager/v1/access_level.proto";
  20. import "google/identity/accesscontextmanager/v1/access_policy.proto";
  21. import "google/identity/accesscontextmanager/v1/service_perimeter.proto";
  22. import "google/protobuf/struct.proto";
  23. option cc_enable_arenas = true;
  24. option csharp_namespace = "Google.Cloud.Asset.V1p5Beta1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "AssetProto";
  28. option java_package = "com.google.cloud.asset.v1p5beta1";
  29. option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1";
  30. // Cloud asset. This includes all Google Cloud Platform resources,
  31. // Cloud IAM policies, and other non-GCP assets.
  32. message Asset {
  33. option (google.api.resource) = {
  34. type: "cloudasset.googleapis.com/Asset"
  35. pattern: "*"
  36. };
  37. // The full name of the asset. For example:
  38. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  39. // See [Resource
  40. // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  41. // for more information.
  42. string name = 1;
  43. // Type of the asset. Example: "compute.googleapis.com/Disk".
  44. string asset_type = 2;
  45. // Representation of the resource.
  46. Resource resource = 3;
  47. // Representation of the actual Cloud IAM policy set on a cloud resource. For
  48. // each resource, there must be at most one Cloud IAM policy set on it.
  49. google.iam.v1.Policy iam_policy = 4;
  50. // Representation of the Cloud Organization Policy set on an asset. For each
  51. // asset, there could be multiple Organization policies with different
  52. // constraints.
  53. repeated google.cloud.orgpolicy.v1.Policy org_policy = 6;
  54. // Representation of the Cloud Organization access policy.
  55. oneof access_context_policy {
  56. google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
  57. google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
  58. google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter =
  59. 9;
  60. }
  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 = 10;
  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. }