google-apis-logging_v2 0.88.0 → 0.90.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.
@@ -180,13 +180,13 @@ module Google
180
180
  class BigQueryOptions
181
181
  include Google::Apis::Core::Hashable
182
182
 
183
- # Optional. Whether to use BigQuery's partition tables (https://cloud.google.com/
184
- # bigquery/docs/partitioned-tables). By default, Cloud Logging creates dated
185
- # tables based on the log entries' timestamps, e.g. syslog_20170523. With
186
- # partitioned tables the date suffix is no longer present and special query
187
- # syntax (https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
188
- # has to be used instead. In both cases, tables are sharded based on UTC
189
- # timezone.
183
+ # Optional. Whether to use BigQuery's partition tables (https://docs.cloud.
184
+ # google.com/bigquery/docs/partitioned-tables). By default, Cloud Logging
185
+ # creates dated tables based on the log entries' timestamps, e.g.
186
+ # syslog_20170523. With partitioned tables the date suffix is no longer present
187
+ # and special query syntax (https://docs.cloud.google.com/bigquery/docs/querying-
188
+ # partitioned-tables) has to be used instead. In both cases, tables are sharded
189
+ # based on UTC timezone.
190
190
  # Corresponds to the JSON property `usePartitionedTables`
191
191
  # @return [Boolean]
192
192
  attr_accessor :use_partitioned_tables
@@ -430,8 +430,8 @@ module Google
430
430
  # a project, folder, organization, billing account, or flexible resource.Note:
431
431
  # CMEK for the Log Router can currently only be configured for Google Cloud
432
432
  # organizations. Once configured, it applies to all projects and folders in the
433
- # Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.
434
- # google.com/logging/docs/routing/managed-encryption) for more information.
433
+ # Google Cloud organization.See Configure CMEK for Cloud Logging (https://docs.
434
+ # cloud.google.com/logging/docs/routing/managed-encryption) for more information.
435
435
  class CmekSettings
436
436
  include Google::Apis::Core::Hashable
437
437
 
@@ -447,8 +447,8 @@ module Google
447
447
  # with the key that was in use when they started. Decryption operations will be
448
448
  # completed using the key that was used at the time of encryption unless access
449
449
  # to that key has been revoked.To disable CMEK for the Log Router, set this
450
- # field to an empty string.See Enabling CMEK for Log Router (https://cloud.
451
- # google.com/logging/docs/routing/managed-encryption) for more information.
450
+ # field to an empty string.See Configure CMEK for Cloud Logging (https://docs.
451
+ # cloud.google.com/logging/docs/routing/managed-encryption) for more information.
452
452
  # Corresponds to the JSON property `kmsKeyName`
453
453
  # @return [String]
454
454
  attr_accessor :kms_key_name
@@ -474,8 +474,9 @@ module Google
474
474
  # your Cloud KMS key.Before enabling CMEK for Log Router, you must first assign
475
475
  # the cloudkms.cryptoKeyEncrypterDecrypter role to the service account that the
476
476
  # Log Router will use to access your Cloud KMS key. Use GetCmekSettings to
477
- # obtain the service account ID.See Enabling CMEK for Log Router (https://cloud.
478
- # google.com/logging/docs/routing/managed-encryption) for more information.
477
+ # obtain the service account ID.See Configure CMEK for Cloud Logging (https://
478
+ # docs.cloud.google.com/logging/docs/routing/managed-encryption) for more
479
+ # information.
479
480
  # Corresponds to the JSON property `serviceAccountId`
480
481
  # @return [String]
481
482
  attr_accessor :service_account_id
@@ -707,12 +708,13 @@ module Google
707
708
  # @return [Array<Google::Apis::LoggingV2::LogExclusion>]
708
709
  attr_accessor :exclusions
709
710
 
710
- # Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/
711
- # advanced-queries). The only exported log entries are those that are in the
712
- # resource owning the sink and that match the filter.For example:logName="
713
- # projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERRORTo match all logs, don'
714
- # t add exclusions and use the following line as the value of filter:logName:*
715
- # Cannot be empty or unset when the value of mode is OVERWRITE.
711
+ # Optional. An advanced logs filter (https://docs.cloud.google.com/logging/docs/
712
+ # view/building-queries#queries-by-expression). The only exported log entries
713
+ # are those that are in the resource owning the sink and that match the filter.
714
+ # For example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=
715
+ # ERRORTo match all logs, don't add exclusions and use the following line as the
716
+ # value of filter:logName:*Cannot be empty or unset when the value of mode is
717
+ # OVERWRITE.
716
718
  # Corresponds to the JSON property `filter`
717
719
  # @return [String]
718
720
  attr_accessor :filter
@@ -890,6 +892,207 @@ module Google
890
892
  end
891
893
  end
892
894
 
