asset_service.proto 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.v1p1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/cloud/asset/v1p1beta1/assets.proto";
  20. option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "AssetServiceProto";
  24. option java_package = "com.google.cloud.asset.v1p1beta1";
  25. option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1";
  26. // Asset service definition.
  27. service AssetService {
  28. option (google.api.default_host) = "cloudasset.googleapis.com";
  29. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  30. // Searches all the resources under a given accessible CRM scope
  31. // (project/folder/organization). This RPC gives callers
  32. // especially admins the ability to search all the resources under a scope,
  33. // even if they don't have .get permission of all the resources. Callers
  34. // should have cloud.assets.SearchAllResources permission on the requested
  35. // scope, otherwise it will be rejected.
  36. rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) {
  37. option (google.api.http) = {
  38. get: "/v1p1beta1/{scope=*/*}/resources:searchAll"
  39. };
  40. option (google.api.method_signature) = "scope,query,asset_types";
  41. }
  42. // Searches all the IAM policies under a given accessible CRM scope
  43. // (project/folder/organization). This RPC gives callers
  44. // especially admins the ability to search all the IAM policies under a scope,
  45. // even if they don't have .getIamPolicy permission of all the IAM policies.
  46. // Callers should have cloud.assets.SearchAllIamPolicies permission on the
  47. // requested scope, otherwise it will be rejected.
  48. rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) {
  49. option (google.api.http) = {
  50. get: "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll"
  51. };
  52. option (google.api.method_signature) = "scope,query";
  53. }
  54. }
  55. // Search all resources request.
  56. message SearchAllResourcesRequest {
  57. // Required. The relative name of an asset. The search is limited to the resources
  58. // within the `scope`. The allowed value must be:
  59. // * Organization number (such as "organizations/123")
  60. // * Folder number(such as "folders/1234")
  61. // * Project number (such as "projects/12345")
  62. // * Project id (such as "projects/abc")
  63. string scope = 1 [(google.api.field_behavior) = REQUIRED];
  64. // Optional. The query statement.
  65. string query = 2 [(google.api.field_behavior) = OPTIONAL];
  66. // Optional. A list of asset types that this request searches for. If empty, it will
  67. // search all the supported asset types.
  68. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL];
  69. // Optional. The page size for search result pagination. Page size is capped at 500 even
  70. // if a larger value is given. If set to zero, server will pick an appropriate
  71. // default. Returned results may be fewer than requested. When this happens,
  72. // there could be more results as long as `next_page_token` is returned.
  73. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
  74. // Optional. If present, then retrieve the next batch of results from the preceding call
  75. // to this method. `page_token` must be the value of `next_page_token` from
  76. // the previous response. The values of all other method parameters, must be
  77. // identical to those in the previous call.
  78. string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
  79. // Optional. A comma separated list of fields specifying the sorting order of the
  80. // results. The default order is ascending. Add " desc" after the field name
  81. // to indicate descending order. Redundant space characters are ignored. For
  82. // example, " foo , bar desc ".
  83. string order_by = 10 [(google.api.field_behavior) = OPTIONAL];
  84. }
  85. // Search all resources response.
  86. message SearchAllResourcesResponse {
  87. // A list of resource that match the search query.
  88. repeated StandardResourceMetadata results = 1;
  89. // If there are more results than those appearing in this response, then
  90. // `next_page_token` is included. To get the next set of results, call this
  91. // method again using the value of `next_page_token` as `page_token`.
  92. string next_page_token = 2;
  93. }
  94. // Search all IAM policies request.
  95. message SearchAllIamPoliciesRequest {
  96. // Required. The relative name of an asset. The search is limited to the resources
  97. // within the `scope`. The allowed value must be:
  98. // * Organization number (such as "organizations/123")
  99. // * Folder number(such as "folders/1234")
  100. // * Project number (such as "projects/12345")
  101. // * Project id (such as "projects/abc")
  102. string scope = 1 [(google.api.field_behavior) = REQUIRED];
  103. // Optional. The query statement.
  104. // Examples:
  105. // * "policy:myuser@mydomain.com"
  106. // * "policy:(myuser@mydomain.com viewer)"
  107. string query = 2 [(google.api.field_behavior) = OPTIONAL];
  108. // Optional. The page size for search result pagination. Page size is capped at 500 even
  109. // if a larger value is given. If set to zero, server will pick an appropriate
  110. // default. Returned results may be fewer than requested. When this happens,
  111. // there could be more results as long as `next_page_token` is returned.
  112. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  113. // Optional. If present, retrieve the next batch of results from the preceding call to
  114. // this method. `page_token` must be the value of `next_page_token` from the
  115. // previous response. The values of all other method parameters must be
  116. // identical to those in the previous call.
  117. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  118. }
  119. // Search all IAM policies response.
  120. message SearchAllIamPoliciesResponse {
  121. // A list of IamPolicy that match the search query. Related information such
  122. // as the associated resource is returned along with the policy.
  123. repeated IamPolicySearchResult results = 1;
  124. // Set if there are more results than those appearing in this response; to get
  125. // the next set of results, call this method again, using this value as the
  126. // `page_token`.
  127. string next_page_token = 2;
  128. }