asset_service.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/cloud/asset/v1p5beta1/assets.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.Asset.V1P5Beta1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "AssetServiceProto";
  25. option java_package = "com.google.cloud.asset.v1p5beta1";
  26. option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1";
  27. // Asset service definition.
  28. service AssetService {
  29. option (google.api.default_host) = "cloudasset.googleapis.com";
  30. option (google.api.oauth_scopes) =
  31. "https://www.googleapis.com/auth/cloud-platform";
  32. // Lists assets with time and resource types and returns paged results in
  33. // response.
  34. rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) {
  35. option (google.api.http) = {
  36. get: "/v1p5beta1/{parent=*/*}/assets"
  37. };
  38. }
  39. }
  40. // ListAssets request.
  41. message ListAssetsRequest {
  42. // Required. Name of the organization or project the assets belong to. Format:
  43. // "organizations/[organization-number]" (such as "organizations/123"),
  44. // "projects/[project-number]" (such as "projects/my-project-id"), or
  45. // "projects/[project-id]" (such as "projects/12345").
  46. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  47. // Timestamp to take an asset snapshot. This can only be set to a timestamp
  48. // between 2018-10-02 UTC (inclusive) and the current time. If not specified,
  49. // the current time will be used. Due to delays in resource data collection
  50. // and indexing, there is a volatile window during which running the same
  51. // query may get different results.
  52. google.protobuf.Timestamp read_time = 2;
  53. // A list of asset types of which to take a snapshot for. For example:
  54. // "compute.googleapis.com/Disk". If specified, only matching assets will be
  55. // returned. See [Introduction to Cloud Asset
  56. // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
  57. // for all supported asset types.
  58. repeated string asset_types = 3;
  59. // Asset content type. If not specified, no content but the asset name will
  60. // be returned.
  61. ContentType content_type = 4;
  62. // The maximum number of assets to be returned in a single response. Default
  63. // is 100, minimum is 1, and maximum is 1000.
  64. int32 page_size = 5;
  65. // The `next_page_token` returned from the previous `ListAssetsResponse`, or
  66. // unspecified for the first `ListAssetsRequest`. It is a continuation of a
  67. // prior `ListAssets` call, and the API should return the next page of assets.
  68. string page_token = 6;
  69. }
  70. // Asset content type.
  71. enum ContentType {
  72. // Unspecified content type.
  73. CONTENT_TYPE_UNSPECIFIED = 0;
  74. // Resource metadata.
  75. RESOURCE = 1;
  76. // The actual IAM policy set on a resource.
  77. IAM_POLICY = 2;
  78. // The Cloud Organization Policy set on an asset.
  79. ORG_POLICY = 4;
  80. // The Cloud Access context mananger Policy set on an asset.
  81. ACCESS_POLICY = 5;
  82. }
  83. // ListAssets response.
  84. message ListAssetsResponse {
  85. // Time the snapshot was taken.
  86. google.protobuf.Timestamp read_time = 1;
  87. // Assets.
  88. repeated Asset assets = 2;
  89. // Token to retrieve the next page of results. Set to empty if there are no
  90. // remaining results.
  91. string next_page_token = 3;
  92. }