895
+ # A source that can be used to represent a field within various parts of a
896
+ # structured query, such as in SELECT, WHERE, or ORDER BY clauses.
897
+ class FieldSource
898
+ include Google::Apis::Core::Hashable
899
+
900
+ # The alias name for a field that has already been aliased within a different
901
+ # ProjectedField type elsewhere in the query model. The alias must be defined in
902
+ # the QueryBuilderConfig's field_sources list, otherwise the model is invalid.
903
+ # Corresponds to the JSON property `aliasRef`
904
+ # @return [String]
905
+ attr_accessor :alias_ref
906
+
907
+ # The type of the selected field. This comes from the schema. Can be one of the
908
+ # BigQuery data types: - STRING - INT64 - FLOAT64 - BOOL - TIMESTAMP - DATE -
909
+ # RECORD - JSON
910
+ # Corresponds to the JSON property `columnType`
911
+ # @return [String]
912
+ attr_accessor :column_type
913
+
914
+ # The fully qualified, dot-delimited path to the selected atomic field (the leaf
915
+ # value). This path is used for primary selection and actions like drill-down or
916
+ # projection.The path components should match the exact field names or keys as
917
+ # they appear in the underlying data schema. For JSON fields, this means
918
+ # respecting the original casing (e.g., camelCase or snake_case as present in
919
+ # the JSON).To reference field names containing special characters (e.g.,
920
+ # hyphens, spaces), enclose the individual path segment in backticks (`).
921
+ # Examples: * json_payload.labels.message * json_payload.request_id *
922
+ # httpRequest.status * json_payload.\my-custom-field`.value *jsonPayload.`my key
923
+ # with spaces`.data`
924
+ # Corresponds to the JSON property `field`
925
+ # @return [String]
926
+ attr_accessor :field
927
+
928
+ # Whether the field is a JSON field, or has a parent that is a JSON field. This
929
+ # value is used to determine JSON extractions in generated SQL queries. Note
930
+ # that this is_json flag may be true when the column_type is not JSON if the
931
+ # parent is a JSON field. Ex: - A json_payload.message field might have is_json=
932
+ # true, since the 'json_payload' parent is of type JSON, and columnType='STRING'
933
+ # if the 'message' field is of type STRING.
934
+ # Corresponds to the JSON property `isJson`
935
+ # @return [Boolean]
936
+ attr_accessor :is_json
937
+ alias_method :is_json?, :is_json
938
+
939
+ # The dot-delimited path of the parent container that holds the target field.
940
+ # This path defines the structural hierarchy and is essential for correctly
941
+ # generating SQL when field keys contain special characters (e.g., dots or
942
+ # brackets).Example: json_payload.labels (This points to the 'labels' object).
943
+ # This is an empty string if the target field is at the root level.
944
+ # Corresponds to the JSON property `parentPath`
945
+ # @return [String]
946
+ attr_accessor :parent_path
947
+
948
+ # Represents a field selected in the query, analogous to an item in a SQL SELECT
949
+ # clause. It specifies the source field and optionally applies transformations
950
+ # like aggregation, casting, regex extraction, or assigns an alias. Use
951
+ # ProjectedField when you need more than just the raw source field name (for
952
+ # which you might use FieldSource directly in QueryBuilderConfig's field_sources
953
+ # list if no transformations or specific operation type are needed).
954
+ # Corresponds to the JSON property `projectedField`
955
+ # @return [Google::Apis::LoggingV2::ProjectedField]
956
+ attr_accessor :projected_field
957
+
958
+ def initialize(**args)
959
+ update!(**args)
960
+ end
961
+
962
+ # Update properties of this object
963
+ def update!(**args)
964
+ @alias_ref = args[:alias_ref] if args.key?(:alias_ref)
965
+ @column_type = args[:column_type] if args.key?(:column_type)
966
+ @field = args[:field] if args.key?(:field)
967
+ @is_json = args[:is_json] if args.key?(:is_json)
968
+ @parent_path = args[:parent_path] if args.key?(:parent_path)
969
+ @projected_field = args[:projected_field] if args.key?(:projected_field)
970
+ end
971
+ end
972
+
973
+ # This is a leaf of the FilterPredicate. Ex: ` field: json_payload.message.
974
+ # error_code, filter_value: `numeric_value: 400`, comparator: EQUAL_TO` The
975
+ # field will be schema field that is selected using the . annotation to display
976
+ # the drill down value. The value will be the user inputted text that the filter
977
+ # is comparing against.
978
+ class FilterExpression
979
+ include Google::Apis::Core::Hashable
980
+
981
+ # The comparison type to use for the filter.
982
+ # Corresponds to the JSON property `comparator`
983
+ # @return [String]
984
+ attr_accessor :comparator
985
+
986
+ # A source that can be used to represent a field within various parts of a
987
+ # structured query, such as in SELECT, WHERE, or ORDER BY clauses.
988
+ # Corresponds to the JSON property `fieldSource`
989
+ # @return [Google::Apis::LoggingV2::FieldSource]
990
+ attr_accessor :field_source
991
+
992
+ # A source that can be used to represent a field within various parts of a
993
+ # structured query, such as in SELECT, WHERE, or ORDER BY clauses.
994
+ # Corresponds to the JSON property `fieldSourceValue`
995
+ # @return [Google::Apis::LoggingV2::FieldSource]
996
+ attr_accessor :field_source_value
997
+
998
+ # Determines if the NOT flag should be added to the comparator.
999
+ # Corresponds to the JSON property `isNegation`
1000
+ # @return [Boolean]
1001
+ attr_accessor :is_negation
1002
+ alias_method :is_negation?, :is_negation
1003
+
1004
+ # The Value will be used to hold user defined constants set as the Right Hand
1005
+ # Side of the filter.
1006
+ # Corresponds to the JSON property `literalValue`
1007
+ # @return [Object]
1008
+ attr_accessor :literal_value
1009
+
1010
+ def initialize(**args)
1011
+ update!(**args)
1012
+ end
1013
+
1014
+ # Update properties of this object
1015
+ def update!(**args)
1016
+ @comparator = args[:comparator] if args.key?(:comparator)
1017
+ @field_source = args[:field_source] if args.key?(:field_source)
1018
+ @field_source_value = args[:field_source_value] if args.key?(:field_source_value)
1019
+ @is_negation = args[:is_negation] if args.key?(:is_negation)
1020
+ @literal_value = args[:literal_value] if args.key?(:literal_value)
1021
+ end
1022
+ end
1023
+
1024
+ # A filter for a query. This equates to the WHERE clause in SQL.
1025
+ class FilterPredicate
1026
+ include Google::Apis::Core::Hashable
1027
+
1028
+ # The children of the filter predicate. This equates to the branches of the
1029
+ # filter predicate that could contain further nested leaves.
1030
+ # Corresponds to the JSON property `childPredicates`
1031
+ # @return [Array<Google::Apis::LoggingV2::FilterPredicate>]
1032
+ attr_accessor :child_predicates
1033
+
1034
+ # This is a leaf of the FilterPredicate. Ex: ` field: json_payload.message.
1035
+ # error_code, filter_value: `numeric_value: 400`, comparator: EQUAL_TO` The
1036
+ # field will be schema field that is selected using the . annotation to display
1037
+ # the drill down value. The value will be the user inputted text that the filter
1038
+ # is comparing against.
1039
+ # Corresponds to the JSON property `leafPredicate`
1040
+ # @return [Google::Apis::LoggingV2::FilterExpression]
1041
+ attr_accessor :leaf_predicate
1042
+
1043
+ # The operator type for the filter. Currently there is no support for multiple
1044
+ # levels of nesting, so this will be a single value with no joining of different
1045
+ # operator types
1046
+ # Corresponds to the JSON property `operatorType`
1047
+ # @return [String]
1048
+ attr_accessor :operator_type
1049
+
1050
+ def initialize(**args)
1051
+ update!(**args)
1052
+ end
1053
+
1054
+ # Update properties of this object
1055
+ def update!(**args)
1056
+ @child_predicates = args[:child_predicates] if args.key?(:child_predicates)
1057
+ @leaf_predicate = args[:leaf_predicate] if args.key?(:leaf_predicate)
1058
+ @operator_type = args[:operator_type] if args.key?(:operator_type)
1059
+ end
1060
+ end
1061
+
1062
+ # Defines the aggregation function to apply to this field. This message is used
1063
+ # only when operation is set to AGGREGATE.
1064
+ class FunctionApplication
1065
+ include Google::Apis::Core::Hashable
1066
+
1067
+ # Optional. Parameters to be applied to the aggregation. Aggregations that
1068
+ # support or require parameters are listed above.
1069
+ # Corresponds to the JSON property `parameters`
1070
+ # @return [Array<Object>]
1071
+ attr_accessor :parameters
1072
+
1073
+ # Required. Specifies the aggregation function. Use one of the following string
1074
+ # identifiers: "average": Computes the average (AVG). Applies only to numeric
1075
+ # values. "count": Counts the number of values (COUNT). "count-distinct": Counts
1076
+ # the number of distinct values (COUNT DISTINCT). "count-distinct-approx":
1077
+ # Approximates the count of distinct values (APPROX_COUNT_DISTINCT). "max":
1078
+ # Finds the maximum value (MAX). Applies only to numeric values. "min": Finds
1079
+ # the minimum value (MIN). Applies only to numeric values. "sum": Computes the
1080
+ # sum (SUM). Applies only to numeric values.
1081
+ # Corresponds to the JSON property `type`
1082
+ # @return [String]
1083
+ attr_accessor :type
1084
+
1085
+ def initialize(**args)
1086
+ update!(**args)
1087
+ end
1088
+
1089
+ # Update properties of this object
1090
+ def update!(**args)
1091
+ @parameters = args[:parameters] if args.key?(:parameters)
1092
+ @type = args[:type] if args.key?(:type)
1093
+ end
1094
+ end
1095
+
893
1096
  # Request message for GetIamPolicy method.
