google-cloud-asset-v1 0.5.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/asset/v1/asset_service/client.rb +302 -98
- data/lib/google/cloud/asset/v1/asset_service_pb.rb +103 -0
- data/lib/google/cloud/asset/v1/asset_service_services_pb.rb +35 -23
- data/lib/google/cloud/asset/v1/assets_pb.rb +50 -1
- data/lib/google/cloud/asset/v1/version.rb +1 -1
- data/lib/google/cloud/osconfig/v1/inventory_pb.rb +108 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/asset/v1/asset_service.rb +550 -90
- data/proto_docs/google/cloud/asset/v1/assets.rb +207 -25
- data/proto_docs/google/cloud/osconfig/v1/inventory.rb +284 -0
- metadata +5 -3
@@ -37,9 +37,22 @@ module Google
|
|
37
37
|
# running the same query may get different results.
|
38
38
|
# @!attribute [rw] asset_types
|
39
39
|
# @return [::Array<::String>]
|
40
|
-
# A list of asset types
|
41
|
-
# "compute.googleapis.com/Disk".
|
42
|
-
#
|
40
|
+
# A list of asset types to take a snapshot for. For example:
|
41
|
+
# "compute.googleapis.com/Disk".
|
42
|
+
#
|
43
|
+
# Regular expressions are also supported. For example:
|
44
|
+
#
|
45
|
+
# * "compute.googleapis.com.*" snapshots resources whose asset type starts
|
46
|
+
# with "compute.googleapis.com".
|
47
|
+
# * ".*Instance" snapshots resources whose asset type ends with "Instance".
|
48
|
+
# * ".*Instance.*" snapshots resources whose asset type contains "Instance".
|
49
|
+
#
|
50
|
+
# See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
|
51
|
+
# regular expression syntax. If the regular expression does not match any
|
52
|
+
# supported asset type, an INVALID_ARGUMENT error will be returned.
|
53
|
+
#
|
54
|
+
# If specified, only matching assets will be returned, otherwise, it will
|
55
|
+
# snapshot all asset types. See [Introduction to Cloud Asset
|
43
56
|
# Inventory](https://cloud.google.com/asset-inventory/docs/overview)
|
44
57
|
# for all supported asset types.
|
45
58
|
# @!attribute [rw] content_type
|
@@ -48,24 +61,28 @@ module Google
|
|
48
61
|
# returned.
|
49
62
|
# @!attribute [rw] output_config
|
50
63
|
# @return [::Google::Cloud::Asset::V1::OutputConfig]
|
51
|
-
# Required. Output configuration indicating where the results will be output
|
52
|
-
# to.
|
64
|
+
# Required. Output configuration indicating where the results will be output to.
|
53
65
|
class ExportAssetsRequest
|
54
66
|
include ::Google::Protobuf::MessageExts
|
55
67
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
56
68
|
end
|
57
69
|
|
58
70
|
# The export asset response. This message is returned by the
|
59
|
-
# google.longrunning.Operations.GetOperation
|
60
|
-
#
|
61
|
-
# {::Google::Longrunning::Operation#response google.longrunning.Operation.response}
|
62
|
-
# field.
|
71
|
+
# google.longrunning.Operations.GetOperation method in the returned
|
72
|
+
# {::Google::Longrunning::Operation#response google.longrunning.Operation.response} field.
|
63
73
|
# @!attribute [rw] read_time
|
64
74
|
# @return [::Google::Protobuf::Timestamp]
|
65
75
|
# Time the snapshot was taken.
|
66
76
|
# @!attribute [rw] output_config
|
67
77
|
# @return [::Google::Cloud::Asset::V1::OutputConfig]
|
68
78
|
# Output configuration indicating where the results were output to.
|
79
|
+
# @!attribute [rw] output_result
|
80
|
+
# @return [::Google::Cloud::Asset::V1::OutputResult]
|
81
|
+
# Output result indicating where the assets were exported to. For example, a
|
82
|
+
# set of actual Google Cloud Storage object uris where the assets are
|
83
|
+
# exported to. The uris can be different from what [output_config] has
|
84
|
+
# specified, as the service will split the output object into multiple ones
|
85
|
+
# once it exceeds a single Google Cloud Storage object limit.
|
69
86
|
class ExportAssetsResponse
|
70
87
|
include ::Google::Protobuf::MessageExts
|
71
88
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -126,8 +143,9 @@ module Google
|
|
126
143
|
# be unique under a specific parent project/folder/organization.
|
127
144
|
# @!attribute [rw] feed
|
128
145
|
# @return [::Google::Cloud::Asset::V1::Feed]
|
129
|
-
# Required. The feed details. The field `name` must be empty and it will be
|
130
|
-
#
|
146
|
+
# Required. The feed details. The field `name` must be empty and it will be generated
|
147
|
+
# in the format of:
|
148
|
+
# projects/project_number/feeds/feed_id
|
131
149
|
# folders/folder_number/feeds/feed_id
|
132
150
|
# organizations/organization_number/feeds/feed_id
|
133
151
|
class CreateFeedRequest
|
@@ -169,8 +187,8 @@ module Google
|
|
169
187
|
# Update asset feed request.
|
170
188
|
# @!attribute [rw] feed
|
171
189
|
# @return [::Google::Cloud::Asset::V1::Feed]
|
172
|
-
# Required. The new values of feed details. It must match an existing feed
|
173
|
-
#
|
190
|
+
# Required. The new values of feed details. It must match an existing feed and the
|
191
|
+
# field `name` must be in the format of:
|
174
192
|
# projects/project_number/feeds/feed_id or
|
175
193
|
# folders/folder_number/feeds/feed_id or
|
176
194
|
# organizations/organization_number/feeds/feed_id.
|
@@ -208,6 +226,25 @@ module Google
|
|
208
226
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
209
227
|
end
|
210
228
|
|
229
|
+
# Output result of export assets.
|
230
|
+
# @!attribute [rw] gcs_result
|
231
|
+
# @return [::Google::Cloud::Asset::V1::GcsOutputResult]
|
232
|
+
# Export result on Cloud Storage.
|
233
|
+
class OutputResult
|
234
|
+
include ::Google::Protobuf::MessageExts
|
235
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
236
|
+
end
|
237
|
+
|
238
|
+
# A Cloud Storage output result.
|
239
|
+
# @!attribute [rw] uris
|
240
|
+
# @return [::Array<::String>]
|
241
|
+
# List of uris of the Cloud Storage objects. Example:
|
242
|
+
# "gs://bucket_name/object_name".
|
243
|
+
class GcsOutputResult
|
244
|
+
include ::Google::Protobuf::MessageExts
|
245
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
246
|
+
end
|
247
|
+
|
211
248
|
# A Cloud Storage location.
|
212
249
|
# @!attribute [rw] uri
|
213
250
|
# @return [::String]
|
@@ -250,11 +287,91 @@ module Google
|
|
250
287
|
# table will be overwritten by the contents of assets snapshot. If the flag
|
251
288
|
# is `FALSE` or unset and the destination table already exists, the export
|
252
289
|
# call returns an INVALID_ARGUMEMT error.
|
290
|
+
# @!attribute [rw] partition_spec
|
291
|
+
# @return [::Google::Cloud::Asset::V1::PartitionSpec]
|
292
|
+
# [partition_spec] determines whether to export to partitioned table(s) and
|
293
|
+
# how to partition the data.
|
294
|
+
#
|
295
|
+
# If [partition_spec] is unset or [partition_spec.partition_key] is unset or
|
296
|
+
# `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
|
297
|
+
# non-partitioned table(s). [force] will decide whether to overwrite existing
|
298
|
+
# table(s).
|
299
|
+
#
|
300
|
+
# If [partition_spec] is specified. First, the snapshot results will be
|
301
|
+
# written to partitioned table(s) with two additional timestamp columns,
|
302
|
+
# readTime and requestTime, one of which will be the partition key. Secondly,
|
303
|
+
# in the case when any destination table already exists, it will first try to
|
304
|
+
# update existing table's schema as necessary by appending additional
|
305
|
+
# columns. Then, if [force] is `TRUE`, the corresponding partition will be
|
306
|
+
# overwritten by the snapshot results (data in different partitions will
|
307
|
+
# remain intact); if [force] is unset or `FALSE`, it will append the data. An
|
308
|
+
# error will be returned if the schema update or data appension fails.
|
309
|
+
# @!attribute [rw] separate_tables_per_asset_type
|
310
|
+
# @return [::Boolean]
|
311
|
+
# If this flag is `TRUE`, the snapshot results will be written to one or
|
312
|
+
# multiple tables, each of which contains results of one asset type. The
|
313
|
+
# [force] and [partition_spec] fields will apply to each of them.
|
314
|
+
#
|
315
|
+
# Field [table] will be concatenated with "_" and the asset type names (see
|
316
|
+
# https://cloud.google.com/asset-inventory/docs/supported-asset-types for
|
317
|
+
# supported asset types) to construct per-asset-type table names, in which
|
318
|
+
# all non-alphanumeric characters like "." and "/" will be substituted by
|
319
|
+
# "_". Example: if field [table] is "mytable" and snapshot results
|
320
|
+
# contain "storage.googleapis.com/Bucket" assets, the corresponding table
|
321
|
+
# name will be "mytable_storage_googleapis_com_Bucket". If any of these
|
322
|
+
# tables does not exist, a new table with the concatenated name will be
|
323
|
+
# created.
|
324
|
+
#
|
325
|
+
# When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
|
326
|
+
# each table will include RECORD-type columns mapped to the nested fields in
|
327
|
+
# the Asset.resource.data field of that asset type (up to the 15 nested level
|
328
|
+
# BigQuery supports
|
329
|
+
# (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
|
330
|
+
# fields in >15 nested levels will be stored in JSON format string as a child
|
331
|
+
# column of its parent RECORD column.
|
332
|
+
#
|
333
|
+
# If error occurs when exporting to any table, the whole export call will
|
334
|
+
# return an error but the export results that already succeed will persist.
|
335
|
+
# Example: if exporting to table_type_A succeeds when exporting to
|
336
|
+
# table_type_B fails during one export call, the results in table_type_A will
|
337
|
+
# persist and there will not be partial results persisting in a table.
|
253
338
|
class BigQueryDestination
|
254
339
|
include ::Google::Protobuf::MessageExts
|
255
340
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
256
341
|
end
|
257
342
|
|
343
|
+
# Specifications of BigQuery partitioned table as export destination.
|
344
|
+
# @!attribute [rw] partition_key
|
345
|
+
# @return [::Google::Cloud::Asset::V1::PartitionSpec::PartitionKey]
|
346
|
+
# The partition key for BigQuery partitioned table.
|
347
|
+
class PartitionSpec
|
348
|
+
include ::Google::Protobuf::MessageExts
|
349
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
350
|
+
|
351
|
+
# This enum is used to determine the partition key column when exporting
|
352
|
+
# assets to BigQuery partitioned table(s). Note that, if the partition key is
|
353
|
+
# a timestamp column, the actual partition is based on its date value
|
354
|
+
# (expressed in UTC. see details in
|
355
|
+
# https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables).
|
356
|
+
module PartitionKey
|
357
|
+
# Unspecified partition key. If used, it means using non-partitioned table.
|
358
|
+
PARTITION_KEY_UNSPECIFIED = 0
|
359
|
+
|
360
|
+
# The time when the snapshot is taken. If specified as partition key, the
|
361
|
+
# result table(s) is partitoned by the additional timestamp column,
|
362
|
+
# readTime. If [read_time] in ExportAssetsRequest is specified, the
|
363
|
+
# readTime column's value will be the same as it. Otherwise, its value will
|
364
|
+
# be the current time that is used to take the snapshot.
|
365
|
+
READ_TIME = 1
|
366
|
+
|
367
|
+
# The time when the request is received and started to be processed. If
|
368
|
+
# specified as partition key, the result table(s) is partitoned by the
|
369
|
+
# requestTime column, an additional timestamp column representing when the
|
370
|
+
# request was received.
|
371
|
+
REQUEST_TIME = 2
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
258
375
|
# A Pub/Sub destination.
|
259
376
|
# @!attribute [rw] topic
|
260
377
|
# @return [::String]
|
@@ -324,8 +441,12 @@ module Google
|
|
324
441
|
# When set, `expression` field in the `Expr` must be a valid [CEL expression]
|
325
442
|
# (https://github.com/google/cel-spec) on a TemporalAsset with name
|
326
443
|
# `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted
|
327
|
-
# == true") will only publish Asset deletions. Other fields
|
444
|
+
# == true") will only publish Asset deletions. Other fields of `Expr` are
|
328
445
|
# optional.
|
446
|
+
#
|
447
|
+
# See our [user
|
448
|
+
# guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes#feed_with_condition)
|
449
|
+
# for detailed instructions.
|
329
450
|
class Feed
|
330
451
|
include ::Google::Protobuf::MessageExts
|
331
452
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -334,75 +455,81 @@ module Google
|
|
334
455
|
# Search all resources request.
|
335
456
|
# @!attribute [rw] scope
|
336
457
|
# @return [::String]
|
337
|
-
# Required. A scope can be a project, a folder or an organization. The search
|
338
|
-
#
|
458
|
+
# Required. A scope can be a project, a folder, or an organization. The search is
|
459
|
+
# limited to the resources within the `scope`. The caller must be granted the
|
460
|
+
# [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
|
461
|
+
# permission on the desired scope.
|
339
462
|
#
|
340
463
|
# The allowed values are:
|
341
464
|
#
|
342
|
-
# * projects/\\{PROJECT_ID}
|
343
|
-
# * projects/\\{PROJECT_NUMBER}
|
344
|
-
# * folders/\\{FOLDER_NUMBER}
|
345
|
-
# * organizations/\\{ORGANIZATION_NUMBER}
|
465
|
+
# * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
|
466
|
+
# * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
|
467
|
+
# * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
|
468
|
+
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
|
346
469
|
# @!attribute [rw] query
|
347
470
|
# @return [::String]
|
348
|
-
# Optional. The query statement.
|
349
|
-
#
|
471
|
+
# Optional. The query statement. See [how to construct a
|
472
|
+
# query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
|
473
|
+
# for more information. If not specified or empty, it will search all the
|
474
|
+
# resources within the specified `scope`. Note that the query string is
|
475
|
+
# compared against each Cloud IAM policy binding, including its members,
|
476
|
+
# roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
|
477
|
+
# contain the bindings that match your query. To learn more about the IAM
|
478
|
+
# policy structure, see [IAM policy
|
479
|
+
# doc](https://cloud.google.com/iam/docs/policies#structure).
|
350
480
|
#
|
351
481
|
# Examples:
|
352
482
|
#
|
353
|
-
# * `name
|
483
|
+
# * `name:Important` to find Cloud resources whose name contains
|
354
484
|
# "Important" as a word.
|
355
|
-
# * `displayName
|
356
|
-
# contains "Impor" as a
|
357
|
-
# * `description
|
485
|
+
# * `displayName:Impor*` to find Cloud resources whose display name
|
486
|
+
# contains "Impor" as a prefix.
|
487
|
+
# * `description:*por*` to find Cloud resources whose description
|
358
488
|
# contains "por" as a substring.
|
359
|
-
# * `location
|
489
|
+
# * `location:us-west*` to find Cloud resources whose location is
|
360
490
|
# prefixed with "us-west".
|
361
|
-
# * `labels
|
491
|
+
# * `labels:prod` to find Cloud resources whose labels contain "prod" as
|
362
492
|
# a key or value.
|
363
|
-
# * `labels.env
|
493
|
+
# * `labels.env:prod` to find Cloud resources that have a label "env"
|
364
494
|
# and its value is "prod".
|
365
|
-
# * `labels.env
|
366
|
-
# * `
|
495
|
+
# * `labels.env:*` to find Cloud resources that have a label "env".
|
496
|
+
# * `Important` to find Cloud resources that contain "Important" as a word
|
367
497
|
# in any of the searchable fields.
|
368
|
-
# * `
|
498
|
+
# * `Impor*` to find Cloud resources that contain "Impor" as a prefix
|
369
499
|
# in any of the searchable fields.
|
370
|
-
# *
|
500
|
+
# * `*por*` to find Cloud resources that contain "por" as a substring in
|
371
501
|
# any of the searchable fields.
|
372
|
-
# * `
|
373
|
-
# resources
|
502
|
+
# * `Important location:(us-west1 OR global)` to find Cloud
|
503
|
+
# resources that contain "Important" as a word in any of the searchable
|
374
504
|
# fields and are also located in the "us-west1" region or the "global"
|
375
505
|
# location.
|
376
|
-
#
|
377
|
-
# See [how to construct a
|
378
|
-
# query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
|
379
|
-
# for more details.
|
380
506
|
# @!attribute [rw] asset_types
|
381
507
|
# @return [::Array<::String>]
|
382
|
-
# Optional. A list of asset types that this request searches for. If empty,
|
383
|
-
#
|
508
|
+
# Optional. A list of asset types that this request searches for. If empty, it will
|
509
|
+
# search all the [searchable asset
|
384
510
|
# types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
|
385
511
|
# @!attribute [rw] page_size
|
386
512
|
# @return [::Integer]
|
387
|
-
# Optional. The page size for search result pagination. Page size is capped
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
# returned.
|
513
|
+
# Optional. The page size for search result pagination. Page size is capped at 500 even
|
514
|
+
# if a larger value is given. If set to zero, server will pick an appropriate
|
515
|
+
# default. Returned results may be fewer than requested. When this happens,
|
516
|
+
# there could be more results as long as `next_page_token` is returned.
|
392
517
|
# @!attribute [rw] page_token
|
393
518
|
# @return [::String]
|
394
|
-
# Optional. If present, then retrieve the next batch of results from the
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
519
|
+
# Optional. If present, then retrieve the next batch of results from the preceding call
|
520
|
+
# to this method. `page_token` must be the value of `next_page_token` from
|
521
|
+
# the previous response. The values of all other method parameters, must be
|
522
|
+
# identical to those in the previous call.
|
398
523
|
# @!attribute [rw] order_by
|
399
524
|
# @return [::String]
|
400
|
-
# Optional. A comma separated list of fields specifying the sorting order of
|
401
|
-
#
|
402
|
-
#
|
403
|
-
# Example: "location DESC, name".
|
404
|
-
#
|
405
|
-
#
|
525
|
+
# Optional. A comma separated list of fields specifying the sorting order of the
|
526
|
+
# results. The default order is ascending. Add " DESC" after the field name
|
527
|
+
# to indicate descending order. Redundant space characters are ignored.
|
528
|
+
# Example: "location DESC, name". Only string fields in the response are
|
529
|
+
# sortable, including `name`, `displayName`, `description`, `location`. All
|
530
|
+
# the other fields such as repeated fields (e.g., `networkTags`), map
|
531
|
+
# fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`)
|
532
|
+
# are not supported.
|
406
533
|
class SearchAllResourcesRequest
|
407
534
|
include ::Google::Protobuf::MessageExts
|
408
535
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -426,51 +553,58 @@ module Google
|
|
426
553
|
# Search all IAM policies request.
|
427
554
|
# @!attribute [rw] scope
|
428
555
|
# @return [::String]
|
429
|
-
# Required. A scope can be a project, a folder or an organization. The search
|
430
|
-
#
|
556
|
+
# Required. A scope can be a project, a folder, or an organization. The search is
|
557
|
+
# limited to the IAM policies within the `scope`. The caller must be granted
|
558
|
+
# the
|
559
|
+
# [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
|
560
|
+
# permission on the desired scope.
|
431
561
|
#
|
432
562
|
# The allowed values are:
|
433
563
|
#
|
434
|
-
# * projects/\\{PROJECT_ID}
|
435
|
-
# * projects/\\{PROJECT_NUMBER}
|
436
|
-
# * folders/\\{FOLDER_NUMBER}
|
437
|
-
# * organizations/\\{ORGANIZATION_NUMBER}
|
564
|
+
# * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
|
565
|
+
# * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
|
566
|
+
# * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
|
567
|
+
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
|
438
568
|
# @!attribute [rw] query
|
439
569
|
# @return [::String]
|
440
|
-
# Optional. The query statement.
|
441
|
-
#
|
570
|
+
# Optional. The query statement. See [how to construct a
|
571
|
+
# query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
|
572
|
+
# for more information. If not specified or empty, it will search all the
|
573
|
+
# IAM policies within the specified `scope`.
|
442
574
|
#
|
443
575
|
# Examples:
|
444
576
|
#
|
445
|
-
# * `policy
|
446
|
-
#
|
447
|
-
# * `policy
|
448
|
-
#
|
449
|
-
# * `policy.role.permissions
|
450
|
-
#
|
451
|
-
# permission.
|
452
|
-
#
|
453
|
-
#
|
454
|
-
# * `
|
455
|
-
#
|
456
|
-
#
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
#
|
577
|
+
# * `policy:amy@gmail.com` to find IAM policy bindings that specify user
|
578
|
+
# "amy@gmail.com".
|
579
|
+
# * `policy:roles/compute.admin` to find IAM policy bindings that specify
|
580
|
+
# the Compute Admin role.
|
581
|
+
# * `policy.role.permissions:storage.buckets.update` to find IAM policy
|
582
|
+
# bindings that specify a role containing "storage.buckets.update"
|
583
|
+
# permission. Note that if callers don't have `iam.roles.get` access to a
|
584
|
+
# role's included permissions, policy bindings that specify this role will
|
585
|
+
# be dropped from the search results.
|
586
|
+
# * `resource:organizations/123456` to find IAM policy bindings
|
587
|
+
# that are set on "organizations/123456".
|
588
|
+
# * `Important` to find IAM policy bindings that contain "Important" as a
|
589
|
+
# word in any of the searchable fields (except for the included
|
590
|
+
# permissions).
|
591
|
+
# * `*por*` to find IAM policy bindings that contain "por" as a substring
|
592
|
+
# in any of the searchable fields (except for the included permissions).
|
593
|
+
# * `resource:(instance1 OR instance2) policy:amy` to find
|
594
|
+
# IAM policy bindings that are set on resources "instance1" or
|
595
|
+
# "instance2" and also specify user "amy".
|
461
596
|
# @!attribute [rw] page_size
|
462
597
|
# @return [::Integer]
|
463
|
-
# Optional. The page size for search result pagination. Page size is capped
|
464
|
-
#
|
465
|
-
#
|
466
|
-
#
|
467
|
-
# returned.
|
598
|
+
# Optional. The page size for search result pagination. Page size is capped at 500 even
|
599
|
+
# if a larger value is given. If set to zero, server will pick an appropriate
|
600
|
+
# default. Returned results may be fewer than requested. When this happens,
|
601
|
+
# there could be more results as long as `next_page_token` is returned.
|
468
602
|
# @!attribute [rw] page_token
|
469
603
|
# @return [::String]
|
470
|
-
# Optional. If present, retrieve the next batch of results from the preceding
|
471
|
-
#
|
472
|
-
#
|
473
|
-
#
|
604
|
+
# Optional. If present, retrieve the next batch of results from the preceding call to
|
605
|
+
# this method. `page_token` must be the value of `next_page_token` from the
|
606
|
+
# previous response. The values of all other method parameters must be
|
607
|
+
# identical to those in the previous call.
|
474
608
|
class SearchAllIamPoliciesRequest
|
475
609
|
include ::Google::Protobuf::MessageExts
|
476
610
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -491,6 +625,329 @@ module Google
|
|
491
625
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
492
626
|
end
|
493
627
|
|
628
|
+
# IAM policy analysis query message.
|
629
|
+
# @!attribute [rw] scope
|
630
|
+
# @return [::String]
|
631
|
+
# Required. The relative name of the root asset. Only resources and IAM policies within
|
632
|
+
# the scope will be analyzed.
|
633
|
+
#
|
634
|
+
# This can only be an organization number (such as "organizations/123"), a
|
635
|
+
# folder number (such as "folders/123"), a project ID (such as
|
636
|
+
# "projects/my-project-id"), or a project number (such as "projects/12345").
|
637
|
+
#
|
638
|
+
# To know how to get organization id, visit [here
|
639
|
+
# ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
|
640
|
+
#
|
641
|
+
# To know how to get folder or project id, visit [here
|
642
|
+
# ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects).
|
643
|
+
# @!attribute [rw] resource_selector
|
644
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::ResourceSelector]
|
645
|
+
# Optional. Specifies a resource for analysis.
|
646
|
+
# @!attribute [rw] identity_selector
|
647
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::IdentitySelector]
|
648
|
+
# Optional. Specifies an identity for analysis.
|
649
|
+
# @!attribute [rw] access_selector
|
650
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::AccessSelector]
|
651
|
+
# Optional. Specifies roles or permissions for analysis. This is optional.
|
652
|
+
# @!attribute [rw] options
|
653
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::Options]
|
654
|
+
# Optional. The query options.
|
655
|
+
class IamPolicyAnalysisQuery
|
656
|
+
include ::Google::Protobuf::MessageExts
|
657
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
658
|
+
|
659
|
+
# Specifies the resource to analyze for access policies, which may be set
|
660
|
+
# directly on the resource, or on ancestors such as organizations, folders or
|
661
|
+
# projects.
|
662
|
+
# @!attribute [rw] full_resource_name
|
663
|
+
# @return [::String]
|
664
|
+
# Required. The [full resource name]
|
665
|
+
# (https://cloud.google.com/asset-inventory/docs/resource-name-format)
|
666
|
+
# of a resource of [supported resource
|
667
|
+
# types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types).
|
668
|
+
class ResourceSelector
|
669
|
+
include ::Google::Protobuf::MessageExts
|
670
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
671
|
+
end
|
672
|
+
|
673
|
+
# Specifies an identity for which to determine resource access, based on
|
674
|
+
# roles assigned either directly to them or to the groups they belong to,
|
675
|
+
# directly or indirectly.
|
676
|
+
# @!attribute [rw] identity
|
677
|
+
# @return [::String]
|
678
|
+
# Required. The identity appear in the form of members in
|
679
|
+
# [IAM policy
|
680
|
+
# binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
|
681
|
+
#
|
682
|
+
# The examples of supported forms are:
|
683
|
+
# "user:mike@example.com",
|
684
|
+
# "group:admins@example.com",
|
685
|
+
# "domain:google.com",
|
686
|
+
# "serviceAccount:my-project-id@appspot.gserviceaccount.com".
|
687
|
+
#
|
688
|
+
# Notice that wildcard characters (such as * and ?) are not supported.
|
689
|
+
# You must give a specific identity.
|
690
|
+
class IdentitySelector
|
691
|
+
include ::Google::Protobuf::MessageExts
|
692
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
693
|
+
end
|
694
|
+
|
695
|
+
# Specifies roles and/or permissions to analyze, to determine both the
|
696
|
+
# identities possessing them and the resources they control. If multiple
|
697
|
+
# values are specified, results will include roles or permissions matching
|
698
|
+
# any of them. The total number of roles and permissions should be equal or
|
699
|
+
# less than 10.
|
700
|
+
# @!attribute [rw] roles
|
701
|
+
# @return [::Array<::String>]
|
702
|
+
# Optional. The roles to appear in result.
|
703
|
+
# @!attribute [rw] permissions
|
704
|
+
# @return [::Array<::String>]
|
705
|
+
# Optional. The permissions to appear in result.
|
706
|
+
class AccessSelector
|
707
|
+
include ::Google::Protobuf::MessageExts
|
708
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
709
|
+
end
|
710
|
+
|
711
|
+
# Contains query options.
|
712
|
+
# @!attribute [rw] expand_groups
|
713
|
+
# @return [::Boolean]
|
714
|
+
# Optional. If true, the identities section of the result will expand any
|
715
|
+
# Google groups appearing in an IAM policy binding.
|
716
|
+
#
|
717
|
+
# If {::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery#identity_selector IamPolicyAnalysisQuery.identity_selector} is specified, the
|
718
|
+
# identity in the result will be determined by the selector, and this flag
|
719
|
+
# is not allowed to set.
|
720
|
+
#
|
721
|
+
# Default is false.
|
722
|
+
# @!attribute [rw] expand_roles
|
723
|
+
# @return [::Boolean]
|
724
|
+
# Optional. If true, the access section of result will expand any roles
|
725
|
+
# appearing in IAM policy bindings to include their permissions.
|
726
|
+
#
|
727
|
+
# If {::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery#access_selector IamPolicyAnalysisQuery.access_selector} is specified, the access
|
728
|
+
# section of the result will be determined by the selector, and this flag
|
729
|
+
# is not allowed to set.
|
730
|
+
#
|
731
|
+
# Default is false.
|
732
|
+
# @!attribute [rw] expand_resources
|
733
|
+
# @return [::Boolean]
|
734
|
+
# Optional. If true and {::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery#resource_selector IamPolicyAnalysisQuery.resource_selector} is not
|
735
|
+
# specified, the resource section of the result will expand any resource
|
736
|
+
# attached to an IAM policy to include resources lower in the resource
|
737
|
+
# hierarchy.
|
738
|
+
#
|
739
|
+
# For example, if the request analyzes for which resources user A has
|
740
|
+
# permission P, and the results include an IAM policy with P on a GCP
|
741
|
+
# folder, the results will also include resources in that folder with
|
742
|
+
# permission P.
|
743
|
+
#
|
744
|
+
# If true and {::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery#resource_selector IamPolicyAnalysisQuery.resource_selector} is specified,
|
745
|
+
# the resource section of the result will expand the specified resource to
|
746
|
+
# include resources lower in the resource hierarchy. Only project or
|
747
|
+
# lower resources are supported. Folder and organization resource cannot be
|
748
|
+
# used together with this option.
|
749
|
+
#
|
750
|
+
# For example, if the request analyzes for which users have permission P on
|
751
|
+
# a GCP project with this option enabled, the results will include all
|
752
|
+
# users who have permission P on that project or any lower resource.
|
753
|
+
#
|
754
|
+
# Default is false.
|
755
|
+
# @!attribute [rw] output_resource_edges
|
756
|
+
# @return [::Boolean]
|
757
|
+
# Optional. If true, the result will output resource edges, starting
|
758
|
+
# from the policy attached resource, to any expanded resources.
|
759
|
+
# Default is false.
|
760
|
+
# @!attribute [rw] output_group_edges
|
761
|
+
# @return [::Boolean]
|
762
|
+
# Optional. If true, the result will output group identity edges, starting
|
763
|
+
# from the binding's group members, to any expanded identities.
|
764
|
+
# Default is false.
|
765
|
+
# @!attribute [rw] analyze_service_account_impersonation
|
766
|
+
# @return [::Boolean]
|
767
|
+
# Optional. If true, the response will include access analysis from identities to
|
768
|
+
# resources via service account impersonation. This is a very expensive
|
769
|
+
# operation, because many derived queries will be executed. We highly
|
770
|
+
# recommend you use {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy_longrunning AssetService.AnalyzeIamPolicyLongrunning} rpc
|
771
|
+
# instead.
|
772
|
+
#
|
773
|
+
# For example, if the request analyzes for which resources user A has
|
774
|
+
# permission P, and there's an IAM policy states user A has
|
775
|
+
# iam.serviceAccounts.getAccessToken permission to a service account SA,
|
776
|
+
# and there's another IAM policy states service account SA has permission P
|
777
|
+
# to a GCP folder F, then user A potentially has access to the GCP folder
|
778
|
+
# F. And those advanced analysis results will be included in
|
779
|
+
# {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse#service_account_impersonation_analysis AnalyzeIamPolicyResponse.service_account_impersonation_analysis}.
|
780
|
+
#
|
781
|
+
# Another example, if the request analyzes for who has
|
782
|
+
# permission P to a GCP folder F, and there's an IAM policy states user A
|
783
|
+
# has iam.serviceAccounts.actAs permission to a service account SA, and
|
784
|
+
# there's another IAM policy states service account SA has permission P to
|
785
|
+
# the GCP folder F, then user A potentially has access to the GCP folder
|
786
|
+
# F. And those advanced analysis results will be included in
|
787
|
+
# {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse#service_account_impersonation_analysis AnalyzeIamPolicyResponse.service_account_impersonation_analysis}.
|
788
|
+
#
|
789
|
+
# Default is false.
|
790
|
+
class Options
|
791
|
+
include ::Google::Protobuf::MessageExts
|
792
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
# A request message for {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy AssetService.AnalyzeIamPolicy}.
|
797
|
+
# @!attribute [rw] analysis_query
|
798
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery]
|
799
|
+
# Required. The request query.
|
800
|
+
# @!attribute [rw] execution_timeout
|
801
|
+
# @return [::Google::Protobuf::Duration]
|
802
|
+
# Optional. Amount of time executable has to complete. See JSON representation of
|
803
|
+
# [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
804
|
+
#
|
805
|
+
# If this field is set with a value less than the RPC deadline, and the
|
806
|
+
# execution of your query hasn't finished in the specified
|
807
|
+
# execution timeout, you will get a response with partial result.
|
808
|
+
# Otherwise, your query's execution will continue until the RPC deadline.
|
809
|
+
# If it's not finished until then, you will get a DEADLINE_EXCEEDED error.
|
810
|
+
#
|
811
|
+
# Default is empty.
|
812
|
+
class AnalyzeIamPolicyRequest
|
813
|
+
include ::Google::Protobuf::MessageExts
|
814
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
815
|
+
end
|
816
|
+
|
817
|
+
# A response message for {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy AssetService.AnalyzeIamPolicy}.
|
818
|
+
# @!attribute [rw] main_analysis
|
819
|
+
# @return [::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse::IamPolicyAnalysis]
|
820
|
+
# The main analysis that matches the original request.
|
821
|
+
# @!attribute [rw] service_account_impersonation_analysis
|
822
|
+
# @return [::Array<::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse::IamPolicyAnalysis>]
|
823
|
+
# The service account impersonation analysis if
|
824
|
+
# [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
|
825
|
+
# enabled.
|
826
|
+
# @!attribute [rw] fully_explored
|
827
|
+
# @return [::Boolean]
|
828
|
+
# Represents whether all entries in the {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse#main_analysis main_analysis} and
|
829
|
+
# {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse#service_account_impersonation_analysis service_account_impersonation_analysis} have been fully explored to
|
830
|
+
# answer the query in the request.
|
831
|
+
class AnalyzeIamPolicyResponse
|
832
|
+
include ::Google::Protobuf::MessageExts
|
833
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
834
|
+
|
835
|
+
# An analysis message to group the query and results.
|
836
|
+
# @!attribute [rw] analysis_query
|
837
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery]
|
838
|
+
# The analysis query.
|
839
|
+
# @!attribute [rw] analysis_results
|
840
|
+
# @return [::Array<::Google::Cloud::Asset::V1::IamPolicyAnalysisResult>]
|
841
|
+
# A list of {::Google::Cloud::Asset::V1::IamPolicyAnalysisResult IamPolicyAnalysisResult} that matches the analysis query, or
|
842
|
+
# empty if no result is found.
|
843
|
+
# @!attribute [rw] fully_explored
|
844
|
+
# @return [::Boolean]
|
845
|
+
# Represents whether all entries in the {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse::IamPolicyAnalysis#analysis_results analysis_results} have been
|
846
|
+
# fully explored to answer the query.
|
847
|
+
# @!attribute [rw] non_critical_errors
|
848
|
+
# @return [::Array<::Google::Cloud::Asset::V1::IamPolicyAnalysisState>]
|
849
|
+
# A list of non-critical errors happened during the query handling.
|
850
|
+
class IamPolicyAnalysis
|
851
|
+
include ::Google::Protobuf::MessageExts
|
852
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
853
|
+
end
|
854
|
+
end
|
855
|
+
|
856
|
+
# Output configuration for export IAM policy analysis destination.
|
857
|
+
# @!attribute [rw] gcs_destination
|
858
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig::GcsDestination]
|
859
|
+
# Destination on Cloud Storage.
|
860
|
+
# @!attribute [rw] bigquery_destination
|
861
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig::BigQueryDestination]
|
862
|
+
# Destination on BigQuery.
|
863
|
+
class IamPolicyAnalysisOutputConfig
|
864
|
+
include ::Google::Protobuf::MessageExts
|
865
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
866
|
+
|
867
|
+
# A Cloud Storage location.
|
868
|
+
# @!attribute [rw] uri
|
869
|
+
# @return [::String]
|
870
|
+
# Required. The uri of the Cloud Storage object. It's the same uri that is used by
|
871
|
+
# gsutil. For example: "gs://bucket_name/object_name". See
|
872
|
+
# [Quickstart: Using the gsutil tool]
|
873
|
+
# (https://cloud.google.com/storage/docs/quickstart-gsutil) for examples.
|
874
|
+
class GcsDestination
|
875
|
+
include ::Google::Protobuf::MessageExts
|
876
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
877
|
+
end
|
878
|
+
|
879
|
+
# A BigQuery destination.
|
880
|
+
# @!attribute [rw] dataset
|
881
|
+
# @return [::String]
|
882
|
+
# Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId",
|
883
|
+
# to which the analysis results should be exported. If this dataset does
|
884
|
+
# not exist, the export call will return an INVALID_ARGUMENT error.
|
885
|
+
# @!attribute [rw] table_prefix
|
886
|
+
# @return [::String]
|
887
|
+
# Required. The prefix of the BigQuery tables to which the analysis results will be
|
888
|
+
# written. Tables will be created based on this table_prefix if not exist:
|
889
|
+
# * <table_prefix>_analysis table will contain export operation's metadata.
|
890
|
+
# * <table_prefix>_analysis_result will contain all the
|
891
|
+
# {::Google::Cloud::Asset::V1::IamPolicyAnalysisResult IamPolicyAnalysisResult}.
|
892
|
+
# When [partition_key] is specified, both tables will be partitioned based
|
893
|
+
# on the [partition_key].
|
894
|
+
# @!attribute [rw] partition_key
|
895
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig::BigQueryDestination::PartitionKey]
|
896
|
+
# The partition key for BigQuery partitioned table.
|
897
|
+
# @!attribute [rw] write_disposition
|
898
|
+
# @return [::String]
|
899
|
+
# Optional. Specifies the action that occurs if the destination table or partition
|
900
|
+
# already exists. The following values are supported:
|
901
|
+
#
|
902
|
+
# * WRITE_TRUNCATE: If the table or partition already exists, BigQuery
|
903
|
+
# overwrites the entire table or all the partitions data.
|
904
|
+
# * WRITE_APPEND: If the table or partition already exists, BigQuery
|
905
|
+
# appends the data to the table or the latest partition.
|
906
|
+
# * WRITE_EMPTY: If the table already exists and contains data, an error is
|
907
|
+
# returned.
|
908
|
+
#
|
909
|
+
# The default value is WRITE_APPEND. Each action is atomic and only occurs
|
910
|
+
# if BigQuery is able to complete the job successfully. Details are at
|
911
|
+
# https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file.
|
912
|
+
class BigQueryDestination
|
913
|
+
include ::Google::Protobuf::MessageExts
|
914
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
915
|
+
|
916
|
+
# This enum determines the partition key column for the bigquery tables.
|
917
|
+
# Partitioning can improve query performance and reduce query cost by
|
918
|
+
# filtering partitions. Refer to
|
919
|
+
# https://cloud.google.com/bigquery/docs/partitioned-tables for details.
|
920
|
+
module PartitionKey
|
921
|
+
# Unspecified partition key. Tables won't be partitioned using this
|
922
|
+
# option.
|
923
|
+
PARTITION_KEY_UNSPECIFIED = 0
|
924
|
+
|
925
|
+
# The time when the request is received. If specified as partition key,
|
926
|
+
# the result table(s) is partitoned by the RequestTime column, an
|
927
|
+
# additional timestamp column representing when the request was received.
|
928
|
+
REQUEST_TIME = 1
|
929
|
+
end
|
930
|
+
end
|
931
|
+
end
|
932
|
+
|
933
|
+
# A request message for {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy_longrunning AssetService.AnalyzeIamPolicyLongrunning}.
|
934
|
+
# @!attribute [rw] analysis_query
|
935
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery]
|
936
|
+
# Required. The request query.
|
937
|
+
# @!attribute [rw] output_config
|
938
|
+
# @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig]
|
939
|
+
# Required. Output configuration indicating where the results will be output to.
|
940
|
+
class AnalyzeIamPolicyLongrunningRequest
|
941
|
+
include ::Google::Protobuf::MessageExts
|
942
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
943
|
+
end
|
944
|
+
|
945
|
+
# A response message for {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy_longrunning AssetService.AnalyzeIamPolicyLongrunning}.
|
946
|
+
class AnalyzeIamPolicyLongrunningResponse
|
947
|
+
include ::Google::Protobuf::MessageExts
|
948
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
949
|
+
end
|
950
|
+
|
494
951
|
# Asset content type.
|
495
952
|
module ContentType
|
496
953
|
# Unspecified content type.
|
@@ -505,8 +962,11 @@ module Google
|
|
505
962
|
# The Cloud Organization Policy set on an asset.
|
506
963
|
ORG_POLICY = 4
|
507
964
|
|
508
|
-
# The Cloud Access context
|
965
|
+
# The Cloud Access context manager Policy set on an asset.
|
509
966
|
ACCESS_POLICY = 5
|
967
|
+
|
968
|
+
# The runtime OS Inventory information.
|
969
|
+
OS_INVENTORY = 6
|
510
970
|
end
|
511
971
|
end
|
512
972
|
end
|