asset_service.proto 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014
  1. // Copyright 2022 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.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/asset/v1/assets.proto";
  21. import "google/iam/v1/policy.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/duration.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. import "google/protobuf/struct.proto";
  27. import "google/protobuf/timestamp.proto";
  28. import "google/rpc/status.proto";
  29. import "google/type/expr.proto";
  30. option csharp_namespace = "Google.Cloud.Asset.V1";
  31. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset";
  32. option java_multiple_files = true;
  33. option java_outer_classname = "AssetServiceProto";
  34. option java_package = "com.google.cloud.asset.v1";
  35. option php_namespace = "Google\\Cloud\\Asset\\V1";
  36. // Asset service definition.
  37. service AssetService {
  38. option (google.api.default_host) = "cloudasset.googleapis.com";
  39. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  40. // Exports assets with time and resource types to a given Cloud Storage
  41. // location/BigQuery table. For Cloud Storage location destinations, the
  42. // output format is newline-delimited JSON. Each line represents a
  43. // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table
  44. // destinations, the output table stores the fields in asset Protobuf as
  45. // columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API,
  46. // which allows you to keep track of the export. We recommend intervals of at
  47. // least 2 seconds with exponential retry to poll the export operation result.
  48. // For regular-size resource parent, the export operation usually finishes
  49. // within 5 minutes.
  50. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) {
  51. option (google.api.http) = {
  52. post: "/v1/{parent=*/*}:exportAssets"
  53. body: "*"
  54. };
  55. option (google.longrunning.operation_info) = {
  56. response_type: "google.cloud.asset.v1.ExportAssetsResponse"
  57. metadata_type: "google.cloud.asset.v1.ExportAssetsRequest"
  58. };
  59. }
  60. // Lists assets with time and resource types and returns paged results in
  61. // response.
  62. rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) {
  63. option (google.api.http) = {
  64. get: "/v1/{parent=*/*}/assets"
  65. };
  66. option (google.api.method_signature) = "parent";
  67. }
  68. // Batch gets the update history of assets that overlap a time window.
  69. // For IAM_POLICY content, this API outputs history when the asset and its
  70. // attached IAM POLICY both exist. This can create gaps in the output history.
  71. // Otherwise, this API outputs history with asset in both non-delete or
  72. // deleted status.
  73. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT
  74. // error.
  75. rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) {
  76. option (google.api.http) = {
  77. get: "/v1/{parent=*/*}:batchGetAssetsHistory"
  78. };
  79. }
  80. // Creates a feed in a parent project/folder/organization to listen to its
  81. // asset updates.
  82. rpc CreateFeed(CreateFeedRequest) returns (Feed) {
  83. option (google.api.http) = {
  84. post: "/v1/{parent=*/*}/feeds"
  85. body: "*"
  86. };
  87. option (google.api.method_signature) = "parent";
  88. }
  89. // Gets details about an asset feed.
  90. rpc GetFeed(GetFeedRequest) returns (Feed) {
  91. option (google.api.http) = {
  92. get: "/v1/{name=*/*/feeds/*}"
  93. };
  94. option (google.api.method_signature) = "name";
  95. }
  96. // Lists all asset feeds in a parent project/folder/organization.
  97. rpc ListFeeds(ListFeedsRequest) returns (ListFeedsResponse) {
  98. option (google.api.http) = {
  99. get: "/v1/{parent=*/*}/feeds"
  100. };
  101. option (google.api.method_signature) = "parent";
  102. }
  103. // Updates an asset feed configuration.
  104. rpc UpdateFeed(UpdateFeedRequest) returns (Feed) {
  105. option (google.api.http) = {
  106. patch: "/v1/{feed.name=*/*/feeds/*}"
  107. body: "*"
  108. };
  109. option (google.api.method_signature) = "feed";
  110. }
  111. // Deletes an asset feed.
  112. rpc DeleteFeed(DeleteFeedRequest) returns (google.protobuf.Empty) {
  113. option (google.api.http) = {
  114. delete: "/v1/{name=*/*/feeds/*}"
  115. };
  116. option (google.api.method_signature) = "name";
  117. }
  118. // Searches all Cloud resources within the specified scope, such as a project,
  119. // folder, or organization. The caller must be granted the
  120. // `cloudasset.assets.searchAllResources` permission on the desired scope,
  121. // otherwise the request will be rejected.
  122. rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) {
  123. option (google.api.http) = {
  124. get: "/v1/{scope=*/*}:searchAllResources"
  125. };
  126. option (google.api.method_signature) = "scope,query,asset_types";
  127. }
  128. // Searches all IAM policies within the specified scope, such as a project,
  129. // folder, or organization. The caller must be granted the
  130. // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope,
  131. // otherwise the request will be rejected.
  132. rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) {
  133. option (google.api.http) = {
  134. get: "/v1/{scope=*/*}:searchAllIamPolicies"
  135. };
  136. option (google.api.method_signature) = "scope,query";
  137. }
  138. // Analyzes IAM policies to answer which identities have what accesses on
  139. // which resources.
  140. rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) {
  141. option (google.api.http) = {
  142. get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy"
  143. };
  144. }
  145. // Analyzes IAM policies asynchronously to answer which identities have what
  146. // accesses on which resources, and writes the analysis results to a Google
  147. // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the
  148. // output format is the JSON format that represents a
  149. // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the
  150. // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation
  151. // status. We recommend intervals of at least 2 seconds with exponential
  152. // backoff retry to poll the operation result. The metadata contains the
  153. // metadata for the long-running operation.
  154. rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) {
  155. option (google.api.http) = {
  156. post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning"
  157. body: "*"
  158. };
  159. option (google.longrunning.operation_info) = {
  160. response_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse"
  161. metadata_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata"
  162. };
  163. }
  164. // Analyze moving a resource to a specified destination without kicking off
  165. // the actual move. The analysis is best effort depending on the user's
  166. // permissions of viewing different hierarchical policies and configurations.
  167. // The policies and configuration are subject to change before the actual
  168. // resource migration takes place.
  169. rpc AnalyzeMove(AnalyzeMoveRequest) returns (AnalyzeMoveResponse) {
  170. option (google.api.http) = {
  171. get: "/v1/{resource=*/*}:analyzeMove"
  172. };
  173. }
  174. // Issue a job that queries assets using a SQL statement compatible with
  175. // [BigQuery Standard
  176. // SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
  177. //
  178. // If the query execution finishes within timeout and there's no pagination,
  179. // the full query results will be returned in the `QueryAssetsResponse`.
  180. //
  181. // Otherwise, full query results can be obtained by issuing extra requests
  182. // with the `job_reference` from the a previous `QueryAssets` call.
  183. //
  184. // Note, the query result has approximately 10 GB limitation enforced by
  185. // BigQuery
  186. // https://cloud.google.com/bigquery/docs/best-practices-performance-output,
  187. // queries return larger results will result in errors.
  188. rpc QueryAssets(QueryAssetsRequest) returns (QueryAssetsResponse) {
  189. option (google.api.http) = {
  190. post: "/v1/{parent=*/*}:queryAssets"
  191. body: "*"
  192. };
  193. }
  194. // Creates a saved query in a parent project/folder/organization.
  195. rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) {
  196. option (google.api.http) = {
  197. post: "/v1/{parent=*/*}/savedQueries"
  198. body: "saved_query"
  199. };
  200. option (google.api.method_signature) = "parent,saved_query,saved_query_id";
  201. }
  202. // Gets details about a saved query.
  203. rpc GetSavedQuery(GetSavedQueryRequest) returns (SavedQuery) {
  204. option (google.api.http) = {
  205. get: "/v1/{name=*/*/savedQueries/*}"
  206. };
  207. option (google.api.method_signature) = "name";
  208. }
  209. // Lists all saved queries in a parent project/folder/organization.
  210. rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) {
  211. option (google.api.http) = {
  212. get: "/v1/{parent=*/*}/savedQueries"
  213. };
  214. option (google.api.method_signature) = "parent";
  215. }
  216. // Updates a saved query.
  217. rpc UpdateSavedQuery(UpdateSavedQueryRequest) returns (SavedQuery) {
  218. option (google.api.http) = {
  219. patch: "/v1/{saved_query.name=*/*/savedQueries/*}"
  220. body: "saved_query"
  221. };
  222. option (google.api.method_signature) = "saved_query,update_mask";
  223. }
  224. // Deletes a saved query.
  225. rpc DeleteSavedQuery(DeleteSavedQueryRequest) returns (google.protobuf.Empty) {
  226. option (google.api.http) = {
  227. delete: "/v1/{name=*/*/savedQueries/*}"
  228. };
  229. option (google.api.method_signature) = "name";
  230. }
  231. // Gets effective IAM policies for a batch of resources.
  232. rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) returns (BatchGetEffectiveIamPoliciesResponse) {
  233. option (google.api.http) = {
  234. get: "/v1/{scope=*/*}/effectiveIamPolicies:batchGet"
  235. };
  236. }
  237. }
  238. // Represents the metadata of the longrunning operation for the
  239. // AnalyzeIamPolicyLongrunning rpc.
  240. message AnalyzeIamPolicyLongrunningMetadata {
  241. // Output only. The time the operation was created.
  242. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  243. }
  244. // Export asset request.
  245. message ExportAssetsRequest {
  246. // Required. The relative name of the root asset. This can only be an
  247. // organization number (such as "organizations/123"), a project ID (such as
  248. // "projects/my-project-id"), or a project number (such as "projects/12345"),
  249. // or a folder number (such as "folders/123").
  250. string parent = 1 [
  251. (google.api.field_behavior) = REQUIRED,
  252. (google.api.resource_reference) = {
  253. child_type: "cloudasset.googleapis.com/Asset"
  254. }
  255. ];
  256. // Timestamp to take an asset snapshot. This can only be set to a timestamp
  257. // between the current time and the current time minus 35 days (inclusive).
  258. // If not specified, the current time will be used. Due to delays in resource
  259. // data collection and indexing, there is a volatile window during which
  260. // running the same query may get different results.
  261. google.protobuf.Timestamp read_time = 2;
  262. // A list of asset types to take a snapshot for. For example:
  263. // "compute.googleapis.com/Disk".
  264. //
  265. // Regular expressions are also supported. For example:
  266. //
  267. // * "compute.googleapis.com.*" snapshots resources whose asset type starts
  268. // with "compute.googleapis.com".
  269. // * ".*Instance" snapshots resources whose asset type ends with "Instance".
  270. // * ".*Instance.*" snapshots resources whose asset type contains "Instance".
  271. //
  272. // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
  273. // regular expression syntax. If the regular expression does not match any
  274. // supported asset type, an INVALID_ARGUMENT error will be returned.
  275. //
  276. // If specified, only matching assets will be returned, otherwise, it will
  277. // snapshot all asset types. See [Introduction to Cloud Asset
  278. // Inventory](https://cloud.google.com/asset-inventory/docs/overview)
  279. // for all supported asset types.
  280. repeated string asset_types = 3;
  281. // Asset content type. If not specified, no content but the asset name will be
  282. // returned.
  283. ContentType content_type = 4;
  284. // Required. Output configuration indicating where the results will be output to.
  285. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED];
  286. // A list of relationship types to export, for example:
  287. // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
  288. // content_type=RELATIONSHIP.
  289. // * If specified:
  290. // it snapshots specified relationships. It returns an error if
  291. // any of the [relationship_types] doesn't belong to the supported
  292. // relationship types of the [asset_types] or if any of the [asset_types]
  293. // doesn't belong to the source types of the [relationship_types].
  294. // * Otherwise:
  295. // it snapshots the supported relationships for all [asset_types] or returns
  296. // an error if any of the [asset_types] has no relationship support.
  297. // An unspecified asset types field means all supported asset_types.
  298. // See [Introduction to Cloud Asset
  299. // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
  300. // supported asset types and relationship types.
  301. repeated string relationship_types = 6;
  302. }
  303. // The export asset response. This message is returned by the
  304. // [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned
  305. // [google.longrunning.Operation.response][google.longrunning.Operation.response] field.
  306. message ExportAssetsResponse {
  307. // Time the snapshot was taken.
  308. google.protobuf.Timestamp read_time = 1;
  309. // Output configuration indicating where the results were output to.
  310. OutputConfig output_config = 2;
  311. // Output result indicating where the assets were exported to. For example, a
  312. // set of actual Google Cloud Storage object uris where the assets are
  313. // exported to. The uris can be different from what [output_config] has
  314. // specified, as the service will split the output object into multiple ones
  315. // once it exceeds a single Google Cloud Storage object limit.
  316. OutputResult output_result = 3;
  317. }
  318. // ListAssets request.
  319. message ListAssetsRequest {
  320. // Required. Name of the organization, folder, or project the assets belong to. Format:
  321. // "organizations/[organization-number]" (such as "organizations/123"),
  322. // "projects/[project-id]" (such as "projects/my-project-id"),
  323. // "projects/[project-number]" (such as "projects/12345"), or
  324. // "folders/[folder-number]" (such as "folders/12345").
  325. string parent = 1 [
  326. (google.api.field_behavior) = REQUIRED,
  327. (google.api.resource_reference) = {
  328. child_type: "cloudasset.googleapis.com/Asset"
  329. }
  330. ];
  331. // Timestamp to take an asset snapshot. This can only be set to a timestamp
  332. // between the current time and the current time minus 35 days (inclusive).
  333. // If not specified, the current time will be used. Due to delays in resource
  334. // data collection and indexing, there is a volatile window during which
  335. // running the same query may get different results.
  336. google.protobuf.Timestamp read_time = 2;
  337. // A list of asset types to take a snapshot for. For example:
  338. // "compute.googleapis.com/Disk".
  339. //
  340. // Regular expression is also supported. For example:
  341. //
  342. // * "compute.googleapis.com.*" snapshots resources whose asset type starts
  343. // with "compute.googleapis.com".
  344. // * ".*Instance" snapshots resources whose asset type ends with "Instance".
  345. // * ".*Instance.*" snapshots resources whose asset type contains "Instance".
  346. //
  347. // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
  348. // regular expression syntax. If the regular expression does not match any
  349. // supported asset type, an INVALID_ARGUMENT error will be returned.
  350. //
  351. // If specified, only matching assets will be returned, otherwise, it will
  352. // snapshot all asset types. See [Introduction to Cloud Asset
  353. // Inventory](https://cloud.google.com/asset-inventory/docs/overview)
  354. // for all supported asset types.
  355. repeated string asset_types = 3;
  356. // Asset content type. If not specified, no content but the asset name will
  357. // be returned.
  358. ContentType content_type = 4;
  359. // The maximum number of assets to be returned in a single response. Default
  360. // is 100, minimum is 1, and maximum is 1000.
  361. int32 page_size = 5;
  362. // The `next_page_token` returned from the previous `ListAssetsResponse`, or
  363. // unspecified for the first `ListAssetsRequest`. It is a continuation of a
  364. // prior `ListAssets` call, and the API should return the next page of assets.
  365. string page_token = 6;
  366. // A list of relationship types to output, for example:
  367. // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
  368. // content_type=RELATIONSHIP.
  369. // * If specified:
  370. // it snapshots specified relationships. It returns an error if
  371. // any of the [relationship_types] doesn't belong to the supported
  372. // relationship types of the [asset_types] or if any of the [asset_types]
  373. // doesn't belong to the source types of the [relationship_types].
  374. // * Otherwise:
  375. // it snapshots the supported relationships for all [asset_types] or returns
  376. // an error if any of the [asset_types] has no relationship support.
  377. // An unspecified asset types field means all supported asset_types.
  378. // See [Introduction to Cloud Asset
  379. // Inventory](https://cloud.google.com/asset-inventory/docs/overview)
  380. // for all supported asset types and relationship types.
  381. repeated string relationship_types = 7;
  382. }
  383. // ListAssets response.
  384. message ListAssetsResponse {
  385. // Time the snapshot was taken.
  386. google.protobuf.Timestamp read_time = 1;
  387. // Assets.
  388. repeated Asset assets = 2;
  389. // Token to retrieve the next page of results. It expires 72 hours after the
  390. // page token for the first page is generated. Set to empty if there are no
  391. // remaining results.
  392. string next_page_token = 3;
  393. }
  394. // Batch get assets history request.
  395. message BatchGetAssetsHistoryRequest {
  396. // Required. The relative name of the root asset. It can only be an
  397. // organization number (such as "organizations/123"), a project ID (such as
  398. // "projects/my-project-id")", or a project number (such as "projects/12345").
  399. string parent = 1 [
  400. (google.api.field_behavior) = REQUIRED,
  401. (google.api.resource_reference) = {
  402. child_type: "cloudasset.googleapis.com/Asset"
  403. }
  404. ];
  405. // A list of the full names of the assets.
  406. // See: https://cloud.google.com/asset-inventory/docs/resource-name-format
  407. // Example:
  408. //
  409. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  410. //
  411. // The request becomes a no-op if the asset name list is empty, and the max
  412. // size of the asset name list is 100 in one request.
  413. repeated string asset_names = 2;
  414. // Optional. The content type.
  415. ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL];
  416. // Optional. The time window for the asset history. Both start_time and
  417. // end_time are optional and if set, it must be after the current time minus
  418. // 35 days. If end_time is not set, it is default to current timestamp.
  419. // If start_time is not set, the snapshot of the assets at end_time will be
  420. // returned. The returned results contain all temporal assets whose time
  421. // window overlap with read_time_window.
  422. TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL];
  423. // Optional. A list of relationship types to output, for example:
  424. // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
  425. // content_type=RELATIONSHIP.
  426. // * If specified:
  427. // it outputs specified relationships' history on the [asset_names]. It
  428. // returns an error if any of the [relationship_types] doesn't belong to the
  429. // supported relationship types of the [asset_names] or if any of the
  430. // [asset_names]'s types doesn't belong to the source types of the
  431. // [relationship_types].
  432. // * Otherwise:
  433. // it outputs the supported relationships' history on the [asset_names] or
  434. // returns an error if any of the [asset_names]'s types has no relationship
  435. // support.
  436. // See [Introduction to Cloud Asset
  437. // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
  438. // supported asset types and relationship types.
  439. repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL];
  440. }
  441. // Batch get assets history response.
  442. message BatchGetAssetsHistoryResponse {
  443. // A list of assets with valid time windows.
  444. repeated TemporalAsset assets = 1;
  445. }
  446. // Create asset feed request.
  447. message CreateFeedRequest {
  448. // Required. The name of the project/folder/organization where this feed
  449. // should be created in. It can only be an organization number (such as
  450. // "organizations/123"), a folder number (such as "folders/123"), a project ID
  451. // (such as "projects/my-project-id")", or a project number (such as
  452. // "projects/12345").
  453. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  454. // Required. This is the client-assigned asset feed identifier and it needs to
  455. // be unique under a specific parent project/folder/organization.
  456. string feed_id = 2 [(google.api.field_behavior) = REQUIRED];
  457. // Required. The feed details. The field `name` must be empty and it will be generated
  458. // in the format of:
  459. // projects/project_number/feeds/feed_id
  460. // folders/folder_number/feeds/feed_id
  461. // organizations/organization_number/feeds/feed_id
  462. Feed feed = 3 [(google.api.field_behavior) = REQUIRED];
  463. }
  464. // Get asset feed request.
  465. message GetFeedRequest {
  466. // Required. The name of the Feed and it must be in the format of:
  467. // projects/project_number/feeds/feed_id
  468. // folders/folder_number/feeds/feed_id
  469. // organizations/organization_number/feeds/feed_id
  470. string name = 1 [
  471. (google.api.field_behavior) = REQUIRED,
  472. (google.api.resource_reference) = {
  473. type: "cloudasset.googleapis.com/Feed"
  474. }
  475. ];
  476. }
  477. // List asset feeds request.
  478. message ListFeedsRequest {
  479. // Required. The parent project/folder/organization whose feeds are to be
  480. // listed. It can only be using project/folder/organization number (such as
  481. // "folders/12345")", or a project ID (such as "projects/my-project-id").
  482. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  483. }
  484. message ListFeedsResponse {
  485. // A list of feeds.
  486. repeated Feed feeds = 1;
  487. }
  488. // Update asset feed request.
  489. message UpdateFeedRequest {
  490. // Required. The new values of feed details. It must match an existing feed and the
  491. // field `name` must be in the format of:
  492. // projects/project_number/feeds/feed_id or
  493. // folders/folder_number/feeds/feed_id or
  494. // organizations/organization_number/feeds/feed_id.
  495. Feed feed = 1 [(google.api.field_behavior) = REQUIRED];
  496. // Required. Only updates the `feed` fields indicated by this mask.
  497. // The field mask must not be empty, and it must not contain fields that
  498. // are immutable or only set by the server.
  499. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  500. }
  501. message DeleteFeedRequest {
  502. // Required. The name of the feed and it must be in the format of:
  503. // projects/project_number/feeds/feed_id
  504. // folders/folder_number/feeds/feed_id
  505. // organizations/organization_number/feeds/feed_id
  506. string name = 1 [
  507. (google.api.field_behavior) = REQUIRED,
  508. (google.api.resource_reference) = {
  509. type: "cloudasset.googleapis.com/Feed"
  510. }
  511. ];
  512. }
  513. // Output configuration for export assets destination.
  514. message OutputConfig {
  515. // Asset export destination.
  516. oneof destination {
  517. // Destination on Cloud Storage.
  518. GcsDestination gcs_destination = 1;
  519. // Destination on BigQuery. The output table stores the fields in asset
  520. // Protobuf as columns in BigQuery.
  521. BigQueryDestination bigquery_destination = 2;
  522. }
  523. }
  524. // Output result of export assets.
  525. message OutputResult {
  526. // Asset export result.
  527. oneof result {
  528. // Export result on Cloud Storage.
  529. GcsOutputResult gcs_result = 1;
  530. }
  531. }
  532. // A Cloud Storage output result.
  533. message GcsOutputResult {
  534. // List of uris of the Cloud Storage objects. Example:
  535. // "gs://bucket_name/object_name".
  536. repeated string uris = 1;
  537. }
  538. // A Cloud Storage location.
  539. message GcsDestination {
  540. // Required.
  541. oneof object_uri {
  542. // The uri of the Cloud Storage object. It's the same uri that is used by
  543. // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
  544. // Editing Object
  545. // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
  546. // for more information.
  547. //
  548. // If the specified Cloud Storage object already exists and there is no
  549. // [hold](https://cloud.google.com/storage/docs/object-holds), it will be
  550. // overwritten with the exported result.
  551. string uri = 1;
  552. // The uri prefix of all generated Cloud Storage objects. Example:
  553. // "gs://bucket_name/object_name_prefix". Each object uri is in format:
  554. // "gs://bucket_name/object_name_prefix/<asset type>/<shard number> and only
  555. // contains assets for that type. <shard number> starts from 0. Example:
  556. // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
  557. // the first shard of output objects containing all
  558. // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
  559. // returned if file with the same name "gs://bucket_name/object_name_prefix"
  560. // already exists.
  561. string uri_prefix = 2;
  562. }
  563. }
  564. // A BigQuery destination for exporting assets to.
  565. message BigQueryDestination {
  566. // Required. The BigQuery dataset in format
  567. // "projects/projectId/datasets/datasetId", to which the snapshot result
  568. // should be exported. If this dataset does not exist, the export call returns
  569. // an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets`
  570. // determines the
  571. // [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema)
  572. // of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also
  573. // influences the schema.
  574. string dataset = 1 [(google.api.field_behavior) = REQUIRED];
  575. // Required. The BigQuery table to which the snapshot result should be
  576. // written. If this table does not exist, a new table with the given name
  577. // will be created.
  578. string table = 2 [(google.api.field_behavior) = REQUIRED];
  579. // If the destination table already exists and this flag is `TRUE`, the
  580. // table will be overwritten by the contents of assets snapshot. If the flag
  581. // is `FALSE` or unset and the destination table already exists, the export
  582. // call returns an INVALID_ARGUMEMT error.
  583. bool force = 3;
  584. // [partition_spec] determines whether to export to partitioned table(s) and
  585. // how to partition the data.
  586. //
  587. // If [partition_spec] is unset or [partition_spec.partition_key] is unset or
  588. // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
  589. // non-partitioned table(s). [force] will decide whether to overwrite existing
  590. // table(s).
  591. //
  592. // If [partition_spec] is specified. First, the snapshot results will be
  593. // written to partitioned table(s) with two additional timestamp columns,
  594. // readTime and requestTime, one of which will be the partition key. Secondly,
  595. // in the case when any destination table already exists, it will first try to
  596. // update existing table's schema as necessary by appending additional
  597. // columns. Then, if [force] is `TRUE`, the corresponding partition will be
  598. // overwritten by the snapshot results (data in different partitions will
  599. // remain intact); if [force] is unset or `FALSE`, it will append the data. An
  600. // error will be returned if the schema update or data appension fails.
  601. PartitionSpec partition_spec = 4;
  602. // If this flag is `TRUE`, the snapshot results will be written to one or
  603. // multiple tables, each of which contains results of one asset type. The
  604. // [force] and [partition_spec] fields will apply to each of them.
  605. //
  606. // Field [table] will be concatenated with "_" and the asset type names (see
  607. // https://cloud.google.com/asset-inventory/docs/supported-asset-types for
  608. // supported asset types) to construct per-asset-type table names, in which
  609. // all non-alphanumeric characters like "." and "/" will be substituted by
  610. // "_". Example: if field [table] is "mytable" and snapshot results
  611. // contain "storage.googleapis.com/Bucket" assets, the corresponding table
  612. // name will be "mytable_storage_googleapis_com_Bucket". If any of these
  613. // tables does not exist, a new table with the concatenated name will be
  614. // created.
  615. //
  616. // When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
  617. // each table will include RECORD-type columns mapped to the nested fields in
  618. // the Asset.resource.data field of that asset type (up to the 15 nested level
  619. // BigQuery supports
  620. // (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
  621. // fields in >15 nested levels will be stored in JSON format string as a child
  622. // column of its parent RECORD column.
  623. //
  624. // If error occurs when exporting to any table, the whole export call will
  625. // return an error but the export results that already succeed will persist.
  626. // Example: if exporting to table_type_A succeeds when exporting to
  627. // table_type_B fails during one export call, the results in table_type_A will
  628. // persist and there will not be partial results persisting in a table.
  629. bool separate_tables_per_asset_type = 5;
  630. }
  631. // Specifications of BigQuery partitioned table as export destination.
  632. message PartitionSpec {
  633. // This enum is used to determine the partition key column when exporting
  634. // assets to BigQuery partitioned table(s). Note that, if the partition key is
  635. // a timestamp column, the actual partition is based on its date value
  636. // (expressed in UTC. see details in
  637. // https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables).
  638. enum PartitionKey {
  639. // Unspecified partition key. If used, it means using non-partitioned table.
  640. PARTITION_KEY_UNSPECIFIED = 0;
  641. // The time when the snapshot is taken. If specified as partition key, the
  642. // result table(s) is partitoned by the additional timestamp column,
  643. // readTime. If [read_time] in ExportAssetsRequest is specified, the
  644. // readTime column's value will be the same as it. Otherwise, its value will
  645. // be the current time that is used to take the snapshot.
  646. READ_TIME = 1;
  647. // The time when the request is received and started to be processed. If
  648. // specified as partition key, the result table(s) is partitoned by the
  649. // requestTime column, an additional timestamp column representing when the
  650. // request was received.
  651. REQUEST_TIME = 2;
  652. }
  653. // The partition key for BigQuery partitioned table.
  654. PartitionKey partition_key = 1;
  655. }
  656. // A Pub/Sub destination.
  657. message PubsubDestination {
  658. // The name of the Pub/Sub topic to publish to.
  659. // Example: `projects/PROJECT_ID/topics/TOPIC_ID`.
  660. string topic = 1;
  661. }
  662. // Output configuration for asset feed destination.
  663. message FeedOutputConfig {
  664. // Asset feed destination.
  665. oneof destination {
  666. // Destination on Pub/Sub.
  667. PubsubDestination pubsub_destination = 1;
  668. }
  669. }
  670. // An asset feed used to export asset updates to a destinations.
  671. // An asset feed filter controls what updates are exported.
  672. // The asset feed must be created within a project, organization, or
  673. // folder. Supported destinations are:
  674. // Pub/Sub topics.
  675. message Feed {
  676. option (google.api.resource) = {
  677. type: "cloudasset.googleapis.com/Feed"
  678. pattern: "projects/{project}/feeds/{feed}"
  679. pattern: "folders/{folder}/feeds/{feed}"
  680. pattern: "organizations/{organization}/feeds/{feed}"
  681. history: ORIGINALLY_SINGLE_PATTERN
  682. };
  683. // Required. The format will be
  684. // projects/{project_number}/feeds/{client-assigned_feed_identifier} or
  685. // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or
  686. // organizations/{organization_number}/feeds/{client-assigned_feed_identifier}
  687. //
  688. // The client-assigned feed identifier must be unique within the parent
  689. // project/folder/organization.
  690. string name = 1 [(google.api.field_behavior) = REQUIRED];
  691. // A list of the full names of the assets to receive updates. You must specify
  692. // either or both of asset_names and asset_types. Only asset updates matching
  693. // specified asset_names or asset_types are exported to the feed.
  694. // Example:
  695. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  696. // For a list of the full names for supported asset types, see [Resource
  697. // name format](/asset-inventory/docs/resource-name-format).
  698. repeated string asset_names = 2;
  699. // A list of types of the assets to receive updates. You must specify either
  700. // or both of asset_names and asset_types. Only asset updates matching
  701. // specified asset_names or asset_types are exported to the feed.
  702. // Example: `"compute.googleapis.com/Disk"`
  703. //
  704. // For a list of all supported asset types, see
  705. // [Supported asset types](/asset-inventory/docs/supported-asset-types).
  706. repeated string asset_types = 3;
  707. // Asset content type. If not specified, no content but the asset name and
  708. // type will be returned.
  709. ContentType content_type = 4;
  710. // Required. Feed output configuration defining where the asset updates are
  711. // published to.
  712. FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED];
  713. // A condition which determines whether an asset update should be published.
  714. // If specified, an asset will be returned only when the expression evaluates
  715. // to true.
  716. // When set, `expression` field in the `Expr` must be a valid [CEL expression]
  717. // (https://github.com/google/cel-spec) on a TemporalAsset with name
  718. // `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted
  719. // == true") will only publish Asset deletions. Other fields of `Expr` are
  720. // optional.
  721. //
  722. // See our [user
  723. // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition)
  724. // for detailed instructions.
  725. google.type.Expr condition = 6;
  726. // A list of relationship types to output, for example:
  727. // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
  728. // content_type=RELATIONSHIP.
  729. // * If specified:
  730. // it outputs specified relationship updates on the [asset_names] or the
  731. // [asset_types]. It returns an error if any of the [relationship_types]
  732. // doesn't belong to the supported relationship types of the [asset_names] or
  733. // [asset_types], or any of the [asset_names] or the [asset_types] doesn't
  734. // belong to the source types of the [relationship_types].
  735. // * Otherwise:
  736. // it outputs the supported relationships of the types of [asset_names] and
  737. // [asset_types] or returns an error if any of the [asset_names] or the
  738. // [asset_types] has no replationship support.
  739. // See [Introduction to Cloud Asset
  740. // Inventory](https://cloud.google.com/asset-inventory/docs/overview)
  741. // for all supported asset types and relationship types.
  742. repeated string relationship_types = 7;
  743. }
  744. // Search all resources request.
  745. message SearchAllResourcesRequest {
  746. // Required. A scope can be a project, a folder, or an organization. The search is
  747. // limited to the resources within the `scope`. The caller must be granted the
  748. // [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
  749. // permission on the desired scope.
  750. //
  751. // The allowed values are:
  752. //
  753. // * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  754. // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  755. // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  756. // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
  757. string scope = 1 [(google.api.field_behavior) = REQUIRED];
  758. // Optional. The query statement. See [how to construct a
  759. // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
  760. // for more information. If not specified or empty, it will search all the
  761. // resources within the specified `scope`.
  762. //
  763. // Examples:
  764. //
  765. // * `name:Important` to find Cloud resources whose name contains
  766. // "Important" as a word.
  767. // * `name=Important` to find the Cloud resource whose name is exactly
  768. // "Important".
  769. // * `displayName:Impor*` to find Cloud resources whose display name
  770. // contains "Impor" as a prefix of any word in the field.
  771. // * `location:us-west*` to find Cloud resources whose location contains both
  772. // "us" and "west" as prefixes.
  773. // * `labels:prod` to find Cloud resources whose labels contain "prod" as
  774. // a key or value.
  775. // * `labels.env:prod` to find Cloud resources that have a label "env"
  776. // and its value is "prod".
  777. // * `labels.env:*` to find Cloud resources that have a label "env".
  778. // * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
  779. // encryption key whose name contains "key" as a word. This field is
  780. // deprecated. Please use the `kmsKeys` field to retrieve KMS key
  781. // information.
  782. // * `kmsKeys:key` to find Cloud resources encrypted with customer-managed
  783. // encryption keys whose name contains the word "key".
  784. // * `relationships:instance-group-1` to find Cloud resources that have
  785. // relationships with "instance-group-1" in the related resource name.
  786. // * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that
  787. // have relationships of type "INSTANCE_TO_INSTANCEGROUP".
  788. // * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
  789. // compute instances that have relationships with "instance-group-1" in the
  790. // compute instance group resource name, for relationship type
  791. // "INSTANCE_TO_INSTANCEGROUP".
  792. // * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
  793. // word.
  794. // * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
  795. // "ACTIVE" as a word.
  796. // * `createTime<1609459200` to find Cloud resources that were created before
  797. // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
  798. // "2021-01-01 00:00:00 UTC" in seconds.
  799. // * `updateTime>1609459200` to find Cloud resources that were updated after
  800. // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
  801. // "2021-01-01 00:00:00 UTC" in seconds.
  802. // * `Important` to find Cloud resources that contain "Important" as a word
  803. // in any of the searchable fields.
  804. // * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any
  805. // word in any of the searchable fields.
  806. // * `Important location:(us-west1 OR global)` to find Cloud
  807. // resources that contain "Important" as a word in any of the searchable
  808. // fields and are also located in the "us-west1" region or the "global"
  809. // location.
  810. string query = 2 [(google.api.field_behavior) = OPTIONAL];
  811. // Optional. A list of asset types that this request searches for. If empty, it will
  812. // search all the [searchable asset
  813. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
  814. //
  815. // Regular expressions are also supported. For example:
  816. //
  817. // * "compute.googleapis.com.*" snapshots resources whose asset type starts
  818. // with "compute.googleapis.com".
  819. // * ".*Instance" snapshots resources whose asset type ends with "Instance".
  820. // * ".*Instance.*" snapshots resources whose asset type contains "Instance".
  821. //
  822. // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
  823. // regular expression syntax. If the regular expression does not match any
  824. // supported asset type, an INVALID_ARGUMENT error will be returned.
  825. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL];
  826. // Optional. The page size for search result pagination. Page size is capped at 500 even
  827. // if a larger value is given. If set to zero, server will pick an appropriate
  828. // default. Returned results may be fewer than requested. When this happens,
  829. // there could be more results as long as `next_page_token` is returned.
  830. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
  831. // Optional. If present, then retrieve the next batch of results from the preceding call
  832. // to this method. `page_token` must be the value of `next_page_token` from
  833. // the previous response. The values of all other method parameters, must be
  834. // identical to those in the previous call.
  835. string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
  836. // Optional. A comma-separated list of fields specifying the sorting order of the
  837. // results. The default order is ascending. Add " DESC" after the field name
  838. // to indicate descending order. Redundant space characters are ignored.
  839. // Example: "location DESC, name".
  840. // Only singular primitive fields in the response are sortable:
  841. //
  842. // * name
  843. // * assetType
  844. // * project
  845. // * displayName
  846. // * description
  847. // * location
  848. // * createTime
  849. // * updateTime
  850. // * state
  851. // * parentFullResourceName
  852. // * parentAssetType
  853. //
  854. // All the other fields such as repeated fields (e.g., `networkTags`,
  855. // `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g.,
  856. // `additionalAttributes`) are not supported.
  857. string order_by = 6 [(google.api.field_behavior) = OPTIONAL];
  858. // Optional. A comma-separated list of fields specifying which fields to be returned in
  859. // ResourceSearchResult. Only '*' or combination of top level fields can be
  860. // specified. Field names of both snake_case and camelCase are supported.
  861. // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
  862. //
  863. // The read_mask paths must be valid field paths listed but not limited to
  864. // (both snake_case and camelCase are supported):
  865. //
  866. // * name
  867. // * assetType
  868. // * project
  869. // * displayName
  870. // * description
  871. // * location
  872. // * tagKeys
  873. // * tagValues
  874. // * tagValueIds
  875. // * labels
  876. // * networkTags
  877. // * kmsKey (This field is deprecated. Please use the `kmsKeys` field to
  878. // retrieve KMS key information.)
  879. // * kmsKeys
  880. // * createTime
  881. // * updateTime
  882. // * state
  883. // * additionalAttributes
  884. // * versionedResources
  885. //
  886. // If read_mask is not specified, all fields except versionedResources will
  887. // be returned.
  888. // If only '*' is specified, all fields including versionedResources will be
  889. // returned.
  890. // Any invalid field path will trigger INVALID_ARGUMENT error.
  891. google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior) = OPTIONAL];
  892. }
  893. // Search all resources response.
  894. message SearchAllResourcesResponse {
  895. // A list of Resources that match the search query. It contains the resource
  896. // standard metadata information.
  897. repeated ResourceSearchResult results = 1;
  898. // If there are more results than those appearing in this response, then
  899. // `next_page_token` is included. To get the next set of results, call this
  900. // method again using the value of `next_page_token` as `page_token`.
  901. string next_page_token = 2;
  902. }
  903. // Search all IAM policies request.
  904. message SearchAllIamPoliciesRequest {
  905. // Required. A scope can be a project, a folder, or an organization. The search is
  906. // limited to the IAM policies within the `scope`. The caller must be granted
  907. // the
  908. // [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
  909. // permission on the desired scope.
  910. //
  911. // The allowed values are:
  912. //
  913. // * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  914. // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  915. // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  916. // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
  917. string scope = 1 [(google.api.field_behavior) = REQUIRED];
  918. // Optional. The query statement. See [how to construct a
  919. // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
  920. // for more information. If not specified or empty, it will search all the
  921. // IAM policies within the specified `scope`. Note that the query string is
  922. // compared against each Cloud IAM policy binding, including its principals,
  923. // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
  924. // contain the bindings that match your query. To learn more about the IAM
  925. // policy structure, see the [IAM policy
  926. // documentation](https://cloud.google.com/iam/help/allow-policies/structure).
  927. //
  928. // Examples:
  929. //
  930. // * `policy:amy@gmail.com` to find IAM policy bindings that specify user
  931. // "amy@gmail.com".
  932. // * `policy:roles/compute.admin` to find IAM policy bindings that specify
  933. // the Compute Admin role.
  934. // * `policy:comp*` to find IAM policy bindings that contain "comp" as a
  935. // prefix of any word in the binding.
  936. // * `policy.role.permissions:storage.buckets.update` to find IAM policy
  937. // bindings that specify a role containing "storage.buckets.update"
  938. // permission. Note that if callers don't have `iam.roles.get` access to a
  939. // role's included permissions, policy bindings that specify this role will
  940. // be dropped from the search results.
  941. // * `policy.role.permissions:upd*` to find IAM policy bindings that specify a
  942. // role containing "upd" as a prefix of any word in the role permission.
  943. // Note that if callers don't have `iam.roles.get` access to a role's
  944. // included permissions, policy bindings that specify this role will be
  945. // dropped from the search results.
  946. // * `resource:organizations/123456` to find IAM policy bindings
  947. // that are set on "organizations/123456".
  948. // * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to
  949. // find IAM policy bindings that are set on the project named "myproject".
  950. // * `Important` to find IAM policy bindings that contain "Important" as a
  951. // word in any of the searchable fields (except for the included
  952. // permissions).
  953. // * `resource:(instance1 OR instance2) policy:amy` to find
  954. // IAM policy bindings that are set on resources "instance1" or
  955. // "instance2" and also specify user "amy".
  956. // * `roles:roles/compute.admin` to find IAM policy bindings that specify the
  957. // Compute Admin role.
  958. // * `memberTypes:user` to find IAM policy bindings that contain the
  959. // principal type "user".
  960. string query = 2 [(google.api.field_behavior) = OPTIONAL];
  961. // Optional. The page size for search result pagination. Page size is capped at 500 even
  962. // if a larger value is given. If set to zero, server will pick an appropriate
  963. // default. Returned results may be fewer than requested. When this happens,
  964. // there could be more results as long as `next_page_token` is returned.
  965. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  966. // Optional. If present, retrieve the next batch of results from the preceding call to
  967. // this method. `page_token` must be the value of `next_page_token` from the
  968. // previous response. The values of all other method parameters must be
  969. // identical to those in the previous call.
  970. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  971. // Optional. A list of asset types that the IAM policies are attached to. If empty, it
  972. // will search the IAM policies that are attached to all the [searchable asset
  973. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
  974. //
  975. // Regular expressions are also supported. For example:
  976. //
  977. // * "compute.googleapis.com.*" snapshots IAM policies attached to asset type
  978. // starts with "compute.googleapis.com".
  979. // * ".*Instance" snapshots IAM policies attached to asset type ends with
  980. // "Instance".
  981. // * ".*Instance.*" snapshots IAM policies attached to asset type contains
  982. // "Instance".
  983. //
  984. // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
  985. // regular expression syntax. If the regular expression does not match any
  986. // supported asset type, an INVALID_ARGUMENT error will be returned.
  987. repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL];
  988. // Optional. A comma-separated list of fields specifying the sorting order of the
  989. // results. The default order is ascending. Add " DESC" after the field name
  990. // to indicate descending order. Redundant space characters are ignored.
  991. // Example: "assetType DESC, resource".
  992. // Only singular primitive fields in the response are sortable:
  993. // * resource
  994. // * assetType
  995. // * project
  996. // All the other fields such as repeated fields (e.g., `folders`) and
  997. // non-primitive fields (e.g., `policy`) are not supported.
  998. string order_by = 7 [(google.api.field_behavior) = OPTIONAL];
  999. }
  1000. // Search all IAM policies response.
  1001. message SearchAllIamPoliciesResponse {
  1002. // A list of IamPolicy that match the search query. Related information such
  1003. // as the associated resource is returned along with the policy.
  1004. repeated IamPolicySearchResult results = 1;
  1005. // Set if there are more results than those appearing in this response; to get
  1006. // the next set of results, call this method again, using this value as the
  1007. // `page_token`.
  1008. string next_page_token = 2;
  1009. }
  1010. // IAM policy analysis query message.
  1011. message IamPolicyAnalysisQuery {
  1012. // Specifies the resource to analyze for access policies, which may be set
  1013. // directly on the resource, or on ancestors such as organizations, folders or
  1014. // projects.
  1015. message ResourceSelector {
  1016. // Required. The [full resource name]
  1017. // (https://cloud.google.com/asset-inventory/docs/resource-name-format)
  1018. // of a resource of [supported resource
  1019. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types).
  1020. string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED];
  1021. }
  1022. // Specifies an identity for which to determine resource access, based on
  1023. // roles assigned either directly to them or to the groups they belong to,
  1024. // directly or indirectly.
  1025. message IdentitySelector {
  1026. // Required. The identity appear in the form of principals in
  1027. // [IAM policy
  1028. // binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
  1029. //
  1030. // The examples of supported forms are:
  1031. // "user:mike@example.com",
  1032. // "group:admins@example.com",
  1033. // "domain:google.com",
  1034. // "serviceAccount:my-project-id@appspot.gserviceaccount.com".
  1035. //
  1036. // Notice that wildcard characters (such as * and ?) are not supported.
  1037. // You must give a specific identity.
  1038. string identity = 1 [(google.api.field_behavior) = REQUIRED];
  1039. }
  1040. // Specifies roles and/or permissions to analyze, to determine both the
  1041. // identities possessing them and the resources they control. If multiple
  1042. // values are specified, results will include roles or permissions matching
  1043. // any of them. The total number of roles and permissions should be equal or
  1044. // less than 10.
  1045. message AccessSelector {
  1046. // Optional. The roles to appear in result.
  1047. repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL];
  1048. // Optional. The permissions to appear in result.
  1049. repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL];
  1050. }
  1051. // Contains query options.
  1052. message Options {
  1053. // Optional. If true, the identities section of the result will expand any
  1054. // Google groups appearing in an IAM policy binding.
  1055. //
  1056. // If [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] is specified, the
  1057. // identity in the result will be determined by the selector, and this flag
  1058. // is not allowed to set.
  1059. //
  1060. // If true, the default max expansion per group is 1000 for
  1061. // AssetService.AnalyzeIamPolicy][].
  1062. //
  1063. // Default is false.
  1064. bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL];
  1065. // Optional. If true, the access section of result will expand any roles
  1066. // appearing in IAM policy bindings to include their permissions.
  1067. //
  1068. // If [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] is specified, the access
  1069. // section of the result will be determined by the selector, and this flag
  1070. // is not allowed to set.
  1071. //
  1072. // Default is false.
  1073. bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL];
  1074. // Optional. If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is not
  1075. // specified, the resource section of the result will expand any resource
  1076. // attached to an IAM policy to include resources lower in the resource
  1077. // hierarchy.
  1078. //
  1079. // For example, if the request analyzes for which resources user A has
  1080. // permission P, and the results include an IAM policy with P on a GCP
  1081. // folder, the results will also include resources in that folder with
  1082. // permission P.
  1083. //
  1084. // If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is specified,
  1085. // the resource section of the result will expand the specified resource to
  1086. // include resources lower in the resource hierarchy. Only project or
  1087. // lower resources are supported. Folder and organization resource cannot be
  1088. // used together with this option.
  1089. //
  1090. // For example, if the request analyzes for which users have permission P on
  1091. // a GCP project with this option enabled, the results will include all
  1092. // users who have permission P on that project or any lower resource.
  1093. //
  1094. // If true, the default max expansion per resource is 1000 for
  1095. // AssetService.AnalyzeIamPolicy][] and 100000 for
  1096. // AssetService.AnalyzeIamPolicyLongrunning][].
  1097. //
  1098. // Default is false.
  1099. bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL];
  1100. // Optional. If true, the result will output the relevant parent/child relationships
  1101. // between resources.
  1102. // Default is false.
  1103. bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL];
  1104. // Optional. If true, the result will output the relevant membership relationships
  1105. // between groups and other groups, and between groups and principals.
  1106. // Default is false.
  1107. bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL];
  1108. // Optional. If true, the response will include access analysis from identities to
  1109. // resources via service account impersonation. This is a very expensive
  1110. // operation, because many derived queries will be executed. We highly
  1111. // recommend you use [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc
  1112. // instead.
  1113. //
  1114. // For example, if the request analyzes for which resources user A has
  1115. // permission P, and there's an IAM policy states user A has
  1116. // iam.serviceAccounts.getAccessToken permission to a service account SA,
  1117. // and there's another IAM policy states service account SA has permission P
  1118. // to a GCP folder F, then user A potentially has access to the GCP folder
  1119. // F. And those advanced analysis results will be included in
  1120. // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis].
  1121. //
  1122. // Another example, if the request analyzes for who has
  1123. // permission P to a GCP folder F, and there's an IAM policy states user A
  1124. // has iam.serviceAccounts.actAs permission to a service account SA, and
  1125. // there's another IAM policy states service account SA has permission P to
  1126. // the GCP folder F, then user A potentially has access to the GCP folder
  1127. // F. And those advanced analysis results will be included in
  1128. // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis].
  1129. //
  1130. // Only the following permissions are considered in this analysis:
  1131. //
  1132. // * `iam.serviceAccounts.actAs`
  1133. // * `iam.serviceAccounts.signBlob`
  1134. // * `iam.serviceAccounts.signJwt`
  1135. // * `iam.serviceAccounts.getAccessToken`
  1136. // * `iam.serviceAccounts.getOpenIdToken`
  1137. // * `iam.serviceAccounts.implicitDelegation`
  1138. //
  1139. // Default is false.
  1140. bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL];
  1141. }
  1142. // The IAM conditions context.
  1143. message ConditionContext {
  1144. // The IAM conditions time context.
  1145. oneof TimeContext {
  1146. // The hypothetical access timestamp to evaluate IAM conditions. Note that
  1147. // this value must not be earlier than the current time; otherwise, an
  1148. // INVALID_ARGUMENT error will be returned.
  1149. google.protobuf.Timestamp access_time = 1;
  1150. }
  1151. }
  1152. // Required. The relative name of the root asset. Only resources and IAM policies within
  1153. // the scope will be analyzed.
  1154. //
  1155. // This can only be an organization number (such as "organizations/123"), a
  1156. // folder number (such as "folders/123"), a project ID (such as
  1157. // "projects/my-project-id"), or a project number (such as "projects/12345").
  1158. //
  1159. // To know how to get organization id, visit [here
  1160. // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
  1161. //
  1162. // To know how to get folder or project id, visit [here
  1163. // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects).
  1164. string scope = 1 [(google.api.field_behavior) = REQUIRED];
  1165. // Optional. Specifies a resource for analysis.
  1166. ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL];
  1167. // Optional. Specifies an identity for analysis.
  1168. IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL];
  1169. // Optional. Specifies roles or permissions for analysis. This is optional.
  1170. AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL];
  1171. // Optional. The query options.
  1172. Options options = 5 [(google.api.field_behavior) = OPTIONAL];
  1173. // Optional. The hypothetical context for IAM conditions evaluation.
  1174. ConditionContext condition_context = 6 [(google.api.field_behavior) = OPTIONAL];
  1175. }
  1176. // A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy].
  1177. message AnalyzeIamPolicyRequest {
  1178. // Required. The request query.
  1179. IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED];
  1180. // Optional. The name of a saved query, which must be in the format of:
  1181. //
  1182. // * projects/project_number/savedQueries/saved_query_id
  1183. // * folders/folder_number/savedQueries/saved_query_id
  1184. // * organizations/organization_number/savedQueries/saved_query_id
  1185. //
  1186. // If both `analysis_query` and `saved_analysis_query` are provided, they
  1187. // will be merged together with the `saved_analysis_query` as base and
  1188. // the `analysis_query` as overrides. For more details of the merge behavior,
  1189. // please refer to the
  1190. // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
  1191. // page.
  1192. //
  1193. // Note that you cannot override primitive fields with default value, such as
  1194. // 0 or empty string, etc., because we use proto3, which doesn't support field
  1195. // presence yet.
  1196. string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL];
  1197. // Optional. Amount of time executable has to complete. See JSON representation of
  1198. // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json).
  1199. //
  1200. // If this field is set with a value less than the RPC deadline, and the
  1201. // execution of your query hasn't finished in the specified
  1202. // execution timeout, you will get a response with partial result.
  1203. // Otherwise, your query's execution will continue until the RPC deadline.
  1204. // If it's not finished until then, you will get a DEADLINE_EXCEEDED error.
  1205. //
  1206. // Default is empty.
  1207. google.protobuf.Duration execution_timeout = 2 [(google.api.field_behavior) = OPTIONAL];
  1208. }
  1209. // A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy].
  1210. message AnalyzeIamPolicyResponse {
  1211. // An analysis message to group the query and results.
  1212. message IamPolicyAnalysis {
  1213. // The analysis query.
  1214. IamPolicyAnalysisQuery analysis_query = 1;
  1215. // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] that matches the analysis query, or
  1216. // empty if no result is found.
  1217. repeated IamPolicyAnalysisResult analysis_results = 2;
  1218. // Represents whether all entries in the [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been
  1219. // fully explored to answer the query.
  1220. bool fully_explored = 3;
  1221. // A list of non-critical errors happened during the query handling.
  1222. repeated IamPolicyAnalysisState non_critical_errors = 5;
  1223. }
  1224. // The main analysis that matches the original request.
  1225. IamPolicyAnalysis main_analysis = 1;
  1226. // The service account impersonation analysis if
  1227. // [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
  1228. // enabled.
  1229. repeated IamPolicyAnalysis service_account_impersonation_analysis = 2;
  1230. // Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and
  1231. // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to
  1232. // answer the query in the request.
  1233. bool fully_explored = 3;
  1234. }
  1235. // Output configuration for export IAM policy analysis destination.
  1236. message IamPolicyAnalysisOutputConfig {
  1237. // A Cloud Storage location.
  1238. message GcsDestination {
  1239. // Required. The uri of the Cloud Storage object. It's the same uri that is used by
  1240. // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
  1241. // Editing Object
  1242. // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
  1243. // for more information.
  1244. //
  1245. // If the specified Cloud Storage object already exists and there is no
  1246. // [hold](https://cloud.google.com/storage/docs/object-holds), it will be
  1247. // overwritten with the analysis result.
  1248. string uri = 1 [(google.api.field_behavior) = REQUIRED];
  1249. }
  1250. // A BigQuery destination.
  1251. message BigQueryDestination {
  1252. // This enum determines the partition key column for the bigquery tables.
  1253. // Partitioning can improve query performance and reduce query cost by
  1254. // filtering partitions. Refer to
  1255. // https://cloud.google.com/bigquery/docs/partitioned-tables for details.
  1256. enum PartitionKey {
  1257. // Unspecified partition key. Tables won't be partitioned using this
  1258. // option.
  1259. PARTITION_KEY_UNSPECIFIED = 0;
  1260. // The time when the request is received. If specified as partition key,
  1261. // the result table(s) is partitoned by the RequestTime column, an
  1262. // additional timestamp column representing when the request was received.
  1263. REQUEST_TIME = 1;
  1264. }
  1265. // Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId",
  1266. // to which the analysis results should be exported. If this dataset does
  1267. // not exist, the export call will return an INVALID_ARGUMENT error.
  1268. string dataset = 1 [(google.api.field_behavior) = REQUIRED];
  1269. // Required. The prefix of the BigQuery tables to which the analysis results will be
  1270. // written. Tables will be created based on this table_prefix if not exist:
  1271. // * <table_prefix>_analysis table will contain export operation's metadata.
  1272. // * <table_prefix>_analysis_result will contain all the
  1273. // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult].
  1274. // When [partition_key] is specified, both tables will be partitioned based
  1275. // on the [partition_key].
  1276. string table_prefix = 2 [(google.api.field_behavior) = REQUIRED];
  1277. // The partition key for BigQuery partitioned table.
  1278. PartitionKey partition_key = 3;
  1279. // Optional. Specifies the action that occurs if the destination table or partition
  1280. // already exists. The following values are supported:
  1281. //
  1282. // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery
  1283. // overwrites the entire table or all the partitions data.
  1284. // * WRITE_APPEND: If the table or partition already exists, BigQuery
  1285. // appends the data to the table or the latest partition.
  1286. // * WRITE_EMPTY: If the table already exists and contains data, an error is
  1287. // returned.
  1288. //
  1289. // The default value is WRITE_APPEND. Each action is atomic and only occurs
  1290. // if BigQuery is able to complete the job successfully. Details are at
  1291. // https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file.
  1292. string write_disposition = 4 [(google.api.field_behavior) = OPTIONAL];
  1293. }
  1294. // IAM policy analysis export destination.
  1295. oneof destination {
  1296. // Destination on Cloud Storage.
  1297. GcsDestination gcs_destination = 1;
  1298. // Destination on BigQuery.
  1299. BigQueryDestination bigquery_destination = 2;
  1300. }
  1301. }
  1302. // A request message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
  1303. message AnalyzeIamPolicyLongrunningRequest {
  1304. // Required. The request query.
  1305. IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED];
  1306. // Optional. The name of a saved query, which must be in the format of:
  1307. //
  1308. // * projects/project_number/savedQueries/saved_query_id
  1309. // * folders/folder_number/savedQueries/saved_query_id
  1310. // * organizations/organization_number/savedQueries/saved_query_id
  1311. //
  1312. // If both `analysis_query` and `saved_analysis_query` are provided, they
  1313. // will be merged together with the `saved_analysis_query` as base and
  1314. // the `analysis_query` as overrides. For more details of the merge behavior,
  1315. // please refer to the
  1316. // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
  1317. // doc.
  1318. //
  1319. // Note that you cannot override primitive fields with default value, such as
  1320. // 0 or empty string, etc., because we use proto3, which doesn't support field
  1321. // presence yet.
  1322. string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL];
  1323. // Required. Output configuration indicating where the results will be output to.
  1324. IamPolicyAnalysisOutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
  1325. }
  1326. // A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
  1327. message AnalyzeIamPolicyLongrunningResponse {
  1328. }
  1329. // A saved query which can be shared with others or used later.
  1330. message SavedQuery {
  1331. option (google.api.resource) = {
  1332. type: "cloudasset.googleapis.com/SavedQuery"
  1333. pattern: "projects/{project}/savedQueries/{saved_query}"
  1334. pattern: "folders/{folder}/savedQueries/{saved_query}"
  1335. pattern: "organizations/{organization}/savedQueries/{saved_query}"
  1336. };
  1337. // The query content.
  1338. message QueryContent {
  1339. oneof query_content {
  1340. // An IAM Policy Analysis query, which could be used in
  1341. // the [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] rpc or
  1342. // the [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc.
  1343. IamPolicyAnalysisQuery iam_policy_analysis_query = 1;
  1344. }
  1345. }
  1346. // The resource name of the saved query. The format must be:
  1347. //
  1348. // * projects/project_number/savedQueries/saved_query_id
  1349. // * folders/folder_number/savedQueries/saved_query_id
  1350. // * organizations/organization_number/savedQueries/saved_query_id
  1351. string name = 1;
  1352. // The description of this saved query. This value should be fewer than 255
  1353. // characters.
  1354. string description = 2;
  1355. // Output only. The create time of this saved query.
  1356. google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  1357. // Output only. The account's email address who has created this saved query.
  1358. string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1359. // Output only. The last update time of this saved query.
  1360. google.protobuf.Timestamp last_update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  1361. // Output only. The account's email address who has updated this saved query most recently.
  1362. string last_updater = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1363. // Labels applied on the resource.
  1364. // This value should not contain more than 10 entries. The key and value of
  1365. // each entry must be non-empty and fewer than 64 characters.
  1366. map<string, string> labels = 7;
  1367. // The query content.
  1368. QueryContent content = 8;
  1369. }
  1370. // Request to create a saved query.
  1371. message CreateSavedQueryRequest {
  1372. // Required. The name of the project/folder/organization where this saved_query
  1373. // should be created in. It can only be an organization number (such as
  1374. // "organizations/123"), a folder number (such as "folders/123"), a project ID
  1375. // (such as "projects/my-project-id")", or a project number (such as
  1376. // "projects/12345").
  1377. string parent = 1 [
  1378. (google.api.field_behavior) = REQUIRED,
  1379. (google.api.resource_reference) = {
  1380. child_type: "cloudasset.googleapis.com/SavedQuery"
  1381. }
  1382. ];
  1383. // Required. The saved_query details. The `name` field must be empty as it will be
  1384. // generated based on the parent and saved_query_id.
  1385. SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED];
  1386. // Required. The ID to use for the saved query, which must be unique in the specified
  1387. // parent. It will become the final component of the saved query's resource
  1388. // name.
  1389. //
  1390. // This value should be 4-63 characters, and valid characters
  1391. // are /[a-z][0-9]-/.
  1392. //
  1393. // Notice that this field is required in the saved query creation, and the
  1394. // `name` field of the `saved_query` will be ignored.
  1395. string saved_query_id = 3 [(google.api.field_behavior) = REQUIRED];
  1396. }
  1397. // Request to get a saved query.
  1398. message GetSavedQueryRequest {
  1399. // Required. The name of the saved query and it must be in the format of:
  1400. //
  1401. // * projects/project_number/savedQueries/saved_query_id
  1402. // * folders/folder_number/savedQueries/saved_query_id
  1403. // * organizations/organization_number/savedQueries/saved_query_id
  1404. string name = 1 [
  1405. (google.api.field_behavior) = REQUIRED,
  1406. (google.api.resource_reference) = {
  1407. type: "cloudasset.googleapis.com/SavedQuery"
  1408. }
  1409. ];
  1410. }
  1411. // Request to list saved queries.
  1412. message ListSavedQueriesRequest {
  1413. // Required. The parent project/folder/organization whose savedQueries are to be
  1414. // listed. It can only be using project/folder/organization number (such as
  1415. // "folders/12345")", or a project ID (such as "projects/my-project-id").
  1416. string parent = 1 [
  1417. (google.api.field_behavior) = REQUIRED,
  1418. (google.api.resource_reference) = {
  1419. child_type: "cloudasset.googleapis.com/SavedQuery"
  1420. }
  1421. ];
  1422. // Optional. The expression to filter resources.
  1423. // The expression is a list of zero or more restrictions combined via logical
  1424. // operators `AND` and `OR`. When `AND` and `OR` are both used in the
  1425. // expression, parentheses must be appropriately used to group the
  1426. // combinations. The expression may also contain regular expressions.
  1427. //
  1428. // See https://google.aip.dev/160 for more information on the grammar.
  1429. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  1430. // Optional. The maximum number of saved queries to return per page. The service may
  1431. // return fewer than this value. If unspecified, at most 50 will be returned.
  1432. // The maximum value is 1000; values above 1000 will be coerced to 1000.
  1433. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  1434. // Optional. A page token, received from a previous `ListSavedQueries` call.
  1435. // Provide this to retrieve the subsequent page.
  1436. //
  1437. // When paginating, all other parameters provided to `ListSavedQueries` must
  1438. // match the call that provided the page token.
  1439. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  1440. }
  1441. // Response of listing saved queries.
  1442. message ListSavedQueriesResponse {
  1443. // A list of savedQueries.
  1444. repeated SavedQuery saved_queries = 1;
  1445. // A token, which can be sent as `page_token` to retrieve the next page.
  1446. // If this field is omitted, there are no subsequent pages.
  1447. string next_page_token = 2;
  1448. }
  1449. // Request to update a saved query.
  1450. message UpdateSavedQueryRequest {
  1451. // Required. The saved query to update.
  1452. //
  1453. // The saved query's `name` field is used to identify the one to update,
  1454. // which has format as below:
  1455. //
  1456. // * projects/project_number/savedQueries/saved_query_id
  1457. // * folders/folder_number/savedQueries/saved_query_id
  1458. // * organizations/organization_number/savedQueries/saved_query_id
  1459. SavedQuery saved_query = 1 [(google.api.field_behavior) = REQUIRED];
  1460. // Required. The list of fields to update.
  1461. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  1462. }
  1463. // Request to delete a saved query.
  1464. message DeleteSavedQueryRequest {
  1465. // Required. The name of the saved query to delete. It must be in the format of:
  1466. //
  1467. // * projects/project_number/savedQueries/saved_query_id
  1468. // * folders/folder_number/savedQueries/saved_query_id
  1469. // * organizations/organization_number/savedQueries/saved_query_id
  1470. string name = 1 [
  1471. (google.api.field_behavior) = REQUIRED,
  1472. (google.api.resource_reference) = {
  1473. type: "cloudasset.googleapis.com/SavedQuery"
  1474. }
  1475. ];
  1476. }
  1477. // The request message for performing resource move analysis.
  1478. message AnalyzeMoveRequest {
  1479. // View enum for supporting partial analysis responses.
  1480. enum AnalysisView {
  1481. // The default/unset value.
  1482. // The API will default to the FULL view.
  1483. ANALYSIS_VIEW_UNSPECIFIED = 0;
  1484. // Full analysis including all level of impacts of the specified resource
  1485. // move.
  1486. FULL = 1;
  1487. // Basic analysis only including blockers which will prevent the specified
  1488. // resource move at runtime.
  1489. BASIC = 2;
  1490. }
  1491. // Required. Name of the resource to perform the analysis against.
  1492. // Only GCP Project are supported as of today. Hence, this can only be Project
  1493. // ID (such as "projects/my-project-id") or a Project Number (such as
  1494. // "projects/12345").
  1495. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  1496. // Required. Name of the GCP Folder or Organization to reparent the target
  1497. // resource. The analysis will be performed against hypothetically moving the
  1498. // resource to this specified desitination parent. This can only be a Folder
  1499. // number (such as "folders/123") or an Organization number (such as
  1500. // "organizations/123").
  1501. string destination_parent = 2 [(google.api.field_behavior) = REQUIRED];
  1502. // Analysis view indicating what information should be included in the
  1503. // analysis response. If unspecified, the default view is FULL.
  1504. AnalysisView view = 3;
  1505. }
  1506. // The response message for resource move analysis.
  1507. message AnalyzeMoveResponse {
  1508. // The list of analyses returned from performing the intended resource move
  1509. // analysis. The analysis is grouped by different Cloud services.
  1510. repeated MoveAnalysis move_analysis = 1;
  1511. }
  1512. // A message to group the analysis information.
  1513. message MoveAnalysis {
  1514. // The user friendly display name of the analysis. E.g. IAM, Organization
  1515. // Policy etc.
  1516. string display_name = 1;
  1517. oneof result {
  1518. // Analysis result of moving the target resource.
  1519. MoveAnalysisResult analysis = 2;
  1520. // Description of error encountered when performing the analysis.
  1521. google.rpc.Status error = 3;
  1522. }
  1523. }
  1524. // An analysis result including blockers and warnings.
  1525. message MoveAnalysisResult {
  1526. // Blocking information that would prevent the target resource from moving
  1527. // to the specified destination at runtime.
  1528. repeated MoveImpact blockers = 1;
  1529. // Warning information indicating that moving the target resource to the
  1530. // specified destination might be unsafe. This can include important policy
  1531. // information and configuration changes, but will not block moves at runtime.
  1532. repeated MoveImpact warnings = 2;
  1533. }
  1534. // A message to group impacts of moving the target resource.
  1535. message MoveImpact {
  1536. // User friendly impact detail in a free form message.
  1537. string detail = 1;
  1538. }
  1539. // Output configuration query assets.
  1540. message QueryAssetsOutputConfig {
  1541. // BigQuery destination.
  1542. message BigQueryDestination {
  1543. // Required. The BigQuery dataset where the query results will be saved. It has the
  1544. // format of "projects/{projectId}/datasets/{datasetId}".
  1545. string dataset = 1 [(google.api.field_behavior) = REQUIRED];
  1546. // Required. The BigQuery table where the query results will be saved. If this table
  1547. // does not exist, a new table with the given name will be created.
  1548. string table = 2 [(google.api.field_behavior) = REQUIRED];
  1549. // Specifies the action that occurs if the destination table or partition
  1550. // already exists. The following values are supported:
  1551. //
  1552. // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery
  1553. // overwrites the entire table or all the partitions data.
  1554. // * WRITE_APPEND: If the table or partition already exists, BigQuery
  1555. // appends the data to the table or the latest partition.
  1556. // * WRITE_EMPTY: If the table already exists and contains data, a
  1557. // 'duplicate' error is returned in the job result.
  1558. //
  1559. // The default value is WRITE_EMPTY.
  1560. string write_disposition = 3;
  1561. }
  1562. // BigQuery destination where the query results will be saved.
  1563. BigQueryDestination bigquery_destination = 1;
  1564. }
  1565. // QueryAssets request.
  1566. message QueryAssetsRequest {
  1567. // Required. The relative name of the root asset. This can only be an
  1568. // organization number (such as "organizations/123"), a project ID (such as
  1569. // "projects/my-project-id"), or a project number (such as "projects/12345"),
  1570. // or a folder number (such as "folders/123").
  1571. //
  1572. // Only assets belonging to the `parent` will be returned.
  1573. string parent = 1 [
  1574. (google.api.field_behavior) = REQUIRED,
  1575. (google.api.resource_reference) = {
  1576. child_type: "cloudasset.googleapis.com/Asset"
  1577. }
  1578. ];
  1579. oneof query {
  1580. // Optional. A SQL statement that's compatible with [BigQuery Standard
  1581. // SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
  1582. string statement = 2 [(google.api.field_behavior) = OPTIONAL];
  1583. // Optional. Reference to the query job, which is from the `QueryAssetsResponse` of
  1584. // previous `QueryAssets` call.
  1585. string job_reference = 3 [(google.api.field_behavior) = OPTIONAL];
  1586. }
  1587. // Optional. The maximum number of rows to return in the results. Responses are limited
  1588. // to 10 MB and 1000 rows.
  1589. //
  1590. // By default, the maximum row count is 1000. When the byte or row count limit
  1591. // is reached, the rest of the query results will be paginated.
  1592. //
  1593. // The field will be ignored when [output_config] is specified.
  1594. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
  1595. // Optional. A page token received from previous `QueryAssets`.
  1596. //
  1597. // The field will be ignored when [output_config] is specified.
  1598. string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
  1599. // Optional. Specifies the maximum amount of time that the client is willing to wait
  1600. // for the query to complete. By default, this limit is 5 min for the first
  1601. // query, and 1 minute for the following queries. If the query is complete,
  1602. // the `done` field in the `QueryAssetsResponse` is true, otherwise false.
  1603. //
  1604. // Like BigQuery [jobs.query
  1605. // API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
  1606. // The call is not guaranteed to wait for the specified timeout; it typically
  1607. // returns after around 200 seconds (200,000 milliseconds), even if the query
  1608. // is not complete.
  1609. //
  1610. // The field will be ignored when [output_config] is specified.
  1611. google.protobuf.Duration timeout = 6 [(google.api.field_behavior) = OPTIONAL];
  1612. // Specifies what time period or point in time to query asset metadata at.
  1613. // * unset - query asset metadata as it is right now
  1614. // * [read_time_window] - query asset metadata as it was at any point in time
  1615. // between [start_time] and [end_time].
  1616. // * [read_time] - query asset metadata as it was at that point in time.
  1617. // If data for the timestamp/date range selected does not exist,
  1618. // it will simply return a valid response with no rows.
  1619. oneof time {
  1620. // Optional. [start_time] is required. [start_time] must be less than [end_time]
  1621. // Defaults [end_time] to now if [start_time] is set and [end_time] isn't.
  1622. // Maximum permitted time range is 7 days.
  1623. TimeWindow read_time_window = 7 [(google.api.field_behavior) = OPTIONAL];
  1624. // Optional. Queries cloud assets as they appeared at the specified point in time.
  1625. google.protobuf.Timestamp read_time = 8 [(google.api.field_behavior) = OPTIONAL];
  1626. }
  1627. // Optional. Destination where the query results will be saved.
  1628. //
  1629. // When this field is specified, the query results won't be saved in the
  1630. // [QueryAssetsResponse.query_result]. Instead
  1631. // [QueryAssetsResponse.output_config] will be set.
  1632. //
  1633. // Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
  1634. // to check the status of the query job when passed to a following
  1635. // [QueryAssets] API call.
  1636. QueryAssetsOutputConfig output_config = 9 [(google.api.field_behavior) = OPTIONAL];
  1637. }
  1638. // QueryAssets response.
  1639. message QueryAssetsResponse {
  1640. // Reference to a query job.
  1641. string job_reference = 1;
  1642. // The query response, which can be either an `error` or a valid `response`.
  1643. //
  1644. // If `done` == `false` and the query result is being saved in a output, the
  1645. // output_config field will be set.
  1646. // If `done` == `true`, exactly one of
  1647. // `error`, `query_result` or `output_config` will be set.
  1648. bool done = 2;
  1649. oneof response {
  1650. // Error status.
  1651. google.rpc.Status error = 3;
  1652. // Result of the query.
  1653. QueryResult query_result = 4;
  1654. // Output configuration which indicates instead of being returned in API
  1655. // response on the fly, the query result will be saved in a specific output.
  1656. QueryAssetsOutputConfig output_config = 5;
  1657. }
  1658. }
  1659. // Execution results of the query.
  1660. //
  1661. // The result is formatted as rows represented by BigQuery compatible [schema].
  1662. // When pagination is necessary, it will contains the page token to retrieve
  1663. // the results of following pages.
  1664. message QueryResult {
  1665. // Each row hold a query result in the format of `Struct`.
  1666. repeated google.protobuf.Struct rows = 1;
  1667. // Describes the format of the [rows].
  1668. TableSchema schema = 2;
  1669. // Token to retrieve the next page of the results.
  1670. string next_page_token = 3;
  1671. // Total rows of the whole query results.
  1672. int64 total_rows = 4;
  1673. }
  1674. // BigQuery Compatible table schema.
  1675. message TableSchema {
  1676. // Describes the fields in a table.
  1677. repeated TableFieldSchema fields = 1;
  1678. }
  1679. // A field in TableSchema.
  1680. message TableFieldSchema {
  1681. // The field name. The name must contain only letters (a-z, A-Z),
  1682. // numbers (0-9), or underscores (_), and must start with a letter or
  1683. // underscore. The maximum length is 128 characters.
  1684. string field = 1;
  1685. // The field data type. Possible values include
  1686. // * STRING
  1687. // * BYTES
  1688. // * INTEGER
  1689. // * FLOAT
  1690. // * BOOLEAN
  1691. // * TIMESTAMP
  1692. // * DATE
  1693. // * TIME
  1694. // * DATETIME
  1695. // * GEOGRAPHY,
  1696. // * NUMERIC,
  1697. // * BIGNUMERIC,
  1698. // * RECORD
  1699. // (where RECORD indicates that the field contains a nested schema).
  1700. string type = 2;
  1701. // The field mode. Possible values include NULLABLE, REQUIRED and
  1702. // REPEATED. The default value is NULLABLE.
  1703. string mode = 3;
  1704. // Describes the nested schema fields if the type property is set
  1705. // to RECORD.
  1706. repeated TableFieldSchema fields = 4;
  1707. }
  1708. // A request message for [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies].
  1709. message BatchGetEffectiveIamPoliciesRequest {
  1710. // Required. Only IAM policies on or below the scope will be returned.
  1711. //
  1712. // This can only be an organization number (such as "organizations/123"), a
  1713. // folder number (such as "folders/123"), a project ID (such as
  1714. // "projects/my-project-id"), or a project number (such as "projects/12345").
  1715. //
  1716. // To know how to get organization id, visit [here
  1717. // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
  1718. //
  1719. // To know how to get folder or project id, visit [here
  1720. // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects).
  1721. string scope = 1 [
  1722. (google.api.field_behavior) = REQUIRED,
  1723. (google.api.resource_reference) = {
  1724. child_type: "*"
  1725. }
  1726. ];
  1727. // Required. The names refer to the [full_resource_names]
  1728. // (https://cloud.google.com/asset-inventory/docs/resource-name-format)
  1729. // of [searchable asset
  1730. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
  1731. // A maximum of 20 resources' effective policies can be retrieved in a batch.
  1732. repeated string names = 3 [
  1733. (google.api.field_behavior) = REQUIRED,
  1734. (google.api.resource_reference) = {
  1735. type: "*"
  1736. }
  1737. ];
  1738. }
  1739. // A response message for [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies].
  1740. message BatchGetEffectiveIamPoliciesResponse {
  1741. // The effective IAM policies on one resource.
  1742. message EffectiveIamPolicy {
  1743. // The IAM policy and its attached resource.
  1744. message PolicyInfo {
  1745. // The full resource name the [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] is directly attached to.
  1746. string attached_resource = 1;
  1747. // The IAM policy that's directly attached to the [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource].
  1748. google.iam.v1.Policy policy = 2;
  1749. }
  1750. // The [full_resource_name]
  1751. // (https://cloud.google.com/asset-inventory/docs/resource-name-format)
  1752. // for which the [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] are computed. This is one of the
  1753. // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] the caller provides in the
  1754. // request.
  1755. string full_resource_name = 1;
  1756. // The effective policies for the [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name].
  1757. //
  1758. // These policies include the policy set on the [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] and
  1759. // those set on its parents and ancestors up to the
  1760. // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. Note that these policies
  1761. // are not filtered according to the resource type of the
  1762. // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name].
  1763. //
  1764. // These policies are hierarchically ordered by
  1765. // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] starting from [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]
  1766. // itself to its parents and ancestors, such that policies[i]'s
  1767. // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] is the child of policies[i+1]'s
  1768. // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], if policies[i+1] exists.
  1769. repeated PolicyInfo policies = 2;
  1770. }
  1771. // The effective policies for a batch of resources. Note that the results
  1772. // order is the same as the order of
  1773. // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. When a resource does not
  1774. // have any effective IAM policies, its corresponding policy_result will
  1775. // contain empty [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies].
  1776. repeated EffectiveIamPolicy policy_results = 2;
  1777. }
  1778. // Asset content type.
  1779. enum ContentType {
  1780. // Unspecified content type.
  1781. CONTENT_TYPE_UNSPECIFIED = 0;
  1782. // Resource metadata.
  1783. RESOURCE = 1;
  1784. // The actual IAM policy set on a resource.
  1785. IAM_POLICY = 2;
  1786. // The Cloud Organization Policy set on an asset.
  1787. ORG_POLICY = 4;
  1788. // The Cloud Access context manager Policy set on an asset.
  1789. ACCESS_POLICY = 5;
  1790. // The runtime OS Inventory information.
  1791. OS_INVENTORY = 6;
  1792. // The related resources.
  1793. RELATIONSHIP = 7;
  1794. }