894
1097
  class GetIamPolicyRequest
895
1098
  include Google::Apis::Core::Hashable
@@ -1070,8 +1273,8 @@ module Google
1070
1273
 
1071
1274
  # Required. The LogEntry field path to index.Note that some paths are
1072
1275
  # automatically indexed, and other paths are not eligible for indexing. See
1073
- # indexing documentation( https://cloud.google.com/logging/docs/analyze/custom-
1074
- # index) for details.For example: jsonPayload.request.status
1276
+ # indexing documentation( https://docs.cloud.google.com/logging/docs/analyze/
1277
+ # custom-index) for details.For example: jsonPayload.request.status
1075
1278
  # Corresponds to the JSON property `fieldPath`
1076
1279
  # @return [String]
1077
1280
  attr_accessor :field_path
@@ -1842,8 +2045,8 @@ module Google
1842
2045
  # a project, folder, organization, billing account, or flexible resource.Note:
1843
2046
  # CMEK for the Log Router can currently only be configured for Google Cloud
1844
2047
  # organizations. Once configured, it applies to all projects and folders in the
1845
- # Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.
1846
- # google.com/logging/docs/routing/managed-encryption) for more information.
2048
+ # Google Cloud organization.See Configure CMEK for Cloud Logging (https://docs.
2049
+ # cloud.google.com/logging/docs/routing/managed-encryption) for more information.
1847
2050
  # Corresponds to the JSON property `cmekSettings`
