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