Skip to content

Commit

Permalink
feat: add support for directly attached and effective tags
Browse files Browse the repository at this point in the history
docs: clarify comments for tags and effective tags

Clients can search resources filtered by effective tags and start to use the new `tags` field instead of old `tag_key`, `tag_value`, `tag_value_id` fields to access directly attached tags.

PiperOrigin-RevId: 567554529

Source-Link: googleapis/googleapis@1a3ea87

Source-Link: googleapis/googleapis-gen@df4f7ba
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQXNzZXQuVjEvLk93bEJvdC55YW1sIiwiaCI6ImRmNGY3YmE0MWE4MDdhMTkzYjQ4YWZkYmE4ZDRhZWYzNTYzNjg3NWEifQ==
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Sep 25, 2023
1 parent 7a127d0 commit 46297c2
Show file tree
Hide file tree
Showing 4 changed files with 1,033 additions and 264 deletions.
163 changes: 92 additions & 71 deletions apis/Google.Cloud.Asset.V1/Google.Cloud.Asset.V1/AssetService.g.cs
Expand Up @@ -6801,49 +6801,73 @@ public sealed partial class SearchAllResourcesRequest : pb::IMessage<SearchAllRe
/// Examples:
///
/// * `name:Important` to find Google Cloud resources whose name contains
/// "Important" as a word.
/// `Important` as a word.
/// * `name=Important` to find the Google Cloud resource whose name is exactly
/// "Important".
/// `Important`.
/// * `displayName:Impor*` to find Google Cloud resources whose display name
/// contains "Impor" as a prefix of any word in the field.
/// contains `Impor` as a prefix of any word in the field.
/// * `location:us-west*` to find Google Cloud resources whose location
/// contains both "us" and "west" as prefixes.
/// * `labels:prod` to find Google Cloud resources whose labels contain "prod"
/// contains both `us` and `west` as prefixes.
/// * `labels:prod` to find Google Cloud resources whose labels contain `prod`
/// as a key or value.
/// * `labels.env:prod` to find Google Cloud resources that have a label "env"
/// and its value is "prod".
/// * `labels.env:*` to find Google Cloud resources that have a label "env".
/// * `labels.env:prod` to find Google Cloud resources that have a label `env`
/// and its value is `prod`.
/// * `labels.env:*` to find Google Cloud resources that have a label `env`.
/// * `tagKeys:env` to find Google Cloud resources that have directly
/// attached tags where the
/// [`TagKey`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
/// .`namespacedName` contains `env`.
/// * `tagValues:prod*` to find Google Cloud resources that have directly
/// attached tags where the
/// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
/// .`namespacedName` contains a word prefixed by `prod`.
/// * `tagValueIds=tagValues/123` to find Google Cloud resources that have
/// directly attached tags where the
/// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
/// .`name` is exactly `tagValues/123`.
/// * `effectiveTagKeys:env` to find Google Cloud resources that have
/// directly attached or inherited tags where the
/// [`TagKey`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey)
/// .`namespacedName` contains `env`.
/// * `effectiveTagValues:prod*` to find Google Cloud resources that have
/// directly attached or inherited tags where the
/// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
/// .`namespacedName` contains a word prefixed by `prod`.
/// * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that
/// have directly attached or inherited tags where the
/// [`TagValue`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue)
/// .`name` is exactly `tagValues/123`.
/// * `kmsKey:key` to find Google Cloud resources encrypted with a
/// customer-managed encryption key whose name contains "key" as a word. This
/// customer-managed encryption key whose name contains `key` as a word. This
/// field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS
/// key information.
/// * `kmsKeys:key` to find Google Cloud resources encrypted with
/// customer-managed encryption keys whose name contains the word "key".
/// customer-managed encryption keys whose name contains the word `key`.
/// * `relationships:instance-group-1` to find Google Cloud resources that have
/// relationships with "instance-group-1" in the related resource name.
/// relationships with `instance-group-1` in the related resource name.
/// * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine
/// instances that have relationships of type "INSTANCE_TO_INSTANCEGROUP".
/// instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`.
/// * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
/// Compute Engine instances that have relationships with "instance-group-1"
/// Compute Engine instances that have relationships with `instance-group-1`
/// in the Compute Engine instance group resource name, for relationship type
/// "INSTANCE_TO_INSTANCEGROUP".
/// `INSTANCE_TO_INSTANCEGROUP`.
/// * `state:ACTIVE` to find Google Cloud resources whose state contains
/// "ACTIVE" as a word.
/// `ACTIVE` as a word.
/// * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't
/// contain "ACTIVE" as a word.
/// contain `ACTIVE` as a word.
/// * `createTime&lt;1609459200` to find Google Cloud resources that were created
/// before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
/// "2021-01-01 00:00:00 UTC" in seconds.
/// before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of
/// `2021-01-01 00:00:00 UTC` in seconds.
/// * `updateTime>1609459200` to find Google Cloud resources that were updated
/// after "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
/// "2021-01-01 00:00:00 UTC" in seconds.
/// * `Important` to find Google Cloud resources that contain "Important" as a
/// after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of
/// `2021-01-01 00:00:00 UTC` in seconds.
/// * `Important` to find Google Cloud resources that contain `Important` as a
/// word in any of the searchable fields.
/// * `Impor*` to find Google Cloud resources that contain "Impor" as a prefix
/// * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix
/// of any word in any of the searchable fields.
/// * `Important location:(us-west1 OR global)` to find Google Cloud
/// resources that contain "Important" as a word in any of the searchable
/// fields and are also located in the "us-west1" region or the "global"
/// resources that contain `Important` as a word in any of the searchable
/// fields and are also located in the `us-west1` region or the `global`
/// location.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -6887,10 +6911,10 @@ public sealed partial class SearchAllResourcesRequest : pb::IMessage<SearchAllRe
private int pageSize_;
/// <summary>
/// Optional. The page size for search result pagination. Page size is capped
/// at 500 even if a larger value is given. If set to zero, server will pick an
/// appropriate default. Returned results may be fewer than requested. When
/// this happens, there could be more results as long as `next_page_token` is
/// returned.
/// at 500 even if a larger value is given. If set to zero or a negative value,
/// server will pick an appropriate default. Returned results may be fewer than
/// requested. When this happens, there could be more results as long as
/// `next_page_token` is returned.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand Down Expand Up @@ -6927,7 +6951,7 @@ public sealed partial class SearchAllResourcesRequest : pb::IMessage<SearchAllRe
/// the results. The default order is ascending. Add " DESC" after the field
/// name to indicate descending order. Redundant space characters are ignored.
/// Example: "location DESC, name".
/// Only singular primitive fields in the response are sortable:
/// Only the following fields in the response are sortable:
///
/// * name
/// * assetType
Expand All @@ -6940,10 +6964,6 @@ public sealed partial class SearchAllResourcesRequest : pb::IMessage<SearchAllRe
/// * state
/// * parentFullResourceName
/// * parentAssetType
///
/// All the other fields such as repeated fields (e.g., `networkTags`,
/// `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g.,
/// `additionalAttributes`) are not supported.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand All @@ -6958,38 +6978,36 @@ public sealed partial class SearchAllResourcesRequest : pb::IMessage<SearchAllRe
public const int ReadMaskFieldNumber = 8;
private global::Google.Protobuf.WellKnownTypes.FieldMask readMask_;
/// <summary>
/// Optional. A comma-separated list of fields specifying which fields to be
/// returned in ResourceSearchResult. Only '*' or combination of top level
/// fields can be specified. Field names of both snake_case and camelCase are
/// supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
///
/// The read_mask paths must be valid field paths listed but not limited to
/// (both snake_case and camelCase are supported):
/// Optional. A comma-separated list of fields that you want returned in the
/// results. The following fields are returned by default if not specified:
///
/// * name
/// * assetType
/// * project
/// * displayName
/// * description
/// * location
/// * tagKeys
/// * tagValues
/// * tagValueIds
/// * labels
/// * networkTags
/// * kmsKey (This field is deprecated. Please use the `kmsKeys` field to
/// retrieve Cloud KMS key information.)
/// * kmsKeys
/// * createTime
/// * updateTime
/// * state
/// * additionalAttributes
/// * versionedResources
/// * `name`
/// * `assetType`
/// * `project`
/// * `folders`
/// * `organization`
/// * `displayName`
/// * `description`
/// * `location`
/// * `labels`
/// * `tags`
/// * `effectiveTags`
/// * `networkTags`
/// * `kmsKeys`
/// * `createTime`
/// * `updateTime`
/// * `state`
/// * `additionalAttributes`
/// * `parentFullResourceName`
/// * `parentAssetType`
///
/// If read_mask is not specified, all fields except versionedResources will
/// be returned.
/// If only '*' is specified, all fields including versionedResources will be
/// returned.
/// Some fields of large size, such as `versionedResources`,
/// `attachedResources`, `effectiveTags` etc., are not returned by default, but
/// you can specify them in the `read_mask` parameter if you want to include
/// them. If `"*"` is specified, all [available
/// fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult)
/// are returned.
/// Examples: `"name,location"`, `"name,versionedResources"`, `"*"`.
/// Any invalid field path will trigger INVALID_ARGUMENT error.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -7643,10 +7661,10 @@ public sealed partial class SearchAllIamPoliciesRequest : pb::IMessage<SearchAll
private int pageSize_;
/// <summary>
/// Optional. The page size for search result pagination. Page size is capped
/// at 500 even if a larger value is given. If set to zero, server will pick an
/// appropriate default. Returned results may be fewer than requested. When
/// this happens, there could be more results as long as `next_page_token` is
/// returned.
/// at 500 even if a larger value is given. If set to zero or a negative value,
/// server will pick an appropriate default. Returned results may be fewer than
/// requested. When this happens, there could be more results as long as
/// `next_page_token` is returned.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand Down Expand Up @@ -16345,8 +16363,8 @@ public sealed partial class QueryAssetsRequest : pb::IMessage<QueryAssetsRequest
/// <summary>Field number for the "statement" field.</summary>
public const int StatementFieldNumber = 2;
/// <summary>
/// Optional. A SQL statement that's compatible with [BigQuery Standard
/// SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
/// Optional. A SQL statement that's compatible with [BigQuery
/// SQL](https://cloud.google.com/bigquery/docs/introduction-sql).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand Down Expand Up @@ -19515,7 +19533,10 @@ public sealed partial class AnalyzerOrgPolicy : pb::IMessage<AnalyzerOrgPolicy>
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static partial class Types {
/// <summary>
/// Represents a rule defined in an organization policy
/// This rule message is a customized version of the one defined in the
/// Organization Policy system. In addition to the fields defined in the
/// original organization policy, it contains additional field(s) under
/// specific circumstances to support analysis results.
/// </summary>
public sealed partial class Rule : pb::IMessage<Rule>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
Expand Down Expand Up @@ -24866,7 +24887,7 @@ public sealed partial class GovernedIamPolicy : pb::IMessage<GovernedIamPolicy>
public const int AttachedResourceFieldNumber = 1;
private string attachedResource_ = "";
/// <summary>
/// The full resource name of the resource associated with this IAM policy.
/// The full resource name of the resource on which this IAM policy is set.
/// Example:
/// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
/// See [Cloud Asset Inventory Resource Name
Expand Down

0 comments on commit 46297c2

Please sign in to comment.