1848
2051
  # @return [Google::Apis::LoggingV2::CmekSettings]
1849
2052
  attr_accessor :cmek_settings
@@ -1878,9 +2081,9 @@ module Google
1878
2081
 
1879
2082
  # Output only. The resource name of the bucket.For example:projects/my-project/
1880
2083
  # locations/global/buckets/my-bucketFor a list of supported locations, see
1881
- # Supported Regions (https://cloud.google.com/logging/docs/region-support)For
1882
- # the location of global it is unspecified where log entries are actually stored.
1883
- # After a bucket has been created, the location cannot be changed.
2084
+ # Supported Regions (https://docs.cloud.google.com/logging/docs/region-support)
2085
+ # For the location of global it is unspecified where log entries are actually
2086
+ # stored.After a bucket has been created, the location cannot be changed.
1884
2087
  # Corresponds to the JSON property `name`
1885
2088
  # @return [String]
1886
2089
  attr_accessor :name
@@ -2067,17 +2270,15 @@ module Google
2067
2270
  # @return [Google::Apis::LoggingV2::LogEntrySourceLocation]
2068
2271
  attr_accessor :source_location
2069
2272
 
2070
- # Optional. The ID of the Cloud Trace (https://cloud.google.com/trace) span
2071
- # associated with the current operation in which the log is being written. For
2072
- # example, if a span has the REST resource name of "projects/some-project/traces/
2073
- # some-trace/spans/some-span-id", then the span_id field is "some-span-id".A
2074
- # Span (https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/
2075
- # batchWrite#Span) represents a single operation within a trace. Whereas a trace
2076
- # may involve multiple different microservices running on multiple different
2077
- # machines, a span generally corresponds to a single logical operation being
2078
- # performed in a single instance of a microservice on one specific machine.
2273
+ # Optional. The ID of the Cloud Trace (https://docs.cloud.google.com/trace/docs)
2274
+ # span associated with the current operation in which the log is being written.A
2275
+ # Span (https://docs.cloud.google.com/trace/docs/reference/v2/rest/v2/projects.
2276
+ # traces/batchWrite#Span) represents a single operation within a trace. Whereas
2277
+ # a trace may involve multiple different microservices running on multiple
2278
+ # different machines, a span generally corresponds to a single logical operation
2279
+ # being performed in a single instance of a microservice on one specific machine.
2079
2280
  # Spans are the nodes within the tree that is a trace.Applications that are
2080
- # instrumented for tracing (https://cloud.google.com/trace/docs/setup) will
2281
+ # instrumented for tracing (https://docs.cloud.google.com/trace/docs/setup) will
2081
2282
  # generally assign a new, unique span ID on each incoming request. It is also
2082
2283
  # common to create and record additional spans corresponding to internal
2083
2284
  # processing elements as well as issuing requests to dependencies.The span ID is
@@ -2114,13 +2315,15 @@ module Google
2114
2315
  # @return [String]
2115
2316
  attr_accessor :timestamp
2116
2317
 
2117
- # Optional. The REST resource name of the trace being written to Cloud Trace (
2118
- # https://cloud.google.com/trace) in association with this log entry. For
2119
- # example, if your trace data is stored in the Cloud project "my-trace-project"
2120
- # and if the service that is creating the log entry receives a trace header that
2121
- # includes the trace ID "12345", then the service should use "projects/my-trace-
2122
- # project/traces/12345".The trace field provides the link between logs and
2123
- # traces. By using this field, you can navigate from a log entry to a trace.
2318
+ # Optional. The trace ID being written to Cloud Trace (https://docs.cloud.google.
2319
+ # com/trace/docs) in association with this log entry. For example, if your trace
2320
+ # data is stored in the Cloud project "my-trace-project" and if the service that
2321
+ # is creating the log entry receives a trace header that includes the trace ID "
2322
+ # 12345", then the service should use "12345".The REST resource name of the
2323
+ # trace is also supported, but using this format is not recommended. An example
2324
+ # trace REST resource name is similar to "projects/my-trace-project/traces/12345"
2325
+ # .The trace field provides the link between logs and traces. By using this
2326
+ # field, you can navigate from a log entry to a trace.
2124
2327
  # Corresponds to the JSON property `trace`
2125
2328
  # @return [String]
2126
2329
  attr_accessor :trace
@@ -2298,13 +2501,13 @@ module Google
2298
2501
  attr_accessor :disabled
2299
2502
  alias_method :disabled?, :disabled
2300
2503
 
