diff --git a/google/logging/type/BUILD.bazel b/google/logging/type/BUILD.bazel index ad1f477f0..d0d70964a 100644 --- a/google/logging/type/BUILD.bazel +++ b/google/logging/type/BUILD.bazel @@ -15,7 +15,6 @@ proto_library( "log_severity.proto", ], deps = [ - "//google/api:annotations_proto", "@com_google_protobuf//:duration_proto", ], ) @@ -60,6 +59,7 @@ java_gapic_assembly_gradle_pkg( load( "@com_google_googleapis_imports//:imports.bzl", "go_proto_library", + "go_gapic_assembly_pkg", ) go_proto_library( @@ -68,7 +68,13 @@ go_proto_library( importpath = "google.golang.org/genproto/googleapis/logging/type", protos = [":type_proto"], deps = [ - "//google/api:annotations_go_proto", + ], +) + +go_gapic_assembly_pkg( + name = "logging-type-go", + deps = [ + ":type_go_proto", ], ) @@ -86,7 +92,6 @@ moved_proto_library( name = "type_moved_proto", srcs = [":type_proto"], deps = [ - "//google/api:annotations_proto", "@com_google_protobuf//:duration_proto", ], ) @@ -107,9 +112,9 @@ py_grpc_library( ############################################################################## load( "@com_google_googleapis_imports//:imports.bzl", + "php_gapic_assembly_pkg", "php_grpc_library", "php_proto_library", - "php_gapic_assembly_pkg", ) php_proto_library( @@ -128,7 +133,9 @@ php_grpc_library( # Open Source Packages php_gapic_assembly_pkg( name = "google-logging-type-php", - deps = [":type_php_proto"], + deps = [ + ":type_php_proto", + ], ) ############################################################################## @@ -140,6 +147,7 @@ load( "nodejs_gapic_library", ) + ############################################################################## # Ruby ############################################################################## diff --git a/google/logging/type/http_request.proto b/google/logging/type/http_request.proto index b878d60dc..425a09d6e 100644 --- a/google/logging/type/http_request.proto +++ b/google/logging/type/http_request.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ message HttpRequest { // The referer URL of the request, as defined in // [HTTP/1.1 Header Field - // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + // Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). string referer = 8; // The request processing latency on the server, from the time the request was diff --git a/google/logging/type/log_severity.proto b/google/logging/type/log_severity.proto index bed71935f..674012581 100644 --- a/google/logging/type/log_severity.proto +++ b/google/logging/type/log_severity.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/logging/v2/BUILD.bazel b/google/logging/v2/BUILD.bazel index 3527257fb..68614907a 100644 --- a/google/logging/v2/BUILD.bazel +++ b/google/logging/v2/BUILD.bazel @@ -9,44 +9,14 @@ # * extra_protoc_file_parameters # The complete list of preserved parameters can be found in the source code. +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + ############################################################################## # Common ############################################################################## load("@rules_proto//proto:defs.bzl", "proto_library") -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_grpc_library", - "cc_proto_library", - "csharp_gapic_assembly_pkg", - "csharp_gapic_library", - "csharp_grpc_library", - "csharp_proto_library", - "go_gapic_assembly_pkg", - "go_gapic_library", - "go_proto_library", - "go_test", - "java_gapic_assembly_gradle_pkg", - "java_gapic_library", - "java_gapic_test", - "java_grpc_library", - "java_proto_library", - "nodejs_gapic_assembly_pkg", - "nodejs_gapic_library", - "php_gapic_assembly_pkg", - "php_gapic_library", - "php_grpc_library", - "php_proto_library", - "proto_library_with_info", - "py_gapic_assembly_pkg", - "py_gapic_library", - "ruby_cloud_gapic_library", - "ruby_gapic_assembly_pkg", - "ruby_grpc_library", - "ruby_proto_library", -) - -# This is an API workspace, having public visibility by default makes perfect sense. -package(default_visibility = ["//visibility:public"]) +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") proto_library( name = "logging_proto", @@ -84,6 +54,18 @@ proto_library_with_info( ], ) +############################################################################## +# Java +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "java_gapic_assembly_gradle_pkg", + "java_gapic_library", + "java_gapic_test", + "java_grpc_library", + "java_proto_library", +) + java_proto_library( name = "logging_java_proto", deps = [":logging_proto"], @@ -135,6 +117,17 @@ java_gapic_assembly_gradle_pkg( ], ) +############################################################################## +# Go +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "go_gapic_assembly_pkg", + "go_gapic_library", + "go_proto_library", + "go_test", +) + go_proto_library( name = "logging_go_proto", compilers = ["@io_bazel_rules_go//proto:go_grpc"], @@ -156,8 +149,8 @@ go_gapic_library( srcs = [":logging_proto_with_info"], grpc_service_config = "logging_grpc_service_config.json", importpath = "cloud.google.com/go/logging/apiv2;logging", - release_level = "ga", metadata = True, + release_level = "ga", rest_numeric_enums = True, service_yaml = "logging_v2.yaml", transport = "grpc", @@ -193,6 +186,16 @@ go_gapic_assembly_pkg( ], ) +############################################################################## +# Python +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_test", +) + py_gapic_library( name = "logging_py_gapic", srcs = [":logging_proto"], @@ -204,18 +207,19 @@ py_gapic_library( rest_numeric_enums = True, service_yaml = "logging_v2.yaml", transport = "grpc", + deps = [ + ], ) -# Uncomment once https://github.com/googleapis/gapic-generator-python/issues/1359 is fixed -#py_test( -# name = "logging_py_gapic_test", -# srcs = [ -# "logging_py_gapic_pytest.py", -# "logging_py_gapic_test.py", -# ], -# legacy_create_init = False, -# deps = [":logging_py_gapic"], -#) +py_test( + name = "logging_py_gapic_test", + srcs = [ + "logging_py_gapic_pytest.py", + "logging_py_gapic_test.py", + ], + legacy_create_init = False, + deps = [":logging_py_gapic"], +) # Open Source Packages py_gapic_assembly_pkg( @@ -225,6 +229,17 @@ py_gapic_assembly_pkg( ], ) +############################################################################## +# PHP +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "php_gapic_assembly_pkg", + "php_gapic_library", + "php_grpc_library", + "php_proto_library", +) + php_proto_library( name = "logging_php_proto", deps = [":logging_proto"], @@ -260,6 +275,15 @@ php_gapic_assembly_pkg( ], ) +############################################################################## +# Node.js +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + nodejs_gapic_library( name = "logging_nodejs_gapic", package_name = "@google-cloud/logging", @@ -283,6 +307,17 @@ nodejs_gapic_assembly_pkg( ], ) +############################################################################## +# Ruby +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", + "ruby_gapic_assembly_pkg", + "ruby_grpc_library", + "ruby_proto_library", +) + ruby_proto_library( name = "logging_ruby_proto", deps = [":logging_proto"], @@ -328,6 +363,17 @@ ruby_gapic_assembly_pkg( ], ) +############################################################################## +# C# +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "csharp_gapic_assembly_pkg", + "csharp_gapic_library", + "csharp_grpc_library", + "csharp_proto_library", +) + csharp_proto_library( name = "logging_csharp_proto", deps = [":logging_proto"], @@ -363,6 +409,15 @@ csharp_gapic_assembly_pkg( ], ) +############################################################################## +# C++ +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "cc_grpc_library", + "cc_proto_library", +) + cc_proto_library( name = "logging_cc_proto", deps = [":logging_proto"], diff --git a/google/logging/v2/log_entry.proto b/google/logging/v2/log_entry.proto index 634092a91..94c5cdff8 100644 --- a/google/logging/v2/log_entry.proto +++ b/google/logging/v2/log_entry.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -75,7 +75,8 @@ message LogEntry { // Example: a log entry that reports a database error would be associated with // the monitored resource designating the particular database that reported // the error. - google.api.MonitoredResource resource = 8 [(google.api.field_behavior) = REQUIRED]; + google.api.MonitoredResource resource = 8 + [(google.api.field_behavior) = REQUIRED]; // The log entry payload, which can be one of multiple types. oneof payload { @@ -97,27 +98,32 @@ message LogEntry { google.protobuf.Struct json_payload = 6; } - // Optional. The time the event described by the log entry occurred. This time is used - // to compute the log entry's age and to enforce the logs retention period. - // If this field is omitted in a new log entry, then Logging assigns it the - // current time. Timestamps have nanosecond accuracy, but trailing zeros in - // the fractional seconds might be omitted when the timestamp is displayed. + // Optional. The time the event described by the log entry occurred. This time + // is used to compute the log entry's age and to enforce the logs retention + // period. If this field is omitted in a new log entry, then Logging assigns + // it the current time. Timestamps have nanosecond accuracy, but trailing + // zeros in the fractional seconds might be omitted when the timestamp is + // displayed. // // Incoming log entries must have timestamps that don't exceed the // [logs retention // period](https://cloud.google.com/logging/quotas#logs_retention_periods) in // the past, and that don't exceed 24 hours in the future. Log entries outside // those time boundaries aren't ingested by Logging. - google.protobuf.Timestamp timestamp = 9 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp timestamp = 9 + [(google.api.field_behavior) = OPTIONAL]; // Output only. The time the log entry was received by Logging. - google.protobuf.Timestamp receive_timestamp = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp receive_timestamp = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. - google.logging.type.LogSeverity severity = 10 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. A unique identifier for the log entry. If you provide a value, then - // Logging considers other log entries in the same project, with the same + // Optional. A unique identifier for the log entry. If you provide a value, + // then Logging considers other log entries in the same project, with the same // `timestamp`, and with the same `insert_id` to be duplicates which are // removed in a single query result. However, there are no guarantees of // de-duplication in the export of logs. @@ -129,12 +135,13 @@ message LogEntry { // the same `log_name` and `timestamp` values. string insert_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Information about the HTTP request associated with this log entry, if - // applicable. - google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Information about the HTTP request associated with this log + // entry, if applicable. + google.logging.type.HttpRequest http_request = 7 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. A map of key, value pairs that provides additional information about the - // log entry. The labels can be user-defined or system-defined. + // Optional. A map of key, value pairs that provides additional information + // about the log entry. The labels can be user-defined or system-defined. // // User-defined labels are arbitrary key, value pairs that you can use to // classify logs. @@ -153,17 +160,47 @@ message LogEntry { // applicable. LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Resource name of the trace associated with the log entry, if any. If it - // contains a relative resource name, the name is assumed to be relative to - // `//tracing.googleapis.com`. Example: - // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + // Optional. The REST resource name of the trace being written to + // [Cloud Trace](https://cloud.google.com/trace) in + // association with this log entry. For example, if your trace data is stored + // in the Cloud project "my-trace-project" and if the service that is creating + // the log entry receives a trace header that includes the trace ID "12345", + // then the service should use "projects/my-tracing-project/traces/12345". + // + // The `trace` field provides the link between logs and traces. By using + // this field, you can navigate from a log entry to a trace. string trace = 22 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The span ID within the trace associated with the log entry. + // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + // associated with the current operation in which the log is being written. + // For example, if a span has the REST resource name of + // "projects/some-project/traces/some-trace/spans/some-span-id", then the + // `span_id` field is "some-span-id". + // + // A + // [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + // represents a single operation within a trace. Whereas a trace may involve + // multiple different microservices running on multiple different machines, + // a span generally corresponds to a single logical operation being performed + // in a single instance of a microservice on one specific machine. Spans + // are the nodes within the tree that is a trace. + // + // Applications that are [instrumented for + // tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + // new, unique span ID on each incoming request. It is also common to create + // and record additional spans corresponding to internal processing elements + // as well as issuing requests to dependencies. + // + // The span ID is expected to be a 16-character, hexadecimal encoding of an + // 8-byte array and should not be zero. It should be unique within the trace + // and should, ideally, be generated in a manner that is uniformly random. + // + // Example values: // - // For Trace spans, this is the same format that the Trace API v2 uses: a - // 16-character hexadecimal encoding of an 8-byte array, such as - // `000000000000004a`. + // - `000000000000004a` + // - `7a2190356c3fc94b` + // - `0000f00300090021` + // - `d39223e101960076` string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; // Optional. The sampling decision of the trace associated with the log entry. @@ -175,11 +212,13 @@ message LogEntry { // request correlation identifier. The default is False. bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Source code location information associated with the log entry, if any. - LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Source code location information associated with the log entry, + // if any. + LogEntrySourceLocation source_location = 23 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Information indicating this LogEntry is part of a sequence of multiple log - // entries split from a single LogEntry. + // Optional. Information indicating this LogEntry is part of a sequence of + // multiple log entries split from a single LogEntry. LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/google/logging/v2/logging.proto b/google/logging/v2/logging.proto index d87f6549e..92d481eac 100644 --- a/google/logging/v2/logging.proto +++ b/google/logging/v2/logging.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -52,18 +52,10 @@ service LoggingServiceV2 { rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{log_name=projects/*/logs/*}" - additional_bindings { - delete: "/v2/{log_name=*/*/logs/*}" - } - additional_bindings { - delete: "/v2/{log_name=organizations/*/logs/*}" - } - additional_bindings { - delete: "/v2/{log_name=folders/*/logs/*}" - } - additional_bindings { - delete: "/v2/{log_name=billingAccounts/*/logs/*}" - } + additional_bindings { delete: "/v2/{log_name=*/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=organizations/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=folders/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=billingAccounts/*/logs/*}" } }; option (google.api.method_signature) = "log_name"; } @@ -75,7 +67,8 @@ service LoggingServiceV2 { // A single request may contain log entries for a maximum of 1000 // different resources (projects, organizations, billing accounts or // folders) - rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) { + rpc WriteLogEntries(WriteLogEntriesRequest) + returns (WriteLogEntriesResponse) { option (google.api.http) = { post: "/v2/entries:write" body: "*" @@ -96,7 +89,8 @@ service LoggingServiceV2 { } // Lists the descriptors for monitored resource types used by Logging. - rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) { + rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) + returns (ListMonitoredResourceDescriptorsResponse) { option (google.api.http) = { get: "/v2/monitoredResourceDescriptors" }; @@ -107,17 +101,21 @@ service LoggingServiceV2 { rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) { option (google.api.http) = { get: "/v2/{parent=*/*}/logs" + additional_bindings { get: "/v2/{parent=projects/*}/logs" } + additional_bindings { get: "/v2/{parent=organizations/*}/logs" } + additional_bindings { get: "/v2/{parent=folders/*}/logs" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/logs" } additional_bindings { - get: "/v2/{parent=projects/*}/logs" + get: "/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs" } additional_bindings { - get: "/v2/{parent=organizations/*}/logs" + get: "/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs" } additional_bindings { - get: "/v2/{parent=folders/*}/logs" + get: "/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs" } additional_bindings { - get: "/v2/{parent=billingAccounts/*}/logs" + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs" } }; option (google.api.method_signature) = "parent"; @@ -125,7 +123,8 @@ service LoggingServiceV2 { // Streaming read of log entries as they are ingested. Until the stream is // terminated, it will continue reading logs. - rpc TailLogEntries(stream TailLogEntriesRequest) returns (stream TailLogEntriesResponse) { + rpc TailLogEntries(stream TailLogEntriesRequest) + returns (stream TailLogEntriesResponse) { option (google.api.http) = { post: "/v2/entries:tail" body: "*" @@ -150,9 +149,7 @@ message DeleteLogRequest { // [LogEntry][google.logging.v2.LogEntry]. string log_name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "logging.googleapis.com/Log" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } ]; } @@ -177,9 +174,7 @@ message WriteLogEntriesRequest { // individual log entry. string log_name = 1 [ (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "logging.googleapis.com/Log" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } ]; // Optional. A default monitored resource object that is assigned to all log @@ -190,7 +185,8 @@ message WriteLogEntriesRequest { // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} // // See [LogEntry][google.logging.v2.LogEntry]. - google.api.MonitoredResource resource = 2 [(google.api.field_behavior) = OPTIONAL]; + google.api.MonitoredResource resource = 2 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Default labels that are added to the `labels` field of all log // entries in `entries`. If a log entry already has a label with the same key @@ -224,11 +220,13 @@ message WriteLogEntriesRequest { // list, rather than calling this method for each individual log entry. repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED]; - // Optional. Whether valid entries should be written even if some other - // entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - // entry is not written, then the response status is the error associated - // with one of the failed entries and the response includes error details - // keyed by the entries' zero-based index in the `entries.write` method. + // Optional. Whether a batch's valid entries should be written even if some + // other entry failed due to a permanent error such as INVALID_ARGUMENT or + // PERMISSION_DENIED. If any entry failed, then the response status is the + // response status of one of the failed entries. The response will include + // error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + // the entries' zero-based index in the `entries`. Failed requests for which + // no entries are written will not include per-entry errors. bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. If true, the request should expect normal response, but the @@ -238,9 +236,7 @@ message WriteLogEntriesRequest { } // Result returned from WriteLogEntries. -message WriteLogEntriesResponse { - -} +message WriteLogEntriesResponse {} // Error details for WriteLogEntries with partial success. message WriteLogEntriesPartialErrors { @@ -271,6 +267,7 @@ message ListLogEntriesRequest { // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // // Projects listed in the `project_ids` field are added to this list. + // A maximum of 100 resources may be specified in a single request. repeated string resource_names = 8 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -278,13 +275,11 @@ message ListLogEntriesRequest { } ]; - // Optional. A filter that chooses which log entries to return. See [Advanced - // Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - // Only log entries that match the filter are returned. An empty filter - // matches all log entries in the resources listed in `resource_names`. + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. // Referencing a parent resource that is not listed in `resource_names` will - // cause the filter to return no results. The maximum length of the filter is - // 20000 characters. + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. How the results should be sorted. Presently, the only permitted @@ -295,10 +290,10 @@ message ListLogEntriesRequest { // timestamps are returned in order of their `insert_id` values. string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of results to return from this request. Default is 50. - // If the value is negative or exceeds 1000, the request is rejected. The - // presence of `next_page_token` in the response indicates that more results - // might be available. + // Optional. The maximum number of results to return from this request. + // Default is 50. If the value is negative or exceeds 1000, the request is + // rejected. The presence of `next_page_token` in the response indicates that + // more results might be available. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the @@ -355,7 +350,7 @@ message ListMonitoredResourceDescriptorsResponse { // The parameters to ListLogs. message ListLogsRequest { - // Required. The resource name that owns the logs: + // Required. The resource name to list logs for: // // * `projects/[PROJECT_ID]` // * `organizations/[ORGANIZATION_ID]` @@ -368,18 +363,7 @@ message ListLogsRequest { } ]; - // Optional. The maximum number of results to return from this request. - // Non-positive values are ignored. The presence of `nextPageToken` in the - // response indicates that more results might be available. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, then retrieve the next batch of results from the - // preceding call to this method. `pageToken` must be the value of - // `nextPageToken` from the previous response. The values of other method - // parameters should be identical to those in the previous call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The resource name that owns the logs: + // Optional. List of resource names to list logs for: // // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` @@ -392,12 +376,25 @@ message ListLogsRequest { // * `organizations/[ORGANIZATION_ID]` // * `billingAccounts/[BILLING_ACCOUNT_ID]` // * `folders/[FOLDER_ID]` + // + // The resource name in the `parent` field is added to this list. repeated string resource_names = 8 [ (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { child_type: "logging.googleapis.com/Log" } ]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListLogs. @@ -430,20 +427,19 @@ message TailLogEntriesRequest { // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. A filter that chooses which log entries to return. See [Advanced - // Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - // Only log entries that match the filter are returned. An empty filter - // matches all log entries in the resources listed in `resource_names`. - // Referencing a parent resource that is not in `resource_names` will cause - // the filter to return no results. The maximum length of the filter is 20000 - // characters. + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. + // Referencing a parent resource that is not listed in `resource_names` will + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The amount of time to buffer log entries at the server before // being returned to prevent out of order results due to late arriving log // entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 // milliseconds. - google.protobuf.Duration buffer_window = 3 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration buffer_window = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Result returned from `TailLogEntries`. diff --git a/google/logging/v2/logging_config.proto b/google/logging/v2/logging_config.proto index f55ab4586..cc7677b12 100644 --- a/google/logging/v2/logging_config.proto +++ b/google/logging/v2/logging_config.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -59,15 +59,11 @@ service ConfigServiceV2 { rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { option (google.api.http) = { get: "/v2/{parent=*/*/locations/*}/buckets" - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/buckets" - } + additional_bindings { get: "/v2/{parent=projects/*/locations/*}/buckets" } additional_bindings { get: "/v2/{parent=organizations/*/locations/*}/buckets" } - additional_bindings { - get: "/v2/{parent=folders/*/locations/*}/buckets" - } + additional_bindings { get: "/v2/{parent=folders/*/locations/*}/buckets" } additional_bindings { get: "/v2/{parent=billingAccounts/*/locations/*}/buckets" } @@ -79,19 +75,80 @@ service ConfigServiceV2 { rpc GetBucket(GetBucketRequest) returns (LogBucket) { option (google.api.http) = { get: "/v2/{name=*/*/locations/*/buckets/*}" + additional_bindings { get: "/v2/{name=projects/*/locations/*/buckets/*}" } additional_bindings { - get: "/v2/{name=projects/*/locations/*/buckets/*}" + get: "/v2/{name=organizations/*/locations/*/buckets/*}" } + additional_bindings { get: "/v2/{name=folders/*/locations/*/buckets/*}" } additional_bindings { - get: "/v2/{name=organizations/*/locations/*/buckets/*}" + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + }; + } + + // Creates a log bucket asynchronously that can be used to store log entries. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc CreateBucketAsync(CreateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*}/buckets:createAsync" + body: "bucket" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/buckets:createAsync" + body: "bucket" } additional_bindings { - get: "/v2/{name=folders/*/locations/*/buckets/*}" + post: "/v2/{parent=folders/*/locations/*}/buckets:createAsync" + body: "bucket" } additional_bindings { - get: "/v2/{name=billingAccounts/*/buckets/*}" + post: "/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync" + body: "bucket" } }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; + } + + // Updates a log bucket asynchronously. + // + // If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + // `FAILED_PRECONDITION` will be returned. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc UpdateBucketAsync(UpdateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=*/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=folders/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; } // Creates a log bucket that can be used to store log entries. After a bucket @@ -119,11 +176,7 @@ service ConfigServiceV2 { }; } - // Updates a log bucket. This method replaces the following fields in the - // existing bucket with values from the new bucket: `retention_period` - // - // If the retention period is decreased and the bucket is locked, - // `FAILED_PRECONDITION` will be returned. + // Updates a log bucket. // // If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then // `FAILED_PRECONDITION` will be returned. @@ -234,7 +287,7 @@ service ConfigServiceV2 { get: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" } additional_bindings { - get: "/v2/{name=billingAccounts/*/buckets/*/views/*}" + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" } }; } @@ -318,18 +371,10 @@ service ConfigServiceV2 { rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { option (google.api.http) = { get: "/v2/{parent=*/*}/sinks" - additional_bindings { - get: "/v2/{parent=projects/*}/sinks" - } - additional_bindings { - get: "/v2/{parent=organizations/*}/sinks" - } - additional_bindings { - get: "/v2/{parent=folders/*}/sinks" - } - additional_bindings { - get: "/v2/{parent=billingAccounts/*}/sinks" - } + additional_bindings { get: "/v2/{parent=projects/*}/sinks" } + additional_bindings { get: "/v2/{parent=organizations/*}/sinks" } + additional_bindings { get: "/v2/{parent=folders/*}/sinks" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/sinks" } }; option (google.api.method_signature) = "parent"; } @@ -338,18 +383,10 @@ service ConfigServiceV2 { rpc GetSink(GetSinkRequest) returns (LogSink) { option (google.api.http) = { get: "/v2/{sink_name=*/*/sinks/*}" - additional_bindings { - get: "/v2/{sink_name=projects/*/sinks/*}" - } - additional_bindings { - get: "/v2/{sink_name=organizations/*/sinks/*}" - } - additional_bindings { - get: "/v2/{sink_name=folders/*/sinks/*}" - } - additional_bindings { - get: "/v2/{sink_name=billingAccounts/*/sinks/*}" - } + additional_bindings { get: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=billingAccounts/*/sinks/*}" } }; option (google.api.method_signature) = "sink_name"; } @@ -362,18 +399,12 @@ service ConfigServiceV2 { option (google.api.http) = { post: "/v2/{parent=*/*}/sinks" body: "sink" - additional_bindings { - post: "/v2/{parent=projects/*}/sinks" - body: "sink" - } + additional_bindings { post: "/v2/{parent=projects/*}/sinks" body: "sink" } additional_bindings { post: "/v2/{parent=organizations/*}/sinks" body: "sink" } - additional_bindings { - post: "/v2/{parent=folders/*}/sinks" - body: "sink" - } + additional_bindings { post: "/v2/{parent=folders/*}/sinks" body: "sink" } additional_bindings { post: "/v2/{parent=billingAccounts/*}/sinks" body: "sink" @@ -433,62 +464,136 @@ service ConfigServiceV2 { rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{sink_name=*/*/sinks/*}" + additional_bindings { delete: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { + delete: "/v2/{sink_name=billingAccounts/*/sinks/*}" + } + }; + option (google.api.method_signature) = "sink_name"; + } + + // Asynchronously creates a linked dataset in BigQuery which makes it possible + // to use BigQuery to read the logs stored in the log bucket. A log bucket may + // currently only contain one link. + rpc CreateLink(CreateLinkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*/buckets/*}/links" + body: "link" additional_bindings { - delete: "/v2/{sink_name=projects/*/sinks/*}" + post: "/v2/{parent=projects/*/locations/*/buckets/*}/links" + body: "link" } additional_bindings { - delete: "/v2/{sink_name=organizations/*/sinks/*}" + post: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + body: "link" } additional_bindings { - delete: "/v2/{sink_name=folders/*/sinks/*}" + post: "/v2/{parent=folders/*/locations/*/buckets/*}/links" + body: "link" } additional_bindings { - delete: "/v2/{sink_name=billingAccounts/*/sinks/*}" + post: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + body: "link" } }; - option (google.api.method_signature) = "sink_name"; + option (google.api.method_signature) = "parent,link,link_id"; + option (google.longrunning.operation_info) = { + response_type: "Link" + metadata_type: "LinkMetadata" + }; } - // Lists all the exclusions on the _Default sink in a parent resource. - rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse) { + // Deletes a link. This will also delete the corresponding BigQuery linked + // dataset. + rpc DeleteLink(DeleteLinkRequest) returns (google.longrunning.Operation) { option (google.api.http) = { - get: "/v2/{parent=*/*}/exclusions" + delete: "/v2/{name=*/*/locations/*/buckets/*/links/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "LinkMetadata" + }; + } + + // Lists links. + rpc ListLinks(ListLinksRequest) returns (ListLinksResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*/buckets/*}/links" additional_bindings { - get: "/v2/{parent=projects/*}/exclusions" + get: "/v2/{parent=projects/*/locations/*/buckets/*}/links" } additional_bindings { - get: "/v2/{parent=organizations/*}/exclusions" + get: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" } additional_bindings { - get: "/v2/{parent=folders/*}/exclusions" + get: "/v2/{parent=folders/*/locations/*/buckets/*}/links" } additional_bindings { - get: "/v2/{parent=billingAccounts/*}/exclusions" + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" } }; option (google.api.method_signature) = "parent"; } - // Gets the description of an exclusion in the _Default sink. - rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { + // Gets a link. + rpc GetLink(GetLinkRequest) returns (Link) { option (google.api.http) = { - get: "/v2/{name=*/*/exclusions/*}" + get: "/v2/{name=*/*/locations/*/buckets/*/links/*}" additional_bindings { - get: "/v2/{name=projects/*/exclusions/*}" + get: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" } additional_bindings { - get: "/v2/{name=organizations/*/exclusions/*}" + get: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" } additional_bindings { - get: "/v2/{name=folders/*/exclusions/*}" + get: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" } additional_bindings { - get: "/v2/{name=billingAccounts/*/exclusions/*}" + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" } }; option (google.api.method_signature) = "name"; } + // Lists all the exclusions on the _Default sink in a parent resource. + rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/exclusions" + additional_bindings { get: "/v2/{parent=projects/*}/exclusions" } + additional_bindings { get: "/v2/{parent=organizations/*}/exclusions" } + additional_bindings { get: "/v2/{parent=folders/*}/exclusions" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/exclusions" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the description of an exclusion in the _Default sink. + rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { + get: "/v2/{name=*/*/exclusions/*}" + additional_bindings { get: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=folders/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=billingAccounts/*/exclusions/*}" } + }; + option (google.api.method_signature) = "name"; + } + // Creates a new exclusion in the _Default sink in a specified parent // resource. Only log entries belonging to that resource can be excluded. You // can have up to 10 exclusions in a resource. @@ -546,15 +651,9 @@ service ConfigServiceV2 { rpc DeleteExclusion(DeleteExclusionRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=*/*/exclusions/*}" - additional_bindings { - delete: "/v2/{name=projects/*/exclusions/*}" - } - additional_bindings { - delete: "/v2/{name=organizations/*/exclusions/*}" - } - additional_bindings { - delete: "/v2/{name=folders/*/exclusions/*}" - } + additional_bindings { delete: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=folders/*/exclusions/*}" } additional_bindings { delete: "/v2/{name=billingAccounts/*/exclusions/*}" } @@ -575,18 +674,10 @@ service ConfigServiceV2 { rpc GetCmekSettings(GetCmekSettingsRequest) returns (CmekSettings) { option (google.api.http) = { get: "/v2/{name=*/*}/cmekSettings" - additional_bindings { - get: "/v2/{name=projects/*}/cmekSettings" - } - additional_bindings { - get: "/v2/{name=organizations/*}/cmekSettings" - } - additional_bindings { - get: "/v2/{name=folders/*}/cmekSettings" - } - additional_bindings { - get: "/v2/{name=billingAccounts/*}/cmekSettings" - } + additional_bindings { get: "/v2/{name=projects/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=organizations/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=folders/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=billingAccounts/*}/cmekSettings" } }; } @@ -629,18 +720,10 @@ service ConfigServiceV2 { rpc GetSettings(GetSettingsRequest) returns (Settings) { option (google.api.http) = { get: "/v2/{name=*/*}/settings" - additional_bindings { - get: "/v2/{name=projects/*}/settings" - } - additional_bindings { - get: "/v2/{name=organizations/*}/settings" - } - additional_bindings { - get: "/v2/{name=folders/*}/settings" - } - additional_bindings { - get: "/v2/{name=billingAccounts/*}/settings" - } + additional_bindings { get: "/v2/{name=projects/*}/settings" } + additional_bindings { get: "/v2/{name=organizations/*}/settings" } + additional_bindings { get: "/v2/{name=folders/*}/settings" } + additional_bindings { get: "/v2/{name=billingAccounts/*}/settings" } }; option (google.api.method_signature) = "name"; } @@ -678,7 +761,8 @@ service ConfigServiceV2 { } // Copies a set of log entries from a log bucket to a Cloud Storage bucket. - rpc CopyLogEntries(CopyLogEntriesRequest) returns (google.longrunning.Operation) { + rpc CopyLogEntries(CopyLogEntriesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2/entries:copy" body: "*" @@ -690,6 +774,29 @@ service ConfigServiceV2 { } } +// Configuration for an indexed field. +message IndexConfig { + // Required. The LogEntry field path to index. + // + // Note that some paths are automatically indexed, and other paths are not + // eligible for indexing. See [indexing documentation]( + // https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + // for details. + // + // For example: `jsonPayload.request.status` + string field_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of data in this index. + IndexType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the index was last modified. + // + // This is used to return the timestamp, and will be ignored if supplied + // during update. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Describes a repository in which log entries are stored. message LogBucket { option (google.api.resource) = { @@ -718,12 +825,14 @@ message LogBucket { // Describes this bucket. string description = 3; - // Output only. The creation timestamp of the bucket. This is not set for any of the - // default buckets. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The creation timestamp of the bucket. This is not set for any + // of the default buckets. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the bucket. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Logs will be retained by default for this amount of time, after which they // will automatically be deleted. The minimum retention period is 1 day. If @@ -738,7 +847,13 @@ message LogBucket { bool locked = 9; // Output only. The bucket lifecycle state. - LifecycleState lifecycle_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + LifecycleState lifecycle_state = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether log analytics is enabled for this bucket. + // + // Once enabled, log analytics features cannot be disabled. + bool analytics_enabled = 14; // Log entry field paths that are denied access in this bucket. // @@ -749,6 +864,9 @@ message LogBucket { // block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) repeated string restricted_fields = 15; + // A list of indexed fields and related configuration data. + repeated IndexConfig index_configs = 17; + // The CMEK settings of the log bucket. If present, new log entries written to // this log bucket are encrypted using the CMEK key provided in this // configuration. If a log bucket has CMEK settings, the CMEK settings cannot @@ -778,10 +896,12 @@ message LogView { string description = 3; // Output only. The creation timestamp of the view. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the view. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Filter that restricts which log entries in a bucket are visible in this // view. @@ -847,9 +967,7 @@ message LogSink { // Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). string destination = 3 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // Optional. An [advanced logs @@ -867,22 +985,25 @@ message LogSink { // The maximum length of the description is 8000 characters. string description = 18 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If set to true, then this sink is disabled and it does not export any log - // entries. + // Optional. If set to true, then this sink is disabled and it does not export + // any log entries. bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Log entries that match any of these exclusion filters will not be exported. + // Optional. Log entries that match any of these exclusion filters will not be + // exported. // // If a log entry is matched by both `filter` and one of `exclusion_filters` // it will not be exported. - repeated LogExclusion exclusions = 16 [(google.api.field_behavior) = OPTIONAL]; + repeated LogExclusion exclusions = 16 + [(google.api.field_behavior) = OPTIONAL]; // Deprecated. This field is unused. VersionFormat output_version_format = 6 [deprecated = true]; - // Output only. An IAM identity—a service account or group—under which Cloud - // Logging writes the exported log entries to the sink's destination. This - // field is set by + // Output only. An IAM identity—a service account or group—under + // which Cloud Logging writes the exported log entries to the sink's + // destination. This field is either set by specifying + // `custom_writer_identity` or set automatically by // [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and // [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the // value of `unique_writer_identity` in those methods. @@ -895,17 +1016,17 @@ message LogSink { // appropriate IAM roles to assign to the identity. // // Sinks that have a destination that is a log bucket in the same project as - // the sink do not have a writer_identity and no additional permissions are + // the sink cannot have a writer_identity and no additional permissions are // required. string writer_identity = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. This field applies only to sinks owned by organizations and folders. If the - // field is false, the default, only the logs owned by the sink's parent - // resource are available for export. If the field is true, then log entries - // from all the projects, folders, and billing accounts contained in the - // sink's parent resource are also available for export. Whether a particular - // log entry from the children is exported depends on the sink's filter - // expression. + // Optional. This field applies only to sinks owned by organizations and + // folders. If the field is false, the default, only the logs owned by the + // sink's parent resource are available for export. If the field is true, then + // log entries from all the projects, folders, and billing accounts contained + // in the sink's parent resource are also available for export. Whether a + // particular log entry from the children is exported depends on the sink's + // filter expression. // // For example, if this field is true, then the filter // `resource.type=gce_instance` would export all Compute Engine VM instance @@ -921,18 +1042,77 @@ message LogSink { // Destination dependent options. oneof options { // Optional. Options that affect sinks exporting data to BigQuery. - BigQueryOptions bigquery_options = 12 [(google.api.field_behavior) = OPTIONAL]; + BigQueryOptions bigquery_options = 12 + [(google.api.field_behavior) = OPTIONAL]; } // Output only. The creation timestamp of the sink. // // This field may not be present for older sinks. - google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the sink. // // This field may not be present for older sinks. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a BigQuery dataset that was created by a link. +message BigQueryDataset { + // Output only. The full resource name of the BigQuery dataset. The DATASET_ID + // will match the ID of the link, so the link must match the naming + // restrictions of BigQuery datasets (alphanumeric characters and underscores + // only). + // + // The dataset will have a resource path of + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + string dataset_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a link connected to an analytics enabled bucket. +message Link { + option (google.api.resource) = { + type: "logging.googleapis.com/Link" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}" + }; + + // The resource name of the link. The name can have up to 100 characters. + // A valid link id (at the end of the link name) must only have alphanumeric + // characters and underscores within it. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/links/my_link + string name = 1; + + // Describes this link. + // + // The maximum length of the description is 8000 characters. + string description = 2; + + // Output only. The creation timestamp of the link. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource lifecycle state. + LifecycleState lifecycle_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The information of a BigQuery Dataset. When a link is created, a BigQuery + // dataset is created along with it, in the same project as the LogBucket it's + // linked to. This dataset will also have BigQuery Views corresponding to the + // LogViews in the bucket. + BigQueryDataset bigquery_dataset = 5; } // Options that change functionality of a sink exporting data to BigQuery. @@ -947,14 +1127,15 @@ message BigQueryOptions { // timezone. bool use_partitioned_tables = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. True if new timestamp column based partitioning is in use, false if legacy - // ingestion-time partitioning is in use. + // Output only. True if new timestamp column based partitioning is in use, + // false if legacy ingestion-time partitioning is in use. // // All new sinks will have this field set true and will use timestamp column // based partitioning. If use_partitioned_tables is false, this value has no // meaning and will be false. Legacy sinks using partitioned tables will have // this field set to false. - bool uses_timestamp_column_partitioning = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + bool uses_timestamp_column_partitioning = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // The parameters to `ListBuckets`. @@ -976,15 +1157,15 @@ message ListBucketsRequest { } ]; - // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `pageToken` must be the value of `nextPageToken` from the - // previous response. The values of other method parameters should be - // identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of results to return from this request. Non-positive - // values are ignored. The presence of `nextPageToken` in the response - // indicates that more results might be available. + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -1015,14 +1196,14 @@ message CreateBucketRequest { } ]; - // Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - // to 100 characters and can include only letters, digits, underscores, - // hyphens, and periods. + // Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + // are limited to 100 characters and can include only letters, digits, + // underscores, hyphens, and periods. string bucket_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The new bucket. The region specified in the new bucket must be compliant - // with any Location Restriction Org Policy. The name field in the bucket is - // ignored. + // Required. The new bucket. The region specified in the new bucket must be + // compliant with any Location Restriction Org Policy. The name field in the + // bucket is ignored. LogBucket bucket = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -1048,15 +1229,16 @@ message UpdateBucketRequest { // Required. The updated bucket. LogBucket bucket = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Field mask that specifies the fields in `bucket` that need an update. A - // bucket field will be overwritten if, and only if, it is in the update mask. - // `name` and output only fields cannot be updated. + // Required. Field mask that specifies the fields in `bucket` that need an + // update. A bucket field will be overwritten if, and only if, it is in the + // update mask. `name` and output only fields cannot be updated. // // For a detailed `FieldMask` definition, see: // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // // For example: `updateMask=retention_days` - google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = REQUIRED]; } // The parameters to `GetBucket`. @@ -1126,10 +1308,10 @@ message ListViewsRequest { // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" string parent = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `pageToken` must be the value of `nextPageToken` from the - // previous response. The values of other method parameters should be - // identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. @@ -1161,7 +1343,9 @@ message CreateViewRequest { // `"projects/my-project/locations/global/buckets/my-bucket"` string parent = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The id to use for this view. + // Required. A client-assigned identifier such as `"my-view"`. Identifiers are + // limited to 100 characters and can include only letters, digits, + // underscores, hyphens, and periods. string view_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The new view. @@ -1190,7 +1374,8 @@ message UpdateViewRequest { // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // // For example: `updateMask=filter` - google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; } // The parameters to `GetView`. @@ -1204,9 +1389,7 @@ message GetViewRequest { // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "logging.googleapis.com/LogView" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/LogView" } ]; } @@ -1221,9 +1404,7 @@ message DeleteViewRequest { // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "logging.googleapis.com/LogView" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/LogView" } ]; } @@ -1279,9 +1460,7 @@ message GetSinkRequest { // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "logging.googleapis.com/LogSink" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } ]; } @@ -1319,14 +1498,15 @@ message CreateSinkRequest { // If this field is set to true, or if the sink is owned by a non-project // resource such as an organization, then the value of `writer_identity` will // be a unique service account used only for exports from the new sink. For - // more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + // more information, see `writer_identity` in + // [LogSink][google.logging.v2.LogSink]. bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; } // The parameters to `UpdateSink`. message UpdateSinkRequest { - // Required. The full resource name of the sink to update, including the parent - // resource and the sink identifier: + // Required. The full resource name of the sink to update, including the + // parent resource and the sink identifier: // // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -1338,13 +1518,11 @@ message UpdateSinkRequest { // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "logging.googleapis.com/LogSink" - } + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } ]; - // Required. The updated sink, whose name is the same identifier that appears as part - // of `sink_name`. + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sink_name`. LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] @@ -1376,13 +1554,14 @@ message UpdateSinkRequest { // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // // For example: `updateMask=filter` - google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; } // The parameters to `DeleteSink`. message DeleteSinkRequest { - // Required. The full resource name of the sink to delete, including the parent - // resource and the sink identifier: + // Required. The full resource name of the sink to delete, including the + // parent resource and the sink identifier: // // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -1393,11 +1572,96 @@ message DeleteSinkRequest { // // `"projects/my-project/sinks/my-sink"` string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; +} + +// The parameters to CreateLink. +message CreateLinkRequest { + // Required. The full resource name of the bucket to create a link for. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/LogSink" + child_type: "logging.googleapis.com/Link" } ]; + + // Required. The new link. + Link link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the link. The link_id can have up to 100 + // characters. A valid link_id must only have alphanumeric characters and + // underscores within it. + string link_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to DeleteLink. +message DeleteLinkRequest { + // Required. The full resource name of the link to delete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; +} + +// The parameters to ListLinks. +message ListLinksRequest { + // Required. The parent resource whose links are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Link" + } + ]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListLinks. +message ListLinksResponse { + // A list of links. + repeated Link links = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLink. +message GetLinkRequest { + // Required. The resource name of the link: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; } // Specifies a set of log entries that are filtered out by a sink. If @@ -1414,10 +1678,10 @@ message LogExclusion { pattern: "billingAccounts/{billing_account}/exclusions/{exclusion}" }; - // Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - // Identifiers are limited to 100 characters and can include only letters, - // digits, underscores, hyphens, and periods. First character has to be - // alphanumeric. + // Required. A client-assigned identifier, such as + // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + // can include only letters, digits, underscores, hyphens, and periods. First + // character has to be alphanumeric. string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A description of this exclusion. @@ -1444,12 +1708,14 @@ message LogExclusion { // Output only. The creation timestamp of the exclusion. // // This field may not be present for older exclusions. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the exclusion. // // This field may not be present for older exclusions. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // The parameters to `ListExclusions`. @@ -1554,18 +1820,20 @@ message UpdateExclusionRequest { } ]; - // Required. New values for the existing exclusion. Only the fields specified in - // `update_mask` are relevant. + // Required. New values for the existing exclusion. Only the fields specified + // in `update_mask` are relevant. LogExclusion exclusion = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. A non-empty list of fields to change in the existing exclusion. New values - // for the fields are taken from the corresponding fields in the - // [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - // `update_mask` are not changed and are ignored in the request. + // Required. A non-empty list of fields to change in the existing exclusion. + // New values for the fields are taken from the corresponding fields in the + // [LogExclusion][google.logging.v2.LogExclusion] included in this request. + // Fields not mentioned in `update_mask` are not changed and are ignored in + // the request. // // For example, to change the filter and description of an exclusion, // specify an `update_mask` of `"filter,description"`. - google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = REQUIRED]; } // The parameters to `DeleteExclusion`. @@ -1655,7 +1923,8 @@ message UpdateCmekSettingsRequest { // See [FieldMask][google.protobuf.FieldMask] for more information. // // For example: `"updateMask=kmsKeyName"` - google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Describes the customer-managed encryption key (CMEK) settings associated with @@ -1710,8 +1979,27 @@ message CmekSettings { // for more information. string kms_key_name = 2; - // Output only. The service account that will be used by the Log Router to access your - // Cloud KMS key. + // The CryptoKeyVersion resource name for the configured Cloud KMS key. + // + // KMS key name format: + // + // "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + // + // For example: + // + // `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + // + // This is a read-only field used to convey the specific configured + // CryptoKeyVersion of `kms_key` that has been configured. It will be + // populated in cases where the CMEK settings are bound to a single key + // version. + // + // If this field is populated, the `kms_key` is tied to a specific + // CryptoKeyVersion. + string kms_key_version_name = 4; + + // Output only. The service account that will be used by the Log Router to + // access your Cloud KMS key. // // Before enabling CMEK for Log Router, you must first assign the // cloudkms.cryptoKeyEncrypterDecrypter role to the service account that @@ -1789,7 +2077,8 @@ message UpdateSettingsRequest { // See [FieldMask][google.protobuf.FieldMask] for more information. // // For example: `"updateMask=kmsKeyName"` - google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Describes the settings associated with a project, folder, organization, @@ -1835,8 +2124,8 @@ message Settings { // for more information. string kms_key_name = 2 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The service account that will be used by the Log Router to access your - // Cloud KMS key. + // Output only. The service account that will be used by the Log Router to + // access your Cloud KMS key. // // Before enabling CMEK for Log Router, you must first assign the role // `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that @@ -1849,15 +2138,15 @@ message Settings { // for more information. string kms_service_account_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. The Cloud region that will be used for _Default and _Required log buckets - // for newly created projects and folders. For example `europe-west1`. + // Optional. The Cloud region that will be used for _Default and _Required log + // buckets for newly created projects and folders. For example `europe-west1`. // This setting does not affect the location of custom log buckets. string storage_location = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If set to true, the _Default sink in newly created projects and folders - // will created in a disabled state. This can be used to automatically disable - // log ingestion if there is already an aggregated sink configured in the - // hierarchy. The _Default sink can be re-enabled manually if needed. + // Optional. If set to true, the _Default sink in newly created projects and + // folders will created in a disabled state. This can be used to automatically + // disable log ingestion if there is already an aggregated sink configured in + // the hierarchy. The _Default sink can be re-enabled manually if needed. bool disable_default_sink = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -1870,8 +2159,8 @@ message CopyLogEntriesRequest { // `"projects/my-project/locations/global/buckets/my-source-bucket"` string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. A filter specifying which log entries to copy. The filter must be no more - // than 20k characters. An empty filter matches all log entries. + // Optional. A filter specifying which log entries to copy. The filter must be + // no more than 20k characters. An empty filter matches all log entries. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // Required. Destination to which to copy log entries. @@ -1914,18 +2203,44 @@ message CopyLogEntriesResponse { int64 log_entries_copied_count = 1; } -// LogBucket lifecycle states. -enum LifecycleState { - // Unspecified state. This is only used/useful for distinguishing unset - // values. - LIFECYCLE_STATE_UNSPECIFIED = 0; +// Metadata for LongRunningUpdateBucket Operations. +message BucketMetadata { + // The create time of an operation. + google.protobuf.Timestamp start_time = 1; - // The normal and active state. - ACTIVE = 1; + // The end time of an operation. + google.protobuf.Timestamp end_time = 2; - // The resource has been marked for deletion by the user. For some resources - // (e.g. buckets), this can be reversed by an un-delete operation. - DELETE_REQUESTED = 2; + // State of an operation. + OperationState state = 3; + + oneof request { + // LongRunningCreateBucket RPC request. + CreateBucketRequest create_bucket_request = 4; + + // LongRunningUpdateBucket RPC request. + UpdateBucketRequest update_bucket_request = 5; + } +} + +// Metadata for long running Link operations. +message LinkMetadata { + // The start time of an operation. + google.protobuf.Timestamp start_time = 1; + + // The end time of an operation. + google.protobuf.Timestamp end_time = 2; + + // State of an operation. + OperationState state = 3; + + oneof request { + // CreateLink RPC request. + CreateLinkRequest create_link_request = 4; + + // DeleteLink RPC request. + DeleteLinkRequest delete_link_request = 5; + } } // List of different operation states. @@ -1955,3 +2270,48 @@ enum OperationState { // The operation was cancelled by the user. OPERATION_STATE_CANCELLED = 6; } + +// LogBucket lifecycle states. +enum LifecycleState { + // Unspecified state. This is only used/useful for distinguishing unset + // values. + LIFECYCLE_STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The resource has been marked for deletion by the user. For some resources + // (e.g. buckets), this can be reversed by an un-delete operation. + DELETE_REQUESTED = 2; + + // The resource has been marked for an update by the user. It will remain in + // this state until the update is complete. + UPDATING = 3; + + // The resource has been marked for creation by the user. It will remain in + // this state until the creation is complete. + CREATING = 4; + + // The resource is in an INTERNAL error state. + FAILED = 5; +} + +// IndexType is used for custom indexing. It describes the type of an indexed +// field. +enum IndexType { + // The index's type is unspecified. + INDEX_TYPE_UNSPECIFIED = 0; + + // The index is a string-type index. + INDEX_TYPE_STRING = 1; + + // The index is a integer-type index. + INDEX_TYPE_INTEGER = 2; +} + +// Cloud Logging specific location metadata. +message LocationMetadata { + // Indicates whether or not Log Analytics features are supported in the given + // location. + bool log_analytics_enabled = 1; +} diff --git a/google/logging/v2/logging_metrics.proto b/google/logging/v2/logging_metrics.proto index 2952c875f..852ba14ce 100644 --- a/google/logging/v2/logging_metrics.proto +++ b/google/logging/v2/logging_metrics.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -137,6 +137,17 @@ message LogMetric { // The maximum length of the filter is 20000 characters. string filter = 3 [(google.api.field_behavior) = REQUIRED]; + // Optional. The resource name of the Log Bucket that owns the Log Metric. + // Only Log Buckets in projects are supported. The bucket has to be in the + // same project as the metric. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket` + // + // If empty, then the Log Metric is considered a non-Bucket Log Metric. + string bucket_name = 13 [(google.api.field_behavior) = OPTIONAL]; + // Optional. If set to True, then this metric is disabled and it does not // generate any points. bool disabled = 12 [(google.api.field_behavior) = OPTIONAL]; @@ -162,12 +173,14 @@ message LogMetric { // be updated once initially configured. New labels can be added in the // `metric_descriptor`, but existing labels cannot be modified except for // their description. - google.api.MetricDescriptor metric_descriptor = 5 [(google.api.field_behavior) = OPTIONAL]; + google.api.MetricDescriptor metric_descriptor = 5 + [(google.api.field_behavior) = OPTIONAL]; // Optional. A `value_extractor` is required when using a distribution // logs-based metric to extract the values to record from a log entry. // Two functions are supported for value extraction: `EXTRACT(field)` or - // `REGEXP_EXTRACT(field, regex)`. The argument are: + // `REGEXP_EXTRACT(field, regex)`. The arguments are: + // // 1. field: The name of the log entry field from which the value is to be // extracted. // 2. regex: A regular expression using the Google RE2 syntax @@ -192,29 +205,33 @@ message LogMetric { // is the same as for the `value_extractor` field. // // The extracted value is converted to the type defined in the label - // descriptor. If the either the extraction or the type conversion fails, + // descriptor. If either the extraction or the type conversion fails, // the label will have a default value. The default value for a string // label is an empty string, for an integer label its 0, and for a boolean // label its `false`. // // Note that there are upper bounds on the maximum number of labels and the // number of active time series that are allowed in a project. - map label_extractors = 7 [(google.api.field_behavior) = OPTIONAL]; + map label_extractors = 7 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The `bucket_options` are required when the logs-based metric is // using a DISTRIBUTION value type and it describes the bucket boundaries // used to create a histogram of the extracted values. - google.api.Distribution.BucketOptions bucket_options = 8 [(google.api.field_behavior) = OPTIONAL]; + google.api.Distribution.BucketOptions bucket_options = 8 + [(google.api.field_behavior) = OPTIONAL]; // Output only. The creation timestamp of the metric. // // This field may not be present for older metrics. - google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the metric. // // This field may not be present for older metrics. - google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Deprecated. The API version that created or updated this metric. // The v2 format is used by default and cannot be changed. diff --git a/google/logging/v2/logging_v2.yaml b/google/logging/v2/logging_v2.yaml index da2afcc09..6e217e9c6 100644 --- a/google/logging/v2/logging_v2.yaml +++ b/google/logging/v2/logging_v2.yaml @@ -7,10 +7,14 @@ apis: - name: google.logging.v2.ConfigServiceV2 - name: google.logging.v2.LoggingServiceV2 - name: google.logging.v2.MetricsServiceV2 +- name: google.longrunning.Operations types: +- name: google.logging.v2.BucketMetadata - name: google.logging.v2.CopyLogEntriesMetadata - name: google.logging.v2.CopyLogEntriesResponse +- name: google.logging.v2.LinkMetadata +- name: google.logging.v2.LocationMetadata documentation: summary: Writes log entries and manages your Cloud Logging configuration. @@ -58,7 +62,7 @@ http: - get: '/v2/{name=projects/*/locations/*/operations/*}' - get: '/v2/{name=organizations/*/locations/*/operations/*}' - get: '/v2/{name=folders/*/locations/*/operations/*}' - - get: '/v2/{name=billingAccounts/*/operations/*}' + - get: '/v2/{name=billingAccounts/*/locations/*/operations/*}' - selector: google.longrunning.Operations.ListOperations get: '/v2/{name=*/*/locations/*}/operations' additional_bindings: @@ -95,6 +99,13 @@ authentication: https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.read + - selector: google.logging.v2.ConfigServiceV2.GetLink + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/cloud-platform.read-only, + https://www.googleapis.com/auth/logging.admin, + https://www.googleapis.com/auth/logging.read - selector: google.logging.v2.ConfigServiceV2.GetSettings oauth: canonical_scopes: |- @@ -130,6 +141,13 @@ authentication: https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.read + - selector: google.logging.v2.ConfigServiceV2.ListLinks + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/cloud-platform.read-only, + https://www.googleapis.com/auth/logging.admin, + https://www.googleapis.com/auth/logging.read - selector: google.logging.v2.ConfigServiceV2.ListSinks oauth: canonical_scopes: |- @@ -201,3 +219,6 @@ authentication: https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.read + +publishing: + documentation_uri: https://cloud.google.com/logging/docs/