google-cloud-asset-v1 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/asset/v1/asset_service/client.rb +532 -131
- data/lib/google/cloud/asset/v1/asset_service.rb +1 -1
- data/lib/google/cloud/asset/v1/asset_service_pb.rb +157 -0
- data/lib/google/cloud/asset/v1/asset_service_services_pb.rb +41 -14
- data/lib/google/cloud/asset/v1/version.rb +1 -1
- data/lib/google/cloud/asset/v1.rb +2 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/asset/v1/asset_service.rb +822 -219
- data/proto_docs/google/cloud/asset/v1/assets.rb +48 -35
- data/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb +16 -0
- data/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb +72 -64
- data/proto_docs/google/rpc/code.rb +6 -6
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +7 -5
@@ -238,13 +238,14 @@ module Google
|
|
238
238
|
# Exports assets with time and resource types to a given Cloud Storage
|
239
239
|
# location/BigQuery table. For Cloud Storage location destinations, the
|
240
240
|
# output format is newline-delimited JSON. Each line represents a
|
241
|
-
# {::Google::Cloud::Asset::V1::Asset google.cloud.asset.v1.Asset} in the JSON
|
242
|
-
# destinations, the output table stores the fields
|
243
|
-
# columns. This API implements the
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
247
|
-
#
|
241
|
+
# {::Google::Cloud::Asset::V1::Asset google.cloud.asset.v1.Asset} in the JSON
|
242
|
+
# format; for BigQuery table destinations, the output table stores the fields
|
243
|
+
# in asset Protobuf as columns. This API implements the
|
244
|
+
# {::Google::Longrunning::Operation google.longrunning.Operation} API, which
|
245
|
+
# allows you to keep track of the export. We recommend intervals of at least
|
246
|
+
# 2 seconds with exponential retry to poll the export operation result. For
|
247
|
+
# regular-size resource parent, the export operation usually finishes within
|
248
|
+
# 5 minutes.
|
248
249
|
#
|
249
250
|
# @overload export_assets(request, options = nil)
|
250
251
|
# Pass arguments to `export_assets` via a request object, either of type
|
@@ -295,7 +296,8 @@ module Google
|
|
295
296
|
# Asset content type. If not specified, no content but the asset name will be
|
296
297
|
# returned.
|
297
298
|
# @param output_config [::Google::Cloud::Asset::V1::OutputConfig, ::Hash]
|
298
|
-
# Required. Output configuration indicating where the results will be output
|
299
|
+
# Required. Output configuration indicating where the results will be output
|
300
|
+
# to.
|
299
301
|
# @param relationship_types [::Array<::String>]
|
300
302
|
# A list of relationship types to export, for example:
|
301
303
|
# `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
|
@@ -405,11 +407,11 @@ module Google
|
|
405
407
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
406
408
|
#
|
407
409
|
# @param parent [::String]
|
408
|
-
# Required. Name of the organization, folder, or project the assets belong
|
409
|
-
# "organizations/[organization-number]" (such as
|
410
|
-
# "projects/[project-id]" (such as
|
411
|
-
# "projects/[project-number]" (such as
|
412
|
-
# "folders/[folder-number]" (such as "folders/12345").
|
410
|
+
# Required. Name of the organization, folder, or project the assets belong
|
411
|
+
# to. Format: "organizations/[organization-number]" (such as
|
412
|
+
# "organizations/123"), "projects/[project-id]" (such as
|
413
|
+
# "projects/my-project-id"), "projects/[project-number]" (such as
|
414
|
+
# "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").
|
413
415
|
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
414
416
|
# Timestamp to take an asset snapshot. This can only be set to a timestamp
|
415
417
|
# between the current time and the current time minus 35 days (inclusive).
|
@@ -690,9 +692,8 @@ module Google
|
|
690
692
|
# Required. This is the client-assigned asset feed identifier and it needs to
|
691
693
|
# be unique under a specific parent project/folder/organization.
|
692
694
|
# @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
|
693
|
-
# Required. The feed details. The field `name` must be empty and it will be
|
694
|
-
# in the format of:
|
695
|
-
# projects/project_number/feeds/feed_id
|
695
|
+
# Required. The feed details. The field `name` must be empty and it will be
|
696
|
+
# generated in the format of: projects/project_number/feeds/feed_id
|
696
697
|
# folders/folder_number/feeds/feed_id
|
697
698
|
# organizations/organization_number/feeds/feed_id
|
698
699
|
#
|
@@ -954,8 +955,8 @@ module Google
|
|
954
955
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
955
956
|
#
|
956
957
|
# @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
|
957
|
-
# Required. The new values of feed details. It must match an existing feed
|
958
|
-
# field `name` must be in the format of:
|
958
|
+
# Required. The new values of feed details. It must match an existing feed
|
959
|
+
# and the field `name` must be in the format of:
|
959
960
|
# projects/project_number/feeds/feed_id or
|
960
961
|
# folders/folder_number/feeds/feed_id or
|
961
962
|
# organizations/organization_number/feeds/feed_id.
|
@@ -1117,8 +1118,8 @@ module Google
|
|
1117
1118
|
end
|
1118
1119
|
|
1119
1120
|
##
|
1120
|
-
# Searches all Cloud resources within the specified scope, such as a
|
1121
|
-
# folder, or organization. The caller must be granted the
|
1121
|
+
# Searches all Google Cloud resources within the specified scope, such as a
|
1122
|
+
# project, folder, or organization. The caller must be granted the
|
1122
1123
|
# `cloudasset.assets.searchAllResources` permission on the desired scope,
|
1123
1124
|
# otherwise the request will be rejected.
|
1124
1125
|
#
|
@@ -1138,8 +1139,9 @@ module Google
|
|
1138
1139
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1139
1140
|
#
|
1140
1141
|
# @param scope [::String]
|
1141
|
-
# Required. A scope can be a project, a folder, or an organization. The
|
1142
|
-
# limited to the resources within the `scope`. The caller must be
|
1142
|
+
# Required. A scope can be a project, a folder, or an organization. The
|
1143
|
+
# search is limited to the resources within the `scope`. The caller must be
|
1144
|
+
# granted the
|
1143
1145
|
# [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
|
1144
1146
|
# permission on the desired scope.
|
1145
1147
|
#
|
@@ -1157,54 +1159,54 @@ module Google
|
|
1157
1159
|
#
|
1158
1160
|
# Examples:
|
1159
1161
|
#
|
1160
|
-
# * `name:Important` to find Cloud resources whose name contains
|
1162
|
+
# * `name:Important` to find Google Cloud resources whose name contains
|
1161
1163
|
# "Important" as a word.
|
1162
|
-
# * `name=Important` to find the Cloud resource whose name is exactly
|
1164
|
+
# * `name=Important` to find the Google Cloud resource whose name is exactly
|
1163
1165
|
# "Important".
|
1164
|
-
# * `displayName:Impor*` to find Cloud resources whose display name
|
1166
|
+
# * `displayName:Impor*` to find Google Cloud resources whose display name
|
1165
1167
|
# contains "Impor" as a prefix of any word in the field.
|
1166
|
-
# * `location:us-west*` to find Cloud resources whose location
|
1167
|
-
# "us" and "west" as prefixes.
|
1168
|
-
# * `labels:prod` to find Cloud resources whose labels contain "prod"
|
1169
|
-
# a key or value.
|
1170
|
-
# * `labels.env:prod` to find Cloud resources that have a label "env"
|
1168
|
+
# * `location:us-west*` to find Google Cloud resources whose location
|
1169
|
+
# contains both "us" and "west" as prefixes.
|
1170
|
+
# * `labels:prod` to find Google Cloud resources whose labels contain "prod"
|
1171
|
+
# as a key or value.
|
1172
|
+
# * `labels.env:prod` to find Google Cloud resources that have a label "env"
|
1171
1173
|
# and its value is "prod".
|
1172
|
-
# * `labels.env:*` to find Cloud resources that have a label "env".
|
1173
|
-
# * `kmsKey:key` to find Cloud resources encrypted with a
|
1174
|
-
# encryption key whose name contains "key" as a word. This
|
1175
|
-
# deprecated. Please use the `kmsKeys` field to retrieve KMS
|
1176
|
-
# information.
|
1177
|
-
# * `kmsKeys:key` to find Cloud resources encrypted with
|
1178
|
-
# encryption keys whose name contains the word "key".
|
1179
|
-
# * `relationships:instance-group-1` to find Cloud resources that have
|
1174
|
+
# * `labels.env:*` to find Google Cloud resources that have a label "env".
|
1175
|
+
# * `kmsKey:key` to find Google Cloud resources encrypted with a
|
1176
|
+
# customer-managed encryption key whose name contains "key" as a word. This
|
1177
|
+
# field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS
|
1178
|
+
# key information.
|
1179
|
+
# * `kmsKeys:key` to find Google Cloud resources encrypted with
|
1180
|
+
# customer-managed encryption keys whose name contains the word "key".
|
1181
|
+
# * `relationships:instance-group-1` to find Google Cloud resources that have
|
1180
1182
|
# relationships with "instance-group-1" in the related resource name.
|
1181
|
-
# * `relationships:INSTANCE_TO_INSTANCEGROUP` to find
|
1182
|
-
# have relationships of type "INSTANCE_TO_INSTANCEGROUP".
|
1183
|
+
# * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine
|
1184
|
+
# instances that have relationships of type "INSTANCE_TO_INSTANCEGROUP".
|
1183
1185
|
# * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
|
1184
|
-
#
|
1185
|
-
#
|
1186
|
+
# Compute Engine instances that have relationships with "instance-group-1"
|
1187
|
+
# in the Compute Engine instance group resource name, for relationship type
|
1186
1188
|
# "INSTANCE_TO_INSTANCEGROUP".
|
1187
|
-
# * `state:ACTIVE` to find Cloud resources whose state contains
|
1188
|
-
# word.
|
1189
|
-
# * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
|
1189
|
+
# * `state:ACTIVE` to find Google Cloud resources whose state contains
|
1190
1190
|
# "ACTIVE" as a word.
|
1191
|
-
# * `
|
1192
|
-
#
|
1191
|
+
# * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't
|
1192
|
+
# contain "ACTIVE" as a word.
|
1193
|
+
# * `createTime<1609459200` to find Google Cloud resources that were created
|
1194
|
+
# before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
|
1193
1195
|
# "2021-01-01 00:00:00 UTC" in seconds.
|
1194
|
-
# * `updateTime>1609459200` to find Cloud resources that were updated
|
1195
|
-
# "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
|
1196
|
+
# * `updateTime>1609459200` to find Google Cloud resources that were updated
|
1197
|
+
# after "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
|
1196
1198
|
# "2021-01-01 00:00:00 UTC" in seconds.
|
1197
|
-
# * `Important` to find Cloud resources that contain "Important" as a
|
1198
|
-
# in any of the searchable fields.
|
1199
|
-
# * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any
|
1199
|
+
# * `Important` to find Google Cloud resources that contain "Important" as a
|
1200
1200
|
# word in any of the searchable fields.
|
1201
|
-
# * `
|
1201
|
+
# * `Impor*` to find Google Cloud resources that contain "Impor" as a prefix
|
1202
|
+
# of any word in any of the searchable fields.
|
1203
|
+
# * `Important location:(us-west1 OR global)` to find Google Cloud
|
1202
1204
|
# resources that contain "Important" as a word in any of the searchable
|
1203
1205
|
# fields and are also located in the "us-west1" region or the "global"
|
1204
1206
|
# location.
|
1205
1207
|
# @param asset_types [::Array<::String>]
|
1206
|
-
# Optional. A list of asset types that this request searches for. If empty,
|
1207
|
-
# search all the [searchable asset
|
1208
|
+
# Optional. A list of asset types that this request searches for. If empty,
|
1209
|
+
# it will search all the [searchable asset
|
1208
1210
|
# types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
|
1209
1211
|
#
|
1210
1212
|
# Regular expressions are also supported. For example:
|
@@ -1218,19 +1220,20 @@ module Google
|
|
1218
1220
|
# regular expression syntax. If the regular expression does not match any
|
1219
1221
|
# supported asset type, an INVALID_ARGUMENT error will be returned.
|
1220
1222
|
# @param page_size [::Integer]
|
1221
|
-
# Optional. The page size for search result pagination. Page size is capped
|
1222
|
-
# if a larger value is given. If set to zero, server will pick an
|
1223
|
-
# default. Returned results may be fewer than requested. When
|
1224
|
-
# there could be more results as long as `next_page_token` is
|
1223
|
+
# Optional. The page size for search result pagination. Page size is capped
|
1224
|
+
# at 500 even if a larger value is given. If set to zero, server will pick an
|
1225
|
+
# appropriate default. Returned results may be fewer than requested. When
|
1226
|
+
# this happens, there could be more results as long as `next_page_token` is
|
1227
|
+
# returned.
|
1225
1228
|
# @param page_token [::String]
|
1226
|
-
# Optional. If present, then retrieve the next batch of results from the
|
1227
|
-
# to this method. `page_token` must be the value of
|
1228
|
-
# the previous response. The values of all other
|
1229
|
-
# identical to those in the previous call.
|
1229
|
+
# Optional. If present, then retrieve the next batch of results from the
|
1230
|
+
# preceding call to this method. `page_token` must be the value of
|
1231
|
+
# `next_page_token` from the previous response. The values of all other
|
1232
|
+
# method parameters, must be identical to those in the previous call.
|
1230
1233
|
# @param order_by [::String]
|
1231
|
-
# Optional. A comma-separated list of fields specifying the sorting order of
|
1232
|
-
# results. The default order is ascending. Add " DESC" after the field
|
1233
|
-
# to indicate descending order. Redundant space characters are ignored.
|
1234
|
+
# Optional. A comma-separated list of fields specifying the sorting order of
|
1235
|
+
# the results. The default order is ascending. Add " DESC" after the field
|
1236
|
+
# name to indicate descending order. Redundant space characters are ignored.
|
1234
1237
|
# Example: "location DESC, name".
|
1235
1238
|
# Only singular primitive fields in the response are sortable:
|
1236
1239
|
#
|
@@ -1250,10 +1253,10 @@ module Google
|
|
1250
1253
|
# `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g.,
|
1251
1254
|
# `additionalAttributes`) are not supported.
|
1252
1255
|
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1253
|
-
# Optional. A comma-separated list of fields specifying which fields to be
|
1254
|
-
# ResourceSearchResult. Only '*' or combination of top level
|
1255
|
-
# specified. Field names of both snake_case and camelCase are
|
1256
|
-
# Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
|
1256
|
+
# Optional. A comma-separated list of fields specifying which fields to be
|
1257
|
+
# returned in ResourceSearchResult. Only '*' or combination of top level
|
1258
|
+
# fields can be specified. Field names of both snake_case and camelCase are
|
1259
|
+
# supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
|
1257
1260
|
#
|
1258
1261
|
# The read_mask paths must be valid field paths listed but not limited to
|
1259
1262
|
# (both snake_case and camelCase are supported):
|
@@ -1270,7 +1273,7 @@ module Google
|
|
1270
1273
|
# * labels
|
1271
1274
|
# * networkTags
|
1272
1275
|
# * kmsKey (This field is deprecated. Please use the `kmsKeys` field to
|
1273
|
-
# retrieve KMS key information.)
|
1276
|
+
# retrieve Cloud KMS key information.)
|
1274
1277
|
# * kmsKeys
|
1275
1278
|
# * createTime
|
1276
1279
|
# * updateTime
|
@@ -1377,9 +1380,9 @@ module Google
|
|
1377
1380
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1378
1381
|
#
|
1379
1382
|
# @param scope [::String]
|
1380
|
-
# Required. A scope can be a project, a folder, or an organization. The
|
1381
|
-
# limited to the IAM policies within the `scope`. The caller must
|
1382
|
-
# the
|
1383
|
+
# Required. A scope can be a project, a folder, or an organization. The
|
1384
|
+
# search is limited to the IAM policies within the `scope`. The caller must
|
1385
|
+
# be granted the
|
1383
1386
|
# [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
|
1384
1387
|
# permission on the desired scope.
|
1385
1388
|
#
|
@@ -1394,8 +1397,8 @@ module Google
|
|
1394
1397
|
# query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
|
1395
1398
|
# for more information. If not specified or empty, it will search all the
|
1396
1399
|
# IAM policies within the specified `scope`. Note that the query string is
|
1397
|
-
# compared against each
|
1398
|
-
# roles, and
|
1400
|
+
# compared against each IAM policy binding, including its principals,
|
1401
|
+
# roles, and IAM conditions. The returned IAM policies will only
|
1399
1402
|
# contain the bindings that match your query. To learn more about the IAM
|
1400
1403
|
# policy structure, see the [IAM policy
|
1401
1404
|
# documentation](https://cloud.google.com/iam/help/allow-policies/structure).
|
@@ -1433,18 +1436,20 @@ module Google
|
|
1433
1436
|
# * `memberTypes:user` to find IAM policy bindings that contain the
|
1434
1437
|
# principal type "user".
|
1435
1438
|
# @param page_size [::Integer]
|
1436
|
-
# Optional. The page size for search result pagination. Page size is capped
|
1437
|
-
# if a larger value is given. If set to zero, server will pick an
|
1438
|
-
# default. Returned results may be fewer than requested. When
|
1439
|
-
# there could be more results as long as `next_page_token` is
|
1439
|
+
# Optional. The page size for search result pagination. Page size is capped
|
1440
|
+
# at 500 even if a larger value is given. If set to zero, server will pick an
|
1441
|
+
# appropriate default. Returned results may be fewer than requested. When
|
1442
|
+
# this happens, there could be more results as long as `next_page_token` is
|
1443
|
+
# returned.
|
1440
1444
|
# @param page_token [::String]
|
1441
|
-
# Optional. If present, retrieve the next batch of results from the preceding
|
1442
|
-
# this method. `page_token` must be the value of `next_page_token`
|
1443
|
-
# previous response. The values of all other method parameters must
|
1444
|
-
# identical to those in the previous call.
|
1445
|
+
# Optional. If present, retrieve the next batch of results from the preceding
|
1446
|
+
# call to this method. `page_token` must be the value of `next_page_token`
|
1447
|
+
# from the previous response. The values of all other method parameters must
|
1448
|
+
# be identical to those in the previous call.
|
1445
1449
|
# @param asset_types [::Array<::String>]
|
1446
|
-
# Optional. A list of asset types that the IAM policies are attached to. If
|
1447
|
-
# will search the IAM policies that are attached to all the
|
1450
|
+
# Optional. A list of asset types that the IAM policies are attached to. If
|
1451
|
+
# empty, it will search the IAM policies that are attached to all the
|
1452
|
+
# [searchable asset
|
1448
1453
|
# types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
|
1449
1454
|
#
|
1450
1455
|
# Regular expressions are also supported. For example:
|
@@ -1460,9 +1465,9 @@ module Google
|
|
1460
1465
|
# regular expression syntax. If the regular expression does not match any
|
1461
1466
|
# supported asset type, an INVALID_ARGUMENT error will be returned.
|
1462
1467
|
# @param order_by [::String]
|
1463
|
-
# Optional. A comma-separated list of fields specifying the sorting order of
|
1464
|
-
# results. The default order is ascending. Add " DESC" after the field
|
1465
|
-
# to indicate descending order. Redundant space characters are ignored.
|
1468
|
+
# Optional. A comma-separated list of fields specifying the sorting order of
|
1469
|
+
# the results. The default order is ascending. Add " DESC" after the field
|
1470
|
+
# name to indicate descending order. Redundant space characters are ignored.
|
1466
1471
|
# Example: "assetType DESC, resource".
|
1467
1472
|
# Only singular primitive fields in the response are sortable:
|
1468
1473
|
# * resource
|
@@ -1581,7 +1586,8 @@ module Google
|
|
1581
1586
|
# 0 or empty string, etc., because we use proto3, which doesn't support field
|
1582
1587
|
# presence yet.
|
1583
1588
|
# @param execution_timeout [::Google::Protobuf::Duration, ::Hash]
|
1584
|
-
# Optional. Amount of time executable has to complete. See JSON
|
1589
|
+
# Optional. Amount of time executable has to complete. See JSON
|
1590
|
+
# representation of
|
1585
1591
|
# [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
1586
1592
|
#
|
1587
1593
|
# If this field is set with a value less than the RPC deadline, and the
|
@@ -1661,11 +1667,12 @@ module Google
|
|
1661
1667
|
# accesses on which resources, and writes the analysis results to a Google
|
1662
1668
|
# Cloud Storage or a BigQuery destination. For Cloud Storage destination, the
|
1663
1669
|
# output format is the JSON format that represents a
|
1664
|
-
# {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse AnalyzeIamPolicyResponse}.
|
1665
|
-
#
|
1666
|
-
#
|
1667
|
-
#
|
1668
|
-
#
|
1670
|
+
# {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse AnalyzeIamPolicyResponse}.
|
1671
|
+
# This method implements the
|
1672
|
+
# {::Google::Longrunning::Operation google.longrunning.Operation}, which allows
|
1673
|
+
# you to track the operation status. We recommend intervals of at least 2
|
1674
|
+
# seconds with exponential backoff retry to poll the operation result. The
|
1675
|
+
# metadata contains the metadata for the long-running operation.
|
1669
1676
|
#
|
1670
1677
|
# @overload analyze_iam_policy_longrunning(request, options = nil)
|
1671
1678
|
# Pass arguments to `analyze_iam_policy_longrunning` via a request object, either of type
|
@@ -1702,7 +1709,8 @@ module Google
|
|
1702
1709
|
# 0 or empty string, etc., because we use proto3, which doesn't support field
|
1703
1710
|
# presence yet.
|
1704
1711
|
# @param output_config [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig, ::Hash]
|
1705
|
-
# Required. Output configuration indicating where the results will be output
|
1712
|
+
# Required. Output configuration indicating where the results will be output
|
1713
|
+
# to.
|
1706
1714
|
#
|
1707
1715
|
# @yield [response, operation] Access the result along with the RPC operation
|
1708
1716
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1800,14 +1808,14 @@ module Google
|
|
1800
1808
|
#
|
1801
1809
|
# @param resource [::String]
|
1802
1810
|
# Required. Name of the resource to perform the analysis against.
|
1803
|
-
# Only
|
1804
|
-
# ID (such as "projects/my-project-id") or a
|
1805
|
-
# "projects/12345").
|
1811
|
+
# Only Google Cloud projects are supported as of today. Hence, this can only
|
1812
|
+
# be a project ID (such as "projects/my-project-id") or a project number
|
1813
|
+
# (such as "projects/12345").
|
1806
1814
|
# @param destination_parent [::String]
|
1807
|
-
# Required. Name of the
|
1808
|
-
# resource. The analysis will be performed against hypothetically
|
1809
|
-
# resource to this specified desitination parent. This can only be
|
1810
|
-
# number (such as "folders/123") or an
|
1815
|
+
# Required. Name of the Google Cloud folder or organization to reparent the
|
1816
|
+
# target resource. The analysis will be performed against hypothetically
|
1817
|
+
# moving the resource to this specified desitination parent. This can only be
|
1818
|
+
# a folder number (such as "folders/123") or an organization number (such as
|
1811
1819
|
# "organizations/123").
|
1812
1820
|
# @param view [::Google::Cloud::Asset::V1::AnalyzeMoveRequest::AnalysisView]
|
1813
1821
|
# Analysis view indicating what information should be included in the
|
@@ -1919,11 +1927,11 @@ module Google
|
|
1919
1927
|
# Optional. A SQL statement that's compatible with [BigQuery Standard
|
1920
1928
|
# SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
|
1921
1929
|
# @param job_reference [::String]
|
1922
|
-
# Optional. Reference to the query job, which is from the
|
1923
|
-
# previous `QueryAssets` call.
|
1930
|
+
# Optional. Reference to the query job, which is from the
|
1931
|
+
# `QueryAssetsResponse` of previous `QueryAssets` call.
|
1924
1932
|
# @param page_size [::Integer]
|
1925
|
-
# Optional. The maximum number of rows to return in the results. Responses
|
1926
|
-
# to 10 MB and 1000 rows.
|
1933
|
+
# Optional. The maximum number of rows to return in the results. Responses
|
1934
|
+
# are limited to 10 MB and 1000 rows.
|
1927
1935
|
#
|
1928
1936
|
# By default, the maximum row count is 1000. When the byte or row count limit
|
1929
1937
|
# is reached, the rest of the query results will be paginated.
|
@@ -1934,10 +1942,11 @@ module Google
|
|
1934
1942
|
#
|
1935
1943
|
# The field will be ignored when [output_config] is specified.
|
1936
1944
|
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
1937
|
-
# Optional. Specifies the maximum amount of time that the client is willing
|
1938
|
-
# for the query to complete. By default, this limit is 5 min for the
|
1939
|
-
# query, and 1 minute for the following queries. If the query is
|
1940
|
-
# the `done` field in the `QueryAssetsResponse` is true, otherwise
|
1945
|
+
# Optional. Specifies the maximum amount of time that the client is willing
|
1946
|
+
# to wait for the query to complete. By default, this limit is 5 min for the
|
1947
|
+
# first query, and 1 minute for the following queries. If the query is
|
1948
|
+
# complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
|
1949
|
+
# false.
|
1941
1950
|
#
|
1942
1951
|
# Like BigQuery [jobs.query
|
1943
1952
|
# API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
|
@@ -1947,11 +1956,12 @@ module Google
|
|
1947
1956
|
#
|
1948
1957
|
# The field will be ignored when [output_config] is specified.
|
1949
1958
|
# @param read_time_window [::Google::Cloud::Asset::V1::TimeWindow, ::Hash]
|
1950
|
-
# Optional. [start_time] is required. [start_time] must be less than
|
1951
|
-
# Defaults [end_time] to now if [start_time] is set and
|
1952
|
-
# Maximum permitted time range is 7 days.
|
1959
|
+
# Optional. [start_time] is required. [start_time] must be less than
|
1960
|
+
# [end_time] Defaults [end_time] to now if [start_time] is set and
|
1961
|
+
# [end_time] isn't. Maximum permitted time range is 7 days.
|
1953
1962
|
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
1954
|
-
# Optional. Queries cloud assets as they appeared at the specified point in
|
1963
|
+
# Optional. Queries cloud assets as they appeared at the specified point in
|
1964
|
+
# time.
|
1955
1965
|
# @param output_config [::Google::Cloud::Asset::V1::QueryAssetsOutputConfig, ::Hash]
|
1956
1966
|
# Optional. Destination where the query results will be saved.
|
1957
1967
|
#
|
@@ -2046,21 +2056,21 @@ module Google
|
|
2046
2056
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2047
2057
|
#
|
2048
2058
|
# @param parent [::String]
|
2049
|
-
# Required. The name of the project/folder/organization where this
|
2050
|
-
# should be created in. It can only be an organization number
|
2051
|
-
# "organizations/123"), a folder number (such as "folders/123"), a
|
2052
|
-
# (such as "projects/my-project-id")", or a project number (such
|
2053
|
-
# "projects/12345").
|
2059
|
+
# Required. The name of the project/folder/organization where this
|
2060
|
+
# saved_query should be created in. It can only be an organization number
|
2061
|
+
# (such as "organizations/123"), a folder number (such as "folders/123"), a
|
2062
|
+
# project ID (such as "projects/my-project-id")", or a project number (such
|
2063
|
+
# as "projects/12345").
|
2054
2064
|
# @param saved_query [::Google::Cloud::Asset::V1::SavedQuery, ::Hash]
|
2055
|
-
# Required. The saved_query details. The `name` field must be empty as it
|
2056
|
-
# generated based on the parent and saved_query_id.
|
2065
|
+
# Required. The saved_query details. The `name` field must be empty as it
|
2066
|
+
# will be generated based on the parent and saved_query_id.
|
2057
2067
|
# @param saved_query_id [::String]
|
2058
|
-
# Required. The ID to use for the saved query, which must be unique in the
|
2059
|
-
# parent. It will become the final component of the saved query's
|
2060
|
-
# name.
|
2068
|
+
# Required. The ID to use for the saved query, which must be unique in the
|
2069
|
+
# specified parent. It will become the final component of the saved query's
|
2070
|
+
# resource name.
|
2061
2071
|
#
|
2062
2072
|
# This value should be 4-63 characters, and valid characters
|
2063
|
-
# are
|
2073
|
+
# are `[a-z][0-9]-`.
|
2064
2074
|
#
|
2065
2075
|
# Notice that this field is required in the saved query creation, and the
|
2066
2076
|
# `name` field of the `saved_query` will be ignored.
|
@@ -2237,8 +2247,8 @@ module Google
|
|
2237
2247
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2238
2248
|
#
|
2239
2249
|
# @param parent [::String]
|
2240
|
-
# Required. The parent project/folder/organization whose savedQueries are to
|
2241
|
-
# listed. It can only be using project/folder/organization number (such as
|
2250
|
+
# Required. The parent project/folder/organization whose savedQueries are to
|
2251
|
+
# be listed. It can only be using project/folder/organization number (such as
|
2242
2252
|
# "folders/12345")", or a project ID (such as "projects/my-project-id").
|
2243
2253
|
# @param filter [::String]
|
2244
2254
|
# Optional. The expression to filter resources.
|
@@ -2249,8 +2259,9 @@ module Google
|
|
2249
2259
|
#
|
2250
2260
|
# See https://google.aip.dev/160 for more information on the grammar.
|
2251
2261
|
# @param page_size [::Integer]
|
2252
|
-
# Optional. The maximum number of saved queries to return per page. The
|
2253
|
-
# return fewer than this value. If unspecified, at most 50 will
|
2262
|
+
# Optional. The maximum number of saved queries to return per page. The
|
2263
|
+
# service may return fewer than this value. If unspecified, at most 50 will
|
2264
|
+
# be returned.
|
2254
2265
|
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
2255
2266
|
# @param page_token [::String]
|
2256
2267
|
# Optional. A page token, received from a previous `ListSavedQueries` call.
|
@@ -2443,7 +2454,8 @@ module Google
|
|
2443
2454
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2444
2455
|
#
|
2445
2456
|
# @param name [::String]
|
2446
|
-
# Required. The name of the saved query to delete. It must be in the format
|
2457
|
+
# Required. The name of the saved query to delete. It must be in the format
|
2458
|
+
# of:
|
2447
2459
|
#
|
2448
2460
|
# * projects/project_number/savedQueries/saved_query_id
|
2449
2461
|
# * folders/folder_number/savedQueries/saved_query_id
|
@@ -2614,6 +2626,374 @@ module Google
|
|
2614
2626
|
raise ::Google::Cloud::Error.from_error(e)
|
2615
2627
|
end
|
2616
2628
|
|
2629
|
+
##
|
2630
|
+
# Analyzes organization policies under a scope.
|
2631
|
+
#
|
2632
|
+
# @overload analyze_org_policies(request, options = nil)
|
2633
|
+
# Pass arguments to `analyze_org_policies` via a request object, either of type
|
2634
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest} or an equivalent Hash.
|
2635
|
+
#
|
2636
|
+
# @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest, ::Hash]
|
2637
|
+
# A request object representing the call parameters. Required. To specify no
|
2638
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2639
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2640
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2641
|
+
#
|
2642
|
+
# @overload analyze_org_policies(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
|
2643
|
+
# Pass arguments to `analyze_org_policies` via keyword arguments. Note that at
|
2644
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2645
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2646
|
+
#
|
2647
|
+
# @param scope [::String]
|
2648
|
+
# Required. The organization to scope the request. Only organization
|
2649
|
+
# policies within the scope will be analyzed.
|
2650
|
+
#
|
2651
|
+
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
|
2652
|
+
# @param constraint [::String]
|
2653
|
+
# Required. The name of the constraint to analyze organization policies for.
|
2654
|
+
# The response only contains analyzed organization policies for the provided
|
2655
|
+
# constraint.
|
2656
|
+
# @param filter [::String]
|
2657
|
+
# The expression to filter
|
2658
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}.
|
2659
|
+
# The only supported field is `consolidated_policy.attached_resource`, and
|
2660
|
+
# the only supported operator is `=`.
|
2661
|
+
#
|
2662
|
+
# Example:
|
2663
|
+
# consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001"
|
2664
|
+
# will return the org policy results of"folders/001".
|
2665
|
+
# @param page_size [::Integer]
|
2666
|
+
# The maximum number of items to return per page. If unspecified,
|
2667
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}
|
2668
|
+
# will contain 20 items with a maximum of 200.
|
2669
|
+
# @param page_token [::String]
|
2670
|
+
# The pagination token to retrieve the next page.
|
2671
|
+
#
|
2672
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2673
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
|
2674
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2675
|
+
#
|
2676
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
|
2677
|
+
#
|
2678
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2679
|
+
#
|
2680
|
+
# @example Basic example
|
2681
|
+
# require "google/cloud/asset/v1"
|
2682
|
+
#
|
2683
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2684
|
+
# client = Google::Cloud::Asset::V1::AssetService::Client.new
|
2685
|
+
#
|
2686
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2687
|
+
# request = Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest.new
|
2688
|
+
#
|
2689
|
+
# # Call the analyze_org_policies method.
|
2690
|
+
# result = client.analyze_org_policies request
|
2691
|
+
#
|
2692
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2693
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2694
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2695
|
+
# # methods are also available for managing paging directly.
|
2696
|
+
# result.each do |response|
|
2697
|
+
# # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult.
|
2698
|
+
# p response
|
2699
|
+
# end
|
2700
|
+
#
|
2701
|
+
def analyze_org_policies request, options = nil
|
2702
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2703
|
+
|
2704
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest
|
2705
|
+
|
2706
|
+
# Converts hash and nil to an options object
|
2707
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2708
|
+
|
2709
|
+
# Customize the options with defaults
|
2710
|
+
metadata = @config.rpcs.analyze_org_policies.metadata.to_h
|
2711
|
+
|
2712
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2713
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2714
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2715
|
+
gapic_version: ::Google::Cloud::Asset::V1::VERSION
|
2716
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2717
|
+
|
2718
|
+
header_params = {}
|
2719
|
+
if request.scope
|
2720
|
+
header_params["scope"] = request.scope
|
2721
|
+
end
|
2722
|
+
|
2723
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2724
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2725
|
+
|
2726
|
+
options.apply_defaults timeout: @config.rpcs.analyze_org_policies.timeout,
|
2727
|
+
metadata: metadata,
|
2728
|
+
retry_policy: @config.rpcs.analyze_org_policies.retry_policy
|
2729
|
+
|
2730
|
+
options.apply_defaults timeout: @config.timeout,
|
2731
|
+
metadata: @config.metadata,
|
2732
|
+
retry_policy: @config.retry_policy
|
2733
|
+
|
2734
|
+
@asset_service_stub.call_rpc :analyze_org_policies, request, options: options do |response, operation|
|
2735
|
+
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, request, response, operation, options
|
2736
|
+
yield response, operation if block_given?
|
2737
|
+
return response
|
2738
|
+
end
|
2739
|
+
rescue ::GRPC::BadStatus => e
|
2740
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2741
|
+
end
|
2742
|
+
|
2743
|
+
##
|
2744
|
+
# Analyzes organization policies governed containers (projects, folders or
|
2745
|
+
# organization) under a scope.
|
2746
|
+
#
|
2747
|
+
# @overload analyze_org_policy_governed_containers(request, options = nil)
|
2748
|
+
# Pass arguments to `analyze_org_policy_governed_containers` via a request object, either of type
|
2749
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest} or an equivalent Hash.
|
2750
|
+
#
|
2751
|
+
# @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest, ::Hash]
|
2752
|
+
# A request object representing the call parameters. Required. To specify no
|
2753
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2754
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2755
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2756
|
+
#
|
2757
|
+
# @overload analyze_org_policy_governed_containers(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
|
2758
|
+
# Pass arguments to `analyze_org_policy_governed_containers` via keyword arguments. Note that at
|
2759
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2760
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2761
|
+
#
|
2762
|
+
# @param scope [::String]
|
2763
|
+
# Required. The organization to scope the request. Only organization
|
2764
|
+
# policies within the scope will be analyzed. The output containers will
|
2765
|
+
# also be limited to the ones governed by those in-scope organization
|
2766
|
+
# policies.
|
2767
|
+
#
|
2768
|
+
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
|
2769
|
+
# @param constraint [::String]
|
2770
|
+
# Required. The name of the constraint to analyze governed containers for.
|
2771
|
+
# The analysis only contains organization policies for the provided
|
2772
|
+
# constraint.
|
2773
|
+
# @param filter [::String]
|
2774
|
+
# The expression to filter the governed containers in result.
|
2775
|
+
# The only supported field is `parent`, and the only supported operator is
|
2776
|
+
# `=`.
|
2777
|
+
#
|
2778
|
+
# Example:
|
2779
|
+
# parent="//cloudresourcemanager.googleapis.com/folders/001" will return all
|
2780
|
+
# containers under "folders/001".
|
2781
|
+
# @param page_size [::Integer]
|
2782
|
+
# The maximum number of items to return per page. If unspecified,
|
2783
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse#governed_containers AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}
|
2784
|
+
# will contain 100 items with a maximum of 200.
|
2785
|
+
# @param page_token [::String]
|
2786
|
+
# The pagination token to retrieve the next page.
|
2787
|
+
#
|
2788
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2789
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
|
2790
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2791
|
+
#
|
2792
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
|
2793
|
+
#
|
2794
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2795
|
+
#
|
2796
|
+
# @example Basic example
|
2797
|
+
# require "google/cloud/asset/v1"
|
2798
|
+
#
|
2799
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2800
|
+
# client = Google::Cloud::Asset::V1::AssetService::Client.new
|
2801
|
+
#
|
2802
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2803
|
+
# request = Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest.new
|
2804
|
+
#
|
2805
|
+
# # Call the analyze_org_policy_governed_containers method.
|
2806
|
+
# result = client.analyze_org_policy_governed_containers request
|
2807
|
+
#
|
2808
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2809
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2810
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2811
|
+
# # methods are also available for managing paging directly.
|
2812
|
+
# result.each do |response|
|
2813
|
+
# # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer.
|
2814
|
+
# p response
|
2815
|
+
# end
|
2816
|
+
#
|
2817
|
+
def analyze_org_policy_governed_containers request, options = nil
|
2818
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2819
|
+
|
2820
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest
|
2821
|
+
|
2822
|
+
# Converts hash and nil to an options object
|
2823
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2824
|
+
|
2825
|
+
# Customize the options with defaults
|
2826
|
+
metadata = @config.rpcs.analyze_org_policy_governed_containers.metadata.to_h
|
2827
|
+
|
2828
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2829
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2830
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2831
|
+
gapic_version: ::Google::Cloud::Asset::V1::VERSION
|
2832
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2833
|
+
|
2834
|
+
header_params = {}
|
2835
|
+
if request.scope
|
2836
|
+
header_params["scope"] = request.scope
|
2837
|
+
end
|
2838
|
+
|
2839
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2840
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2841
|
+
|
2842
|
+
options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_containers.timeout,
|
2843
|
+
metadata: metadata,
|
2844
|
+
retry_policy: @config.rpcs.analyze_org_policy_governed_containers.retry_policy
|
2845
|
+
|
2846
|
+
options.apply_defaults timeout: @config.timeout,
|
2847
|
+
metadata: @config.metadata,
|
2848
|
+
retry_policy: @config.retry_policy
|
2849
|
+
|
2850
|
+
@asset_service_stub.call_rpc :analyze_org_policy_governed_containers, request, options: options do |response, operation|
|
2851
|
+
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, request, response, operation, options
|
2852
|
+
yield response, operation if block_given?
|
2853
|
+
return response
|
2854
|
+
end
|
2855
|
+
rescue ::GRPC::BadStatus => e
|
2856
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2857
|
+
end
|
2858
|
+
|
2859
|
+
##
|
2860
|
+
# Analyzes organization policies governed assets (Google Cloud resources or
|
2861
|
+
# policies) under a scope. This RPC supports custom constraints and the
|
2862
|
+
# following 10 canned constraints:
|
2863
|
+
#
|
2864
|
+
# * storage.uniformBucketLevelAccess
|
2865
|
+
# * iam.disableServiceAccountKeyCreation
|
2866
|
+
# * iam.allowedPolicyMemberDomains
|
2867
|
+
# * compute.vmExternalIpAccess
|
2868
|
+
# * appengine.enforceServiceAccountActAsCheck
|
2869
|
+
# * gcp.resourceLocations
|
2870
|
+
# * compute.trustedImageProjects
|
2871
|
+
# * compute.skipDefaultNetworkCreation
|
2872
|
+
# * compute.requireOsLogin
|
2873
|
+
# * compute.disableNestedVirtualization
|
2874
|
+
#
|
2875
|
+
# This RPC only returns either resources of types supported by [searchable
|
2876
|
+
# asset
|
2877
|
+
# types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
|
2878
|
+
# or IAM policies.
|
2879
|
+
#
|
2880
|
+
# @overload analyze_org_policy_governed_assets(request, options = nil)
|
2881
|
+
# Pass arguments to `analyze_org_policy_governed_assets` via a request object, either of type
|
2882
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest} or an equivalent Hash.
|
2883
|
+
#
|
2884
|
+
# @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest, ::Hash]
|
2885
|
+
# A request object representing the call parameters. Required. To specify no
|
2886
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2887
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2888
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2889
|
+
#
|
2890
|
+
# @overload analyze_org_policy_governed_assets(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
|
2891
|
+
# Pass arguments to `analyze_org_policy_governed_assets` via keyword arguments. Note that at
|
2892
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2893
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2894
|
+
#
|
2895
|
+
# @param scope [::String]
|
2896
|
+
# Required. The organization to scope the request. Only organization
|
2897
|
+
# policies within the scope will be analyzed. The output assets will
|
2898
|
+
# also be limited to the ones governed by those in-scope organization
|
2899
|
+
# policies.
|
2900
|
+
#
|
2901
|
+
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
|
2902
|
+
# @param constraint [::String]
|
2903
|
+
# Required. The name of the constraint to analyze governed assets for. The
|
2904
|
+
# analysis only contains analyzed organization policies for the provided
|
2905
|
+
# constraint.
|
2906
|
+
# @param filter [::String]
|
2907
|
+
# The expression to filter the governed assets in result. The only supported
|
2908
|
+
# fields for governed resources are `governed_resource.project` and
|
2909
|
+
# `governed_resource.folders`. The only supported fields for governed iam
|
2910
|
+
# policies are `governed_iam_policy.project` and
|
2911
|
+
# `governed_iam_policy.folders`. The only supported operator is `=`.
|
2912
|
+
#
|
2913
|
+
# Example 1: governed_resource.project="projects/12345678" filter will return
|
2914
|
+
# all governed resources under projects/12345678 including the project
|
2915
|
+
# ifself, if applicable.
|
2916
|
+
#
|
2917
|
+
# Example 2: governed_iam_policy.folders="folders/12345678" filter will
|
2918
|
+
# return all governed iam policies under folders/12345678, if applicable.
|
2919
|
+
# @param page_size [::Integer]
|
2920
|
+
# The maximum number of items to return per page. If unspecified,
|
2921
|
+
# {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse#governed_assets AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}
|
2922
|
+
# will contain 100 items with a maximum of 200.
|
2923
|
+
# @param page_token [::String]
|
2924
|
+
# The pagination token to retrieve the next page.
|
2925
|
+
#
|
2926
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2927
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
|
2928
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2929
|
+
#
|
2930
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
|
2931
|
+
#
|
2932
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2933
|
+
#
|
2934
|
+
# @example Basic example
|
2935
|
+
# require "google/cloud/asset/v1"
|
2936
|
+
#
|
2937
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2938
|
+
# client = Google::Cloud::Asset::V1::AssetService::Client.new
|
2939
|
+
#
|
2940
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2941
|
+
# request = Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest.new
|
2942
|
+
#
|
2943
|
+
# # Call the analyze_org_policy_governed_assets method.
|
2944
|
+
# result = client.analyze_org_policy_governed_assets request
|
2945
|
+
#
|
2946
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2947
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2948
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2949
|
+
# # methods are also available for managing paging directly.
|
2950
|
+
# result.each do |response|
|
2951
|
+
# # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset.
|
2952
|
+
# p response
|
2953
|
+
# end
|
2954
|
+
#
|
2955
|
+
def analyze_org_policy_governed_assets request, options = nil
|
2956
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2957
|
+
|
2958
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest
|
2959
|
+
|
2960
|
+
# Converts hash and nil to an options object
|
2961
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2962
|
+
|
2963
|
+
# Customize the options with defaults
|
2964
|
+
metadata = @config.rpcs.analyze_org_policy_governed_assets.metadata.to_h
|
2965
|
+
|
2966
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2967
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2968
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2969
|
+
gapic_version: ::Google::Cloud::Asset::V1::VERSION
|
2970
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2971
|
+
|
2972
|
+
header_params = {}
|
2973
|
+
if request.scope
|
2974
|
+
header_params["scope"] = request.scope
|
2975
|
+
end
|
2976
|
+
|
2977
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2978
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2979
|
+
|
2980
|
+
options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_assets.timeout,
|
2981
|
+
metadata: metadata,
|
2982
|
+
retry_policy: @config.rpcs.analyze_org_policy_governed_assets.retry_policy
|
2983
|
+
|
2984
|
+
options.apply_defaults timeout: @config.timeout,
|
2985
|
+
metadata: @config.metadata,
|
2986
|
+
retry_policy: @config.retry_policy
|
2987
|
+
|
2988
|
+
@asset_service_stub.call_rpc :analyze_org_policy_governed_assets, request, options: options do |response, operation|
|
2989
|
+
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, request, response, operation, options
|
2990
|
+
yield response, operation if block_given?
|
2991
|
+
return response
|
2992
|
+
end
|
2993
|
+
rescue ::GRPC::BadStatus => e
|
2994
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2995
|
+
end
|
2996
|
+
|
2617
2997
|
##
|
2618
2998
|
# Configuration class for the AssetService API.
|
2619
2999
|
#
|
@@ -2849,6 +3229,21 @@ module Google
|
|
2849
3229
|
# @return [::Gapic::Config::Method]
|
2850
3230
|
#
|
2851
3231
|
attr_reader :batch_get_effective_iam_policies
|
3232
|
+
##
|
3233
|
+
# RPC-specific configuration for `analyze_org_policies`
|
3234
|
+
# @return [::Gapic::Config::Method]
|
3235
|
+
#
|
3236
|
+
attr_reader :analyze_org_policies
|
3237
|
+
##
|
3238
|
+
# RPC-specific configuration for `analyze_org_policy_governed_containers`
|
3239
|
+
# @return [::Gapic::Config::Method]
|
3240
|
+
#
|
3241
|
+
attr_reader :analyze_org_policy_governed_containers
|
3242
|
+
##
|
3243
|
+
# RPC-specific configuration for `analyze_org_policy_governed_assets`
|
3244
|
+
# @return [::Gapic::Config::Method]
|
3245
|
+
#
|
3246
|
+
attr_reader :analyze_org_policy_governed_assets
|
2852
3247
|
|
2853
3248
|
# @private
|
2854
3249
|
def initialize parent_rpcs = nil
|
@@ -2892,6 +3287,12 @@ module Google
|
|
2892
3287
|
@delete_saved_query = ::Gapic::Config::Method.new delete_saved_query_config
|
2893
3288
|
batch_get_effective_iam_policies_config = parent_rpcs.batch_get_effective_iam_policies if parent_rpcs.respond_to? :batch_get_effective_iam_policies
|
2894
3289
|
@batch_get_effective_iam_policies = ::Gapic::Config::Method.new batch_get_effective_iam_policies_config
|
3290
|
+
analyze_org_policies_config = parent_rpcs.analyze_org_policies if parent_rpcs.respond_to? :analyze_org_policies
|
3291
|
+
@analyze_org_policies = ::Gapic::Config::Method.new analyze_org_policies_config
|
3292
|
+
analyze_org_policy_governed_containers_config = parent_rpcs.analyze_org_policy_governed_containers if parent_rpcs.respond_to? :analyze_org_policy_governed_containers
|
3293
|
+
@analyze_org_policy_governed_containers = ::Gapic::Config::Method.new analyze_org_policy_governed_containers_config
|
3294
|
+
analyze_org_policy_governed_assets_config = parent_rpcs.analyze_org_policy_governed_assets if parent_rpcs.respond_to? :analyze_org_policy_governed_assets
|
3295
|
+
@analyze_org_policy_governed_assets = ::Gapic::Config::Method.new analyze_org_policy_governed_assets_config
|
2895
3296
|
|
2896
3297
|
yield self if block_given?
|
2897
3298
|
end
|