2301
- # Required. An advanced logs filter (https://cloud.google.com/logging/docs/view/
2302
- # advanced-queries) that matches the log entries to be excluded. By using the
2303
- # sample function (https://cloud.google.com/logging/docs/view/advanced-queries#
2304
- # sample), you can exclude less than 100% of the matching log entries.For
2305
- # example, the following query matches 99% of low-severity log entries from
2306
- # Google Cloud Storage buckets:resource.type=gcs_bucket severity<ERROR sample(
2307
- # insertId, 0.99)
2504
+ # Required. An advanced logs filter (https://docs.cloud.google.com/logging/docs/
2505
+ # view/building-queries#queries-by-expression) that matches the log entries to
2506
+ # be excluded. By using the sample function (https://docs.cloud.google.com/
2507
+ # logging/docs/view/logging-query-language#sample), you can exclude less than
2508
+ # 100% of the matching log entries.For example, the following query matches 99%
2509
+ # of low-severity log entries from Google Cloud Storage buckets:resource.type=
2510
+ # gcs_bucket severity<ERROR sample(insertId, 0.99)
2308
2511
  # Corresponds to the JSON property `filter`
2309
2512
  # @return [String]
2310
2513
  attr_accessor :filter
@@ -2606,9 +2809,9 @@ module Google
2606
2809
  # com/projects/[PROJECT_ID]" "logging.googleapis.com/projects/[PROJECT_ID]/
2607
2810
  # locations/[LOCATION_ID]/buckets/[BUCKET_ID]" The sink's writer_identity, set
2608
2811
  # when the sink is created, must have permission to write to the destination or
2609
- # else the log entries are not exported. For more information, see Exporting
2610
- # Logs with Sinks (https://cloud.google.com/logging/docs/api/tasks/exporting-
2611
- # logs).
2812
+ # else the log entries are not exported. For more information, see Route logs to
2813
+ # supported destinations (https://docs.cloud.google.com/logging/docs/export/
2814
+ # configure_export_v2).
2612
2815
  # Corresponds to the JSON property `destination`
2613
2816
  # @return [String]
2614
2817
  attr_accessor :destination
@@ -2627,10 +2830,10 @@ module Google
2627
2830
  # @return [Array<Google::Apis::LoggingV2::LogExclusion>]
2628
2831
  attr_accessor :exclusions
2629
2832
 
2630
- # Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/
2631
- # advanced-queries). The only exported log entries are those that are in the
2632
- # resource owning the sink and that match the filter.For example:logName="
2633
- # projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
2833
+ # Optional. An advanced logs filter (https://docs.cloud.google.com/logging/docs/
2834
+ # view/building-queries#queries-by-expression). The only exported log entries
2835
+ # are those that are in the resource owning the sink and that match the filter.
2836
+ # For example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
2634
2837
  # Corresponds to the JSON property `filter`
2635
2838
  # @return [String]
2636
2839
  attr_accessor :filter
@@ -2697,13 +2900,14 @@ module Google
2697
2900
  # is either set by specifying custom_writer_identity or set automatically by
2698
2901
  # sinks.create and sinks.update based on the value of unique_writer_identity in
2699
2902
  # those methods.Until you grant this identity write-access to the destination,
2700
- # log entry exports from this sink will fail. For more information, see Granting
2701
- # Access for a Resource (https://cloud.google.com/iam/docs/granting-roles-to-
2702
- # service-accounts#granting_access_to_a_service_account_for_a_resource). Consult
2703
- # the destination service's documentation to determine the appropriate IAM roles
2704
- # to assign to the identity.Sinks that have a destination that is a log bucket
2705
- # in the same project as the sink cannot have a writer_identity and no
2706
- # additional permissions are required.
2903
+ # log entry exports from this sink will fail. For more information, see Manage
2904
+ # access to projects, folders, and organizations (https://docs.cloud.google.com/
2905
+ # iam/docs/granting-roles-to-service-accounts#
2906
+ # granting_access_to_a_service_account_for_a_resource). Consult the destination
2907
+ # service's documentation to determine the appropriate IAM roles to assign to
2908
+ # the identity.Sinks that have a destination that is a log bucket in the same
2909
+ # project as the sink cannot have a writer_identity and no additional
2910
+ # permissions are required.
2707
2911
  # Corresponds to the JSON property `writerIdentity`
2708
2912
  # @return [String]
2709
2913
  attr_accessor :writer_identity
@@ -2825,9 +3029,9 @@ module Google
2825
3029
  class LoggingQuery
2826
3030
  include Google::Apis::Core::Hashable
2827
3031
 
2828
- # Required. An advanced query using the Logging Query Language (https://cloud.
2829
- # google.com/logging/docs/view/logging-query-language). The maximum length of
2830
- # the filter is 20000 characters.
3032
+ # Required. An advanced query using the Logging Query Language (https://docs.
3033
+ # cloud.google.com/logging/docs/view/logging-query-language). The maximum length
3034
+ # of the filter is 20000 characters.
2831
3035
  # Corresponds to the JSON property `filter`
2832
3036
  # @return [String]
2833
3037
  attr_accessor :filter
@@ -3246,14 +3450,22 @@ module Google
3246
3450
  end
3247
3451
  end
3248
3452
 
3249
- # Describes an analytics query that can be run in the Log Analytics page of
3250
- # Google Cloud console.Preview: This is a preview feature and may be subject to
3251
- # change before final release.
3453
+ # Describes a query that can be run in Log Analytics.
3252
3454
  class OpsAnalyticsQuery
