Skip to content

Commit 3013057

Browse files
feat: [asset] added new resource references to fields in AnalyzeMoveRequest (#4881)
* feat: added messages ExportAssetsResponse, BatchGetAssetsHistoryResponse feat: added Asset.access_policy, access_level, service_perimeter, org_policy feat: added resource definitions to some messages docs: updated comments chore: removed backend configuration from service config PiperOrigin-RevId: 589961470 Source-Link: googleapis/googleapis@02fbe75 Source-Link: googleapis/googleapis-gen@2a25ee3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiIyYTI1ZWUzNjM4YWJkYzJlYTUyMGM4N2UxZDRjN2M1M2ZjNjI0ZTMwIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added new resource references to fields in AnalyzeMoveRequest docs: updated comments chore: removed backend configuration from service config PiperOrigin-RevId: 590982722 Source-Link: googleapis/googleapis@da09f4c Source-Link: googleapis/googleapis-gen@7dd789a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiI3ZGQ3ODlhMmNhZDRkNTQ0ZmJiNTNhMTVjZTU5ZGViNDY3ZjMwYjZkIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d74d48d commit 3013057

25 files changed

Lines changed: 2132 additions & 354 deletions

packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto

Lines changed: 77 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ service AssetService {
306306
//
307307
// This RPC only returns either resources of types supported by [searchable
308308
// asset
309-
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
309+
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types),
310310
// or IAM policies.
311311
rpc AnalyzeOrgPolicyGovernedAssets(AnalyzeOrgPolicyGovernedAssetsRequest)
312312
returns (AnalyzeOrgPolicyGovernedAssetsResponse) {
@@ -923,31 +923,31 @@ message SearchAllResourcesRequest {
923923
// * `labels.env:*` to find Google Cloud resources that have a label `env`.
924924
// * `tagKeys:env` to find Google Cloud resources that have directly
925925
// attached tags where the
926-
// [`TagKey`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
927-
// .`namespacedName` contains `env`.
926+
// [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
927+
// contains `env`.
928928
// * `tagValues:prod*` to find Google Cloud resources that have directly
929929
// attached tags where the
930-
// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
931-
// .`namespacedName` contains a word prefixed by `prod`.
930+
// [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
931+
// contains a word prefixed by `prod`.
932932
// * `tagValueIds=tagValues/123` to find Google Cloud resources that have
933933
// directly attached tags where the
934-
// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
935-
// .`name` is exactly `tagValues/123`.
934+
// [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
935+
// is exactly `tagValues/123`.
936936
// * `effectiveTagKeys:env` to find Google Cloud resources that have
937937
// directly attached or inherited tags where the
938-
// [`TagKey`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
939-
// .`namespacedName` contains `env`.
938+
// [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
939+
// contains `env`.
940940
// * `effectiveTagValues:prod*` to find Google Cloud resources that have
941941
// directly attached or inherited tags where the
942-
// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
943-
// .`namespacedName` contains a word prefixed by `prod`.
942+
// [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
943+
// contains a word prefixed by `prod`.
944944
// * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that
945945
// have directly attached or inherited tags where the
946-
// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
947-
// .`name` is exactly `tagValues/123`.
946+
// [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
947+
// is exactly `tagValues/123`.
948948
// * `kmsKey:key` to find Google Cloud resources encrypted with a
949949
// customer-managed encryption key whose name contains `key` as a word. This
950-
// field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS
950+
// field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS
951951
// key information.
952952
// * `kmsKeys:key` to find Google Cloud resources encrypted with
953953
// customer-managed encryption keys whose name contains the word `key`.
@@ -959,6 +959,10 @@ message SearchAllResourcesRequest {
959959
// Compute Engine instances that have relationships with `instance-group-1`
960960
// in the Compute Engine instance group resource name, for relationship type
961961
// `INSTANCE_TO_INSTANCEGROUP`.
962+
// * `sccSecurityMarks.key=value` to find Cloud resources that are attached
963+
// with security marks whose key is `key` and value is `value`.
964+
// * `sccSecurityMarks.key:*` to find Cloud resources that are attached with
965+
// security marks whose key is `key`.
962966
// * `state:ACTIVE` to find Google Cloud resources whose state contains
963967
// `ACTIVE` as a word.
964968
// * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't
@@ -981,7 +985,7 @@ message SearchAllResourcesRequest {
981985

982986
// Optional. A list of asset types that this request searches for. If empty,
983987
// it will search all the [searchable asset
984-
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
988+
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types).
985989
//
986990
// Regular expressions are also supported. For example:
987991
//
@@ -1150,7 +1154,7 @@ message SearchAllIamPoliciesRequest {
11501154
// Optional. A list of asset types that the IAM policies are attached to. If
11511155
// empty, it will search the IAM policies that are attached to all the
11521156
// [searchable asset
1153-
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1157+
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types).
11541158
//
11551159
// Regular expressions are also supported. For example:
11561160
//
@@ -1400,7 +1404,7 @@ message AnalyzeIamPolicyRequest {
14001404
// If both `analysis_query` and `saved_analysis_query` are provided, they
14011405
// will be merged together with the `saved_analysis_query` as base and
14021406
// the `analysis_query` as overrides. For more details of the merge behavior,
1403-
// please refer to the
1407+
// refer to the
14041408
// [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
14051409
// page.
14061410
//
@@ -1556,7 +1560,7 @@ message AnalyzeIamPolicyLongrunningRequest {
15561560
// If both `analysis_query` and `saved_analysis_query` are provided, they
15571561
// will be merged together with the `saved_analysis_query` as base and
15581562
// the `analysis_query` as overrides. For more details of the merge behavior,
1559-
// please refer to the
1563+
// refer to the
15601564
// [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
15611565
// doc.
15621566
//
@@ -1776,14 +1780,22 @@ message AnalyzeMoveRequest {
17761780
// Only Google Cloud projects are supported as of today. Hence, this can only
17771781
// be a project ID (such as "projects/my-project-id") or a project number
17781782
// (such as "projects/12345").
1779-
string resource = 1 [(google.api.field_behavior) = REQUIRED];
1783+
string resource = 1 [
1784+
(google.api.field_behavior) = REQUIRED,
1785+
(google.api.resource_reference) = {
1786+
type: "cloudresourcemanager.googleapis.com/Project"
1787+
}
1788+
];
17801789

17811790
// Required. Name of the Google Cloud folder or organization to reparent the
17821791
// target resource. The analysis will be performed against hypothetically
17831792
// moving the resource to this specified desitination parent. This can only be
17841793
// a folder number (such as "folders/123") or an organization number (such as
17851794
// "organizations/123").
1786-
string destination_parent = 2 [(google.api.field_behavior) = REQUIRED];
1795+
string destination_parent = 2 [
1796+
(google.api.field_behavior) = REQUIRED,
1797+
(google.api.resource_reference) = { type: "*" }
1798+
];
17871799

17881800
// Analysis view indicating what information should be included in the
17891801
// analysis response. If unspecified, the default view is FULL.
@@ -2053,7 +2065,7 @@ message BatchGetEffectiveIamPoliciesRequest {
20532065
// Required. The names refer to the [full_resource_names]
20542066
// (https://cloud.google.com/asset-inventory/docs/resource-name-format)
20552067
// of [searchable asset
2056-
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
2068+
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types).
20572069
// A maximum of 20 resources' effective policies can be retrieved in a batch.
20582070
repeated string names = 3 [
20592071
(google.api.field_behavior) = REQUIRED,
@@ -2355,12 +2367,15 @@ message AnalyzeOrgPoliciesRequest {
23552367

23562368
// The expression to filter
23572369
// [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results].
2358-
// The only supported field is `consolidated_policy.attached_resource`, and
2359-
// the only supported operator is `=`.
2370+
// Filtering is currently available for bare literal values and the following
2371+
// fields:
2372+
// * consolidated_policy.attached_resource
2373+
// * consolidated_policy.rules.enforce
23602374
//
2361-
// Example:
2375+
// When filtering by a specific field, the only supported operator is `=`.
2376+
// For example, filtering by
23622377
// consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001"
2363-
// will return the org policy results of"folders/001".
2378+
// will return all the Organization Policy results attached to "folders/001".
23642379
string filter = 3;
23652380

23662381
// The maximum number of items to return per page. If unspecified,
@@ -2423,13 +2438,17 @@ message AnalyzeOrgPolicyGovernedContainersRequest {
24232438
// constraint.
24242439
string constraint = 2 [(google.api.field_behavior) = REQUIRED];
24252440

2426-
// The expression to filter the governed containers in result.
2427-
// The only supported field is `parent`, and the only supported operator is
2428-
// `=`.
2429-
//
2430-
// Example:
2431-
// parent="//cloudresourcemanager.googleapis.com/folders/001" will return all
2432-
// containers under "folders/001".
2441+
// The expression to filter
2442+
// [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers].
2443+
// Filtering is currently available for bare literal values and the following
2444+
// fields:
2445+
// * parent
2446+
// * consolidated_policy.rules.enforce
2447+
//
2448+
// When filtering by a specific field, the only supported operator is `=`.
2449+
// For example, filtering by
2450+
// parent="//cloudresourcemanager.googleapis.com/folders/001"
2451+
// will return all the containers under "folders/001".
24332452
string filter = 3;
24342453

24352454
// The maximum number of items to return per page. If unspecified,
@@ -2502,18 +2521,33 @@ message AnalyzeOrgPolicyGovernedAssetsRequest {
25022521
// constraint.
25032522
string constraint = 2 [(google.api.field_behavior) = REQUIRED];
25042523

2505-
// The expression to filter the governed assets in result. The only supported
2506-
// fields for governed resources are `governed_resource.project` and
2507-
// `governed_resource.folders`. The only supported fields for governed iam
2508-
// policies are `governed_iam_policy.project` and
2509-
// `governed_iam_policy.folders`. The only supported operator is `=`.
2510-
//
2511-
// Example 1: governed_resource.project="projects/12345678" filter will return
2512-
// all governed resources under projects/12345678 including the project
2513-
// ifself, if applicable.
2524+
// The expression to filter
2525+
// [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets].
25142526
//
2515-
// Example 2: governed_iam_policy.folders="folders/12345678" filter will
2516-
// return all governed iam policies under folders/12345678, if applicable.
2527+
// For governed resources, filtering is currently available for bare literal
2528+
// values and the following fields:
2529+
// * governed_resource.project
2530+
// * governed_resource.folders
2531+
// * consolidated_policy.rules.enforce
2532+
// When filtering by `governed_resource.project` or
2533+
// `consolidated_policy.rules.enforce`, the only supported operator is `=`.
2534+
// When filtering by `governed_resource.folders`, the supported operators
2535+
// are `=` and `:`.
2536+
// For example, filtering by `governed_resource.project="projects/12345678"`
2537+
// will return all the governed resources under "projects/12345678",
2538+
// including the project itself if applicable.
2539+
//
2540+
// For governed IAM policies, filtering is currently available for bare
2541+
// literal values and the following fields:
2542+
// * governed_iam_policy.project
2543+
// * governed_iam_policy.folders
2544+
// * consolidated_policy.rules.enforce
2545+
// When filtering by `governed_iam_policy.project` or
2546+
// `consolidated_policy.rules.enforce`, the only supported operator is `=`.
2547+
// When filtering by `governed_iam_policy.folders`, the supported operators
2548+
// are `=` and `:`.
2549+
// For example, filtering by `governed_iam_policy.folders:"folders/12345678"`
2550+
// will return all the governed IAM policies under "folders/001".
25172551
string filter = 3;
25182552

25192553
// The maximum number of items to return per page. If unspecified,

packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ syntax = "proto3";
1616

1717
package google.cloud.asset.v1;
1818

19-
import "google/api/field_behavior.proto";
2019
import "google/api/resource.proto";
2120
import "google/cloud/orgpolicy/v1/orgpolicy.proto";
2221
import "google/cloud/osconfig/v1/inventory.proto";
@@ -141,15 +140,15 @@ message Asset {
141140
// A representation of an [access
142141
// policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
143142
oneof access_context_policy {
144-
// Please also refer to the [access policy user
143+
// Also refer to the [access policy user
145144
// guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
146145
google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
147146

148-
// Please also refer to the [access level user
147+
// Also refer to the [access level user
149148
// guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
150149
google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
151150

152-
// Please also refer to the [service perimeter user
151+
// Also refer to the [service perimeter user
153152
// guide](https://cloud.google.com/vpc-service-controls/docs/overview).
154153
google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter =
155154
9;
@@ -218,8 +217,6 @@ message Resource {
218217
// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
219218
// Example:
220219
// `//cloudresourcemanager.googleapis.com/projects/my_project_123`
221-
//
222-
// For third-party assets, this field may be set differently.
223220
string parent = 5;
224221

225222
// The content of the resource, in which some sensitive fields are removed
@@ -458,8 +455,8 @@ message ResourceSearchResult {
458455
// [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions)
459456
// name.
460457
//
461-
// This field only presents for the purpose of backward compatibility. Please
462-
// use the `kms_keys` field to retrieve Cloud KMS key information. This field
458+
// This field only presents for the purpose of backward compatibility.
459+
// Use the `kms_keys` field to retrieve Cloud KMS key information. This field
463460
// is available only when the resource's Protobuf contains it and will only be
464461
// populated for [these resource
465462
// types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field)
@@ -539,7 +536,7 @@ message ResourceSearchResult {
539536
// metadata fields that are returned by the List or Get APIs provided by the
540537
// corresponding Google Cloud service (e.g., Compute Engine). see [API
541538
// references and supported searchable
542-
// attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types)
539+
// attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
543540
// to see which fields are included.
544541
//
545542
// You can search values of these fields through free text search. However,
@@ -590,7 +587,7 @@ message ResourceSearchResult {
590587
map<string, RelatedResources> relationships = 21;
591588

592589
// This field is only present for the purpose of backward compatibility.
593-
// Please use the `tags` field instead.
590+
// Use the `tags` field instead.
594591
//
595592
// TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}.
596593
// To search against the `tagKeys`:
@@ -605,7 +602,7 @@ message ResourceSearchResult {
605602
repeated string tag_keys = 23 [deprecated = true];
606603

607604
// This field is only present for the purpose of backward compatibility.
608-
// Please use the `tags` field instead.
605+
// Use the `tags` field instead.
609606
//
610607
// TagValue namespaced names, in the format of
611608
// {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}.
@@ -622,7 +619,7 @@ message ResourceSearchResult {
622619
repeated string tag_values = 25 [deprecated = true];
623620

624621
// This field is only present for the purpose of backward compatibility.
625-
// Please use the `tags` field instead.
622+
// Use the `tags` field instead.
626623
//
627624
// TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}.
628625
// To search against the `tagValueIds`:
@@ -684,10 +681,6 @@ message ResourceSearchResult {
684681
// with the asset.
685682
//
686683
//
687-
// Note that both staging & prod SecurityMarks are attached on prod resources.
688-
// In CAS preprod/prod, both staging & prod SecurityMarks are ingested and
689-
// returned in the following `security_marks` map. In that case, the prefix
690-
// "staging." will be added to the keys of all the staging marks.
691684
// To search against SCC SecurityMarks field:
692685
//
693686
// * Use a field query:
@@ -718,7 +711,7 @@ message VersionedResource {
718711
//
719712
// You can find the resource definition for each supported resource type in
720713
// this table:
721-
// `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types`
714+
// `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
722715
google.protobuf.Struct resource = 2;
723716
}
724717

@@ -731,7 +724,7 @@ message AttachedResource {
731724
//
732725
// You can find the supported attached asset types of each resource in this
733726
// table:
734-
// `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types`
727+
// `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
735728
string asset_type = 1;
736729

737730
// Versioned resource representations of this attached resource. This is

0 commit comments

Comments
 (0)