3253
3455
  include Google::Apis::Core::Hashable
3254
3456
 
3255
- # Required. A logs analytics SQL query, which generally follows BigQuery format.
3256
- # This is the SQL query that appears in the Log Analytics UI's query editor.
3457
+ # Defines a structured query configuration that can be used instead of writing
3458
+ # raw SQL. This configuration represents the components of a SQL query (FROM,
3459
+ # SELECT, WHERE, ORDER BY, LIMIT) and is typically converted into an executable
3460
+ # query (e.g., BigQuery SQL) by the backend service to retrieve data for
3461
+ # analysis or visualization.
3462
+ # Corresponds to the JSON property `queryBuilder`
3463
+ # @return [Google::Apis::LoggingV2::QueryBuilderConfig]
3464
+ attr_accessor :query_builder
3465
+
3466
+ # Optional. A Log Analytics SQL query in text format.If both sql_query_text and
3467
+ # query_builder fields are set, then the sql_query_text will be used, if its non-
3468
+ # empty. At least one of the two fields must be set.
3257
3469
  # Corresponds to the JSON property `sqlQueryText`
3258
3470
  # @return [String]
3259
3471
  attr_accessor :sql_query_text
@@ -3264,6 +3476,7 @@ module Google
3264
3476
 
3265
3477
  # Update properties of this object
3266
3478
  def update!(**args)
3479
+ @query_builder = args[:query_builder] if args.key?(:query_builder)
3267
3480
  @sql_query_text = args[:sql_query_text] if args.key?(:sql_query_text)
3268
3481
  end
3269
3482
  end
@@ -3355,6 +3568,147 @@ module Google
3355
3568
  end
3356
3569
  end
3357
3570
 
3571
+ # Represents a field selected in the query, analogous to an item in a SQL SELECT
3572
+ # clause. It specifies the source field and optionally applies transformations
3573
+ # like aggregation, casting, regex extraction, or assigns an alias. Use
3574
+ # ProjectedField when you need more than just the raw source field name (for
3575
+ # which you might use FieldSource directly in QueryBuilderConfig's field_sources
3576
+ # list if no transformations or specific operation type are needed).
3577
+ class ProjectedField
3578
+ include Google::Apis::Core::Hashable
3579
+
3580
+ # The alias name for the field. Valid alias examples are: - single word alias:
3581
+ # TestAlias - numbers in an alias: Alias123 - multi word alias should be
3582
+ # enclosed in quotes: "Test Alias" Invalid alias examples are: - alias
3583
+ # containing keywords: WHERE, SELECT, FROM, etc. - alias starting with a number:
3584
+ # 1stAlias
3585
+ # Corresponds to the JSON property `alias`
3586
+ # @return [String]
3587
+ attr_accessor :alias
3588
+
3589
+ # The cast for the field. This can any SQL cast type. Examples: - STRING - CHAR -
3590
+ # DATE - TIMESTAMP - DATETIME - INT - FLOAT
3591
+ # Corresponds to the JSON property `cast`
3592
+ # @return [String]
3593
+ attr_accessor :cast
3594
+
3595
+ # The field name. This will be the field that is selected using the dot notation
3596
+ # to display the drill down value.
3597
+ # Corresponds to the JSON property `field`
3598
+ # @return [String]
3599
+ attr_accessor :field
3600
+
3601
+ # Specifies the role of this field (direct selection, grouping, or aggregation).
3602
+ # Corresponds to the JSON property `operation`
3603
+ # @return [String]
3604
+ attr_accessor :operation
3605
+
3606
+ # The re2 extraction for the field. This will be used to extract the value from
3607
+ # the field using REGEXP_EXTRACT. More information on re2 can be found here:
3608
+ # https://github.com/google/re2/wiki/Syntax. Meta characters like +?()| will
3609
+ # need to be escaped. Examples: - ".(autoscaler.*)$" will be converted to
3610
+ # REGEXP_EXTRACT(JSON_VALUE(field),"request(.*(autoscaler.*)$)")in SQL. - "\(
3611
+ # test_value\)$" will be converted to REGEXP_EXTRACT(JSON_VALUE(field),"request(\
3612
+ # (test_value\)$)") in SQL.
3613
+ # Corresponds to the JSON property `regexExtraction`
3614
+ # @return [String]
3615
+ attr_accessor :regex_extraction
3616
+
3617
+ # Defines the aggregation function to apply to this field. This message is used
3618
+ # only when operation is set to AGGREGATE.
3619
+ # Corresponds to the JSON property `sqlAggregationFunction`
3620
+ # @return [Google::Apis::LoggingV2::FunctionApplication]
3621
+ attr_accessor :sql_aggregation_function
3622
+
3623
+ # The truncation granularity when grouping by a time/date field. This will be
3624
+ # used to truncate the field to the granularity specified. This can be either a
3625
+ # date or a time granularity found at https://cloud.google.com/bigquery/docs/
3626
+ # reference/standard-sql/timestamp_functions#timestamp_trunc_granularity_date
3627
+ # and https://cloud.google.com/bigquery/docs/reference/standard-sql/
3628
+ # timestamp_functions#timestamp_trunc_granularity_time respectively.
3629
+ # Corresponds to the JSON property `truncationGranularity`
3630
+ # @return [String]
3631
+ attr_accessor :truncation_granularity
3632
+
3633
+ def initialize(**args)
3634
+ update!(**args)
3635
+ end
3636
+
3637
+ # Update properties of this object
3638
+ def update!(**args)
3639
+ @alias = args[:alias] if args.key?(:alias)
3640
+ @cast = args[:cast] if args.key?(:cast)
3641
+ @field = args[:field] if args.key?(:field)
3642
+ @operation = args[:operation] if args.key?(:operation)
3643
+ @regex_extraction = args[:regex_extraction] if args.key?(:regex_extraction)
3644
+ @sql_aggregation_function = args[:sql_aggregation_function] if args.key?(:sql_aggregation_function)
3645
+ @truncation_granularity = args[:truncation_granularity] if args.key?(:truncation_granularity)
3646
+ end
3647
+ end
3648
+
3649
+ # Defines a structured query configuration that can be used instead of writing
3650
+ # raw SQL. This configuration represents the components of a SQL query (FROM,
3651
+ # SELECT, WHERE, ORDER BY, LIMIT) and is typically converted into an executable
3652
+ # query (e.g., BigQuery SQL) by the backend service to retrieve data for
3653
+ # analysis or visualization.
3654
+ class QueryBuilderConfig
3655
+ include Google::Apis::Core::Hashable
3656
+
3657
+ # Defines the items to include in the query result, analogous to a SQL SELECT
3658
+ # clause.
3659
+ # Corresponds to the JSON property `fieldSources`
3660
+ # @return [Array<Google::Apis::LoggingV2::FieldSource>]
3661
+ attr_accessor :field_sources
3662
+
3663
+ # A filter for a query. This equates to the WHERE clause in SQL.
3664
+ # Corresponds to the JSON property `filter`
3665
+ # @return [Google::Apis::LoggingV2::FilterPredicate]
3666
+ attr_accessor :filter
3667
+
3668
+ # The limit to use for the query. This equates to the LIMIT clause in SQL. A
3669
+ # limit of 0 will be treated as not enabled.
3670
+ # Corresponds to the JSON property `limit`
3671
+ # @return [Fixnum]
3672
+ attr_accessor :limit
3673
+
3674
+ # The sort orders to use for the query. This equates to the ORDER BY clause in
3675
+ # SQL.
3676
+ # Corresponds to the JSON property `orderBys`
3677
+ # @return [Array<Google::Apis::LoggingV2::SortOrderParameter>]
3678
+ attr_accessor :order_bys
3679
+
3680
+ # Required. The view/resource to query. For now only a single view/resource will
3681
+ # be sent, but there are plans to allow multiple views in the future. Marking as
3682
+ # repeated for that purpose. Example: - "projects/123/locations/global/buckets/
3683
+ # 456/views/_Default" - "projects/123/locations/global/metricBuckets/456/views/
3684
+ # _Default"
3685
+ # Corresponds to the JSON property `resourceNames`
3686
+ # @return [Array<String>]
3687
+ attr_accessor :resource_names
3688
+
3689
+ # The plain text search to use for the query. There is no support for multiple
3690
+ # search terms. This uses the SEARCH functionality in BigQuery. For example, a
3691
+ # search_term = 'ERROR' would result in the following SQL:SELECT * FROM resource
3692
+ # WHERE SEARCH(resource, 'ERROR') LIMIT 100
3693
+ # Corresponds to the JSON property `searchTerm`
3694
+ # @return [String]
3695
+ attr_accessor :search_term
3696
+
3697
+ def initialize(**args)
3698
+ update!(**args)
3699
+ end
3700
+
3701
+ # Update properties of this object
3702
+ def update!(**args)
3703
+ @field_sources = args[:field_sources] if args.key?(:field_sources)
3704
+ @filter = args[:filter] if args.key?(:filter)
3705
+ @limit = args[:limit] if args.key?(:limit)
3706
+ @order_bys = args[:order_bys] if args.key?(:order_bys)
3707
+ @resource_names = args[:resource_names] if args.key?(:resource_names)
3708
+ @search_term = args[:search_term] if args.key?(:search_term)
3709
+ end
3710
+ end
3711
+
3358
3712
  # Describes a recent query executed on the Logs Explorer or Log Analytics page
3359
3713
  # within the last ~ 30 days.
3360
3714
  class RecentQuery
@@ -3375,15 +3729,13 @@ module Google
3375
3729
 
3376
3730
  # Output only. Resource name of the recent query.In the format: "projects/[
3377
3731
  # PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID]" For a list of
3378
- # supported locations, see Supported Regions (https://cloud.google.com/logging/
3379
- # docs/region-support)The QUERY_ID is a system generated alphanumeric ID.
3732
+ # supported locations, see Supported Regions (https://docs.cloud.google.com/
3733
+ # logging/docs/region-support)The QUERY_ID is a system generated alphanumeric ID.
3380
3734
  # Corresponds to the JSON property `name`
3381
3735
  # @return [String]
3382
3736
  attr_accessor :name
3383
3737
 
3384
- # Describes an analytics query that can be run in the Log Analytics page of
3385
- # Google Cloud console.Preview: This is a preview feature and may be subject to
3386
- # change before final release.
3738
+ # Describes a query that can be run in Log Analytics.
3387
3739
  # Corresponds to the JSON property `opsAnalyticsQuery`
3388
3740
  # @return [Google::Apis::LoggingV2::OpsAnalyticsQuery]
3389
3741
  attr_accessor :ops_analytics_query
@@ -3667,17 +4019,15 @@ module Google
3667
4019
 
3668
4020
  # Output only. Resource name of the saved query.In the format: "projects/[
3669
4021
  # PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of
3670
- # supported locations, see Supported Regions (https://cloud.google.com/logging/
3671
- # docs/region-support#bucket-regions)After the saved query is created, the
3672
- # location cannot be changed.If the user doesn't provide a QUERY_ID, the system
3673
- # will generate an alphanumeric ID.
4022
+ # supported locations, see Supported Regions (https://docs.cloud.google.com/
4023
+ # logging/docs/region-support#bucket-regions)After the saved query is created,
4024
+ # the location cannot be changed.If the user doesn't provide a QUERY_ID, the
4025
+ # system will generate an alphanumeric ID.
3674
4026
  # Corresponds to the JSON property `name`
3675
4027
  # @return [String]
3676
4028
  attr_accessor :name
3677
4029
 
3678
- # Describes an analytics query that can be run in the Log Analytics page of
3679
- # Google Cloud console.Preview: This is a preview feature and may be subject to
3680
- # change before final release.
4030
+ # Describes a query that can be run in Log Analytics.
3681
4031
  # Corresponds to the JSON property `opsAnalyticsQuery`
3682
4032
  # @return [Google::Apis::LoggingV2::OpsAnalyticsQuery]
3683
4033
  attr_accessor :ops_analytics_query
@@ -3791,8 +4141,8 @@ module Google
3791
4141
  # cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.The Cloud KMS
3792
4142
  # key used by the Log Router can be updated by changing the kms_key_name to a
3793
4143
  # new valid key name.To disable CMEK for the Log Router, set this field to an
3794
- # empty string.See Enabling CMEK for Log Router (https://cloud.google.com/
3795
- # logging/docs/routing/managed-encryption) for more information.
4144
+ # empty string.See Configure CMEK for Cloud Logging (https://docs.cloud.google.
4145
+ # com/logging/docs/routing/managed-encryption) for more information.
3796
4146
  # Corresponds to the JSON property `kmsKeyName`
3797
4147
  # @return [String]
3798
4148
  attr_accessor :kms_key_name
@@ -3801,8 +4151,8 @@ module Google
3801
4151
  # your Cloud KMS key.Before enabling CMEK, you must first assign the role roles/
3802
4152
  # cloudkms.cryptoKeyEncrypterDecrypter to the service account that will be used
3803
4153
  # to access your Cloud KMS key. Use GetSettings to obtain the service account ID.
3804
- # See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/
3805
- # routing/managed-encryption) for more information.
4154
+ # See Configure CMEK for Cloud Logging (https://docs.cloud.google.com/logging/
4155
+ # docs/routing/managed-encryption) for more information.
3806
4156
  # Corresponds to the JSON property `kmsServiceAccountId`
3807
4157
  # @return [String]
3808
4158
  attr_accessor :kms_service_account_id
@@ -3845,6 +4195,32 @@ module Google
3845
4195
  end
3846
4196
  end
3847
4197
 
4198
+ # A sort order for a query based on a column.
4199
+ class SortOrderParameter
4200
+ include Google::Apis::Core::Hashable
4201
+
4202
+ # A source that can be used to represent a field within various parts of a
4203
+ # structured query, such as in SELECT, WHERE, or ORDER BY clauses.
4204
+ # Corresponds to the JSON property `fieldSource`
4205
+ # @return [Google::Apis::LoggingV2::FieldSource]
4206
+ attr_accessor :field_source
4207
+
4208
+ # The sort order to use for the query.
4209
+ # Corresponds to the JSON property `sortOrderDirection`
4210
+ # @return [String]
4211
+ attr_accessor :sort_order_direction
4212
+
4213
+ def initialize(**args)
4214
+ update!(**args)
4215
+ end
4216
+
4217
+ # Update properties of this object
4218
+ def update!(**args)
4219
+ @field_source = args[:field_source] if args.key?(:field_source)
4220
+ @sort_order_direction = args[:sort_order_direction] if args.key?(:sort_order_direction)
4221
+ end
4222
+ end
4223
+
3848
4224
  # Specifies a location in a source code file.
3849
4225
  class SourceLocation
3850
4226
  include Google::Apis::Core::Hashable
@@ -3948,8 +4324,8 @@ module Google
3948
4324
  end
3949
4325
  end
3950
4326
 
3951
- # A field from the LogEntry that is added to the summary line (https://cloud.
3952
- # google.com/logging/docs/view/logs-explorer-interface#add-summary-fields) for a
4327
+ # A field from the LogEntry that is added to the summary line (https://docs.
4328
+ # cloud.google.com/logging/docs/view/logs-explorer-interface#preferences) for a
3953
4329
  # query in the Logs Explorer.
3954
4330
  class SummaryField
3955
4331
  include Google::Apis::Core::Hashable