From 8f488efd7bda33885cb674ddd023b3678c40bd82 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Fri, 6 Mar 2020 09:13:30 -0800 Subject: [PATCH] feat: Migrate logging to GAPIC v2; release new features. IMPORTANT: This is a breaking change for client libraries in all languages. Committer: @lukesneeringer, @jskeet PiperOrigin-RevId: 299370279 --- google/logging/artman_logging.yaml | 4 +- google/logging/logging.yaml | 100 ---- google/logging/type/BUILD.bazel | 161 ++++-- google/logging/v2/BUILD.bazel | 308 +++++++++-- google/logging/v2/log_entry.proto | 93 ++-- google/logging/v2/logging.proto | 64 ++- google/logging/v2/logging.yaml | 14 + google/logging/v2/logging_config.proto | 386 ++++++++++--- google/logging/v2/logging_gapic.legacy.yaml | 572 ++++++++++++++++++++ google/logging/v2/logging_gapic.yaml | 554 +------------------ google/logging/v2/logging_metrics.proto | 36 +- 11 files changed, 1369 insertions(+), 923 deletions(-) delete mode 100644 google/logging/logging.yaml create mode 100644 google/logging/v2/logging_gapic.legacy.yaml diff --git a/google/logging/artman_logging.yaml b/google/logging/artman_logging.yaml index e7b6bfe3..78a26ab3 100644 --- a/google/logging/artman_logging.yaml +++ b/google/logging/artman_logging.yaml @@ -9,6 +9,7 @@ common: - v2 service_yaml: v2/logging.yaml gapic_yaml: v2/logging_gapic.yaml + proto_package: google.logging.v2 artifacts: - name: gapic_config type: GAPIC_CONFIG @@ -30,6 +31,3 @@ artifacts: - name: ruby_gapic type: GAPIC language: RUBY -- name: csharp_gapic - type: GAPIC - language: CSHARP diff --git a/google/logging/logging.yaml b/google/logging/logging.yaml deleted file mode 100644 index d84a57a8..00000000 --- a/google/logging/logging.yaml +++ /dev/null @@ -1,100 +0,0 @@ -type: google.api.Service -config_version: 3 -name: logging.googleapis.com -title: Stackdriver Logging API - -apis: -- name: google.logging.v2.LoggingServiceV2 -- name: google.logging.v2.ConfigServiceV2 -- name: google.logging.v2.MetricsServiceV2 - -documentation: - summary: Writes log entries and manages your Logging configuration. - overview: |- - # Introduction - - The Stackdriver Logging service. - -backend: - rules: - - selector: google.logging.v2.LoggingServiceV2.DeleteLog - deadline: 60.0 - - selector: google.logging.v2.LoggingServiceV2.WriteLogEntries - deadline: 60.0 - - selector: google.logging.v2.LoggingServiceV2.ListLogEntries - deadline: 10.0 - - selector: google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptors - deadline: 60.0 - - selector: google.logging.v2.LoggingServiceV2.ListLogs - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.ListSinks - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.GetSink - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.CreateSink - deadline: 120.0 - - selector: google.logging.v2.ConfigServiceV2.UpdateSink - deadline: 120.0 - - selector: google.logging.v2.ConfigServiceV2.DeleteSink - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.ListExclusions - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.GetExclusion - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.CreateExclusion - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.UpdateExclusion - deadline: 60.0 - - selector: google.logging.v2.ConfigServiceV2.DeleteExclusion - deadline: 60.0 - - selector: google.logging.v2.MetricsServiceV2.ListLogMetrics - deadline: 60.0 - - selector: google.logging.v2.MetricsServiceV2.GetLogMetric - deadline: 60.0 - - selector: google.logging.v2.MetricsServiceV2.CreateLogMetric - deadline: 60.0 - - selector: google.logging.v2.MetricsServiceV2.UpdateLogMetric - deadline: 60.0 - - selector: google.logging.v2.MetricsServiceV2.DeleteLogMetric - deadline: 60.0 - -authentication: - rules: - - selector: '*' - 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.CreateExclusion, - google.logging.v2.ConfigServiceV2.CreateSink, - google.logging.v2.ConfigServiceV2.DeleteExclusion, - google.logging.v2.ConfigServiceV2.DeleteSink, - google.logging.v2.ConfigServiceV2.UpdateExclusion, - google.logging.v2.ConfigServiceV2.UpdateSink - oauth: - canonical_scopes: |- - https://www.googleapis.com/auth/cloud-platform, - https://www.googleapis.com/auth/logging.admin - - selector: |- - google.logging.v2.MetricsServiceV2.CreateLogMetric, - google.logging.v2.MetricsServiceV2.DeleteLogMetric, - google.logging.v2.MetricsServiceV2.UpdateLogMetric - oauth: - canonical_scopes: |- - https://www.googleapis.com/auth/cloud-platform, - https://www.googleapis.com/auth/logging.admin, - https://www.googleapis.com/auth/logging.write - - selector: google.logging.v2.LoggingServiceV2.DeleteLog - oauth: - canonical_scopes: |- - https://www.googleapis.com/auth/cloud-platform, - https://www.googleapis.com/auth/logging.admin - - selector: google.logging.v2.LoggingServiceV2.WriteLogEntries - oauth: - canonical_scopes: |- - https://www.googleapis.com/auth/cloud-platform, - https://www.googleapis.com/auth/logging.admin, - https://www.googleapis.com/auth/logging.write diff --git a/google/logging/type/BUILD.bazel b/google/logging/type/BUILD.bazel index 6629ac30..9bfcc10c 100644 --- a/google/logging/type/BUILD.bazel +++ b/google/logging/type/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") +# This file was automatically generated by BuildFileGenerator # This is an API workspace, having public visibility by default makes perfect sense. package(default_visibility = ["//visibility:public"]) @@ -6,61 +6,160 @@ package(default_visibility = ["//visibility:public"]) ############################################################################## # Common ############################################################################## -load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") +load("@rules_proto//proto:defs.bzl", "proto_library") proto_library( - name = "http_request_proto", - srcs = ["http_request.proto"], + name = "type_proto", + srcs = [ + "http_request.proto", + "log_severity.proto", + ], deps = [ "//google/api:annotations_proto", "@com_google_protobuf//:duration_proto", ], ) -proto_library( - name = "log_severity_proto", - srcs = ["log_severity.proto"], - deps = [ - "//google/api:annotations_proto", - "@com_google_protobuf//:duration_proto", - ], -) - -proto_library_with_info( - name = "type_proto_with_info", - deps = [ - ":http_request_proto", - ":log_severity_proto", - ], -) - ############################################################################## # Java ############################################################################## load( "@com_google_googleapis_imports//:imports.bzl", + "java_grpc_library", "java_proto_library", ) java_proto_library( name = "type_java_proto", - deps = [ - ":http_request_proto", - ":log_severity_proto", - ], + deps = [":type_proto"], +) + +java_grpc_library( + name = "type_java_grpc", + srcs = [":type_proto"], + deps = [":type_java_proto"], ) ############################################################################## # Go ############################################################################## -load("@com_google_googleapis_imports//:imports.bzl", "go_proto_library") +load( + "@com_google_googleapis_imports//:imports.bzl", + "go_proto_library", +) go_proto_library( - name = "ltype_go_proto", + name = "type_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "google.golang.org/genproto/googleapis/logging/type", - protos = [ - ":http_request_proto", - ":log_severity_proto", + protos = [":type_proto"], + deps = [ + "//google/api:annotations_go_proto", ], - deps = ["//google/api:annotations_go_proto"], ) + +############################################################################## +# Python +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "moved_proto_library", + "py_grpc_library", + "py_proto_library", +) + +moved_proto_library( + name = "type_moved_proto", + srcs = [":type_proto"], + deps = [ + "//google/api:annotations_proto", + "@com_google_protobuf//:duration_proto", + ], +) + +py_proto_library( + name = "type_py_proto", + plugin = "@protoc_docs_plugin//:docs_plugin", + deps = [":type_moved_proto"], +) + +py_grpc_library( + name = "type_py_grpc", + srcs = [":type_moved_proto"], + deps = [":type_py_proto"], +) + +############################################################################## +# PHP +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "php_grpc_library", + "php_proto_library", +) + +php_proto_library( + name = "type_php_proto", + deps = [":type_proto"], +) + +php_grpc_library( + name = "type_php_grpc", + srcs = [":type_proto"], + deps = [":type_php_proto"], +) + +############################################################################## +# Node.js +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + + +############################################################################## +# Ruby +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_grpc_library", + "ruby_proto_library", +) + +ruby_proto_library( + name = "type_ruby_proto", + deps = [":type_proto"], +) + +ruby_grpc_library( + name = "type_ruby_grpc", + srcs = [":type_proto"], + deps = [":type_ruby_proto"], +) + +############################################################################## +# C# +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "csharp_grpc_library", + "csharp_proto_library", +) + +csharp_proto_library( + name = "type_csharp_proto", + deps = [":type_proto"], +) + +csharp_grpc_library( + name = "type_csharp_grpc", + srcs = [":type_proto"], + deps = [":type_csharp_proto"], +) + +############################################################################## +# C++ +############################################################################## +# Put your C++ code here diff --git a/google/logging/v2/BUILD.bazel b/google/logging/v2/BUILD.bazel index 90fd4aa9..763430e5 100644 --- a/google/logging/v2/BUILD.bazel +++ b/google/logging/v2/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") +# This file was automatically generated by BuildFileGenerator # This is an API workspace, having public visibility by default makes perfect sense. package(default_visibility = ["//visibility:public"]) @@ -6,13 +6,9 @@ package(default_visibility = ["//visibility:public"]) ############################################################################## # Common ############################################################################## +load("@rules_proto//proto:defs.bzl", "proto_library") load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") -_PROTO_SUBPACKAGE_DEPS = [ - "//google/logging/type:http_request_proto", - "//google/logging/type:log_severity_proto", -] - proto_library( name = "logging_proto", srcs = [ @@ -23,32 +19,31 @@ proto_library( ], deps = [ "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:distribution_proto", "//google/api:field_behavior_proto", + "//google/api:metric_proto", "//google/api:monitored_resource_proto", "//google/api:resource_proto", - "//google/api:distribution_proto", - "//google/api:metric_proto", + "//google/logging/type:type_proto", "//google/rpc:status_proto", - "//google/api:client_proto", "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:struct_proto", "@com_google_protobuf//:timestamp_proto", - "@com_google_protobuf//:field_mask_proto", - "@com_google_protobuf//:empty_proto", - "@com_google_protobuf//:duration_proto", - ] + _PROTO_SUBPACKAGE_DEPS, + ], ) proto_library_with_info( name = "logging_proto_with_info", deps = [ - "//google/cloud:common_resources_proto", ":logging_proto", - ] + _PROTO_SUBPACKAGE_DEPS, + "//google/cloud:common_resources_proto", + ], ) -"//google/devtools/logging/v1beta1/attestation:_proto" - ############################################################################## # Java ############################################################################## @@ -61,14 +56,6 @@ load( "java_proto_library", ) -_JAVA_PROTO_SUBPACKAGE_DEPS = [ - "//google/logging/type:type_java_proto", -] - -_JAVA_GRPC_SUBPACKAGE_DEPS = [ - # "//google/logging/type:type_java_grpc", -] - java_proto_library( name = "logging_java_proto", deps = [":logging_proto"], @@ -84,20 +71,23 @@ java_gapic_library( name = "logging_java_gapic", src = ":logging_proto_with_info", gapic_yaml = "logging_gapic.yaml", - service_yaml = "//google/logging:logging.yaml", - test_deps = [":logging_java_grpc"] + _JAVA_GRPC_SUBPACKAGE_DEPS, + package = "google.logging.v2", + service_yaml = "logging.yaml", + test_deps = [ + ":logging_java_grpc", + ], deps = [ ":logging_java_proto", "//google/api:api_java_proto", - ] + _JAVA_PROTO_SUBPACKAGE_DEPS, + ], ) java_gapic_test( name = "logging_java_gapic_test_suite", test_classes = [ - "com.google.cloud.logging.v2.LoggingClientTest", - "com.google.cloud.logging.v2.ConfigClientTest", - "com.google.cloud.logging.v2.MetricsClientTest", + "com.google.cloud.logging.v2.ConfigServiceV2ClientTest", + "com.google.cloud.logging.v2.LoggingServiceV2ClientTest", + "com.google.cloud.logging.v2.MetricsServiceV2ClientTest", ], runtime_deps = [":logging_java_gapic_test"], ) @@ -110,7 +100,7 @@ java_gapic_assembly_gradle_pkg( ":logging_java_grpc", ":logging_java_proto", ":logging_proto", - ] + _JAVA_GRPC_SUBPACKAGE_DEPS + _JAVA_PROTO_SUBPACKAGE_DEPS, + ], ) ############################################################################## @@ -134,7 +124,7 @@ go_proto_library( "//google/api:distribution_go_proto", "//google/api:metric_go_proto", "//google/api:monitoredres_go_proto", - "//google/logging/type:ltype_go_proto", + "//google/logging/type:type_go_proto", "//google/rpc:status_go_proto", ], ) @@ -144,10 +134,12 @@ go_gapic_library( src = ":logging_proto_with_info", gapic_yaml = "logging_gapic.yaml", importpath = "cloud.google.com/go/logging/apiv2", - service_yaml = "//google/logging:logging.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", deps = [ - ":logging_go_proto", "//google/api:monitoredres_go_proto", + ":logging_go_proto", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", ], ) @@ -166,28 +158,236 @@ go_gapic_assembly_pkg( ":logging_go_gapic_srcjar-smoke-test.srcjar", ":logging_go_gapic_srcjar-test.srcjar", ":logging_go_proto", - "//google/logging/type:ltype_go_proto", + ], +) + +############################################################################## +# Python +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "moved_proto_library", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_grpc_library", + "py_proto_library", +) + +moved_proto_library( + name = "logging_moved_proto", + srcs = [":logging_proto"], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:distribution_proto", + "//google/api:field_behavior_proto", + "//google/api:metric_proto", + "//google/api:monitored_resource_proto", + "//google/api:resource_proto", + "//google/logging/type:type_proto", + "//google/rpc:status_proto", + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:struct_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +py_proto_library( + name = "logging_py_proto", + plugin = "@protoc_docs_plugin//:docs_plugin", + deps = [":logging_moved_proto"], +) + +py_grpc_library( + name = "logging_py_grpc", + srcs = [":logging_moved_proto"], + deps = [":logging_py_proto"], +) + +py_gapic_library( + name = "logging_py_gapic", + src = ":logging_proto_with_info", + gapic_yaml = "logging_gapic.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", + deps = [ + ":logging_py_grpc", + ":logging_py_proto", + ], +) + +# Open Source Packages +py_gapic_assembly_pkg( + name = "logging-v2-py", + deps = [ + ":logging_py_gapic", + ":logging_py_grpc", + ":logging_py_proto", + ], +) + +############################################################################## +# 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"], +) + +php_grpc_library( + name = "logging_php_grpc", + srcs = [":logging_proto"], + deps = [":logging_php_proto"], +) + +php_gapic_library( + name = "logging_php_gapic", + src = ":logging_proto_with_info", + gapic_yaml = "logging_gapic.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", + deps = [ + ":logging_php_grpc", + ":logging_php_proto", + ], +) + +# Open Source Packages +php_gapic_assembly_pkg( + name = "google-cloud-logging-v2-php", + deps = [ + ":logging_php_gapic", + ":logging_php_grpc", + ":logging_php_proto", + ], +) + +############################################################################## +# Node.js +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + +nodejs_gapic_library( + name = "logging_nodejs_gapic", + src = ":logging_proto_with_info", + gapic_yaml = "logging_gapic.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", + deps = [], +) + +nodejs_gapic_assembly_pkg( + name = "logging-v2-nodejs", + deps = [ + ":logging_nodejs_gapic", + ":logging_proto", + ], +) + +############################################################################## +# Ruby +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_gapic_assembly_pkg", + "ruby_gapic_library", + "ruby_grpc_library", + "ruby_proto_library", +) + +ruby_proto_library( + name = "logging_ruby_proto", + deps = [":logging_proto"], +) + +ruby_grpc_library( + name = "logging_ruby_grpc", + srcs = [":logging_proto"], + deps = [":logging_ruby_proto"], +) + +ruby_gapic_library( + name = "logging_ruby_gapic", + src = ":logging_proto_with_info", + gapic_yaml = "logging_gapic.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", + deps = [ + ":logging_ruby_grpc", + ":logging_ruby_proto", + ], +) + +# Open Source Packages +ruby_gapic_assembly_pkg( + name = "google-cloud-logging-v2-ruby", + deps = [ + ":logging_ruby_gapic", + ":logging_ruby_grpc", + ":logging_ruby_proto", + ], +) + +############################################################################## +# 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"], +) + +csharp_grpc_library( + name = "logging_csharp_grpc", + srcs = [":logging_proto"], + deps = [":logging_csharp_proto"], +) + +csharp_gapic_library( + name = "logging_csharp_gapic", + src = ":logging_proto_with_info", + gapic_yaml = "logging_gapic.yaml", + package = "google.logging.v2", + service_yaml = "logging.yaml", + deps = [ + ":logging_csharp_grpc", + ":logging_csharp_proto", + ], +) + +# Open Source Packages +csharp_gapic_assembly_pkg( + name = "google-cloud-logging-v2-csharp", + deps = [ + ":logging_csharp_gapic", + ":logging_csharp_grpc", + ":logging_csharp_proto", ], ) ############################################################################## # C++ ############################################################################## -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_grpc_library", - "cc_proto_library", -) - -cc_proto_library( - name = "logging_cc_proto", - deps = [":logging_proto"], -) - -cc_grpc_library( - name = "logging_cc_grpc", - srcs = [":logging_proto"], - generate_mocks = True, - grpc_only = True, - deps = [":logging_cc_proto"], -) +# Put your C++ rules here diff --git a/google/logging/v2/log_entry.proto b/google/logging/v2/log_entry.proto index 3f9c3d51..ba8a08ff 100644 --- a/google/logging/v2/log_entry.proto +++ b/google/logging/v2/log_entry.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; import "google/api/resource.proto"; import "google/logging/type/http_request.proto"; @@ -55,9 +56,9 @@ message LogEntry { // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" // "folders/[FOLDER_ID]/logs/[LOG_ID]" // - // A project number may optionally be used in place of PROJECT_ID. The project - // number is translated to its corresponding PROJECT_ID internally and the - // `log_name` field will contain PROJECT_ID in queries and exports. + // A project number may be used in place of PROJECT_ID. The project number is + // translated to its corresponding PROJECT_ID internally and the `log_name` + // field will contain PROJECT_ID in queries and exports. // // `[LOG_ID]` must be URL-encoded within `log_name`. Example: // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. @@ -70,16 +71,16 @@ message LogEntry { // forward-slash is removed. Listing the log entry will not show the leading // slash and filtering for a log name with a leading slash will never return // any results. - string log_name = 12; + string log_name = 12 [(google.api.field_behavior) = REQUIRED]; // Required. The monitored resource that produced this log entry. // // 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.MonitoredResource resource = 8 [(google.api.field_behavior) = REQUIRED]; - // Optional. The log entry payload, which can be one of multiple types. + // The log entry payload, which can be one of multiple types. oneof payload { // The log entry payload, represented as a protocol buffer. Some Google // Cloud Platform services use this field for their log entry payloads. @@ -99,29 +100,27 @@ 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 should have timestamps that are no more than the [logs // retention period](/logging/quotas) in the past, and no more than 24 hours // in the future. Log entries outside those time boundaries will not be // available when calling `entries.list`, but those log entries can still be // [exported with LogSinks](/logging/docs/api/tasks/exporting-logs). - google.protobuf.Timestamp timestamp = 9; + 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.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; + // 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. @@ -131,43 +130,32 @@ message LogEntry { // // In queries, the `insert_id` is also used to order log entries that have // the same `log_name` and `timestamp` values. - string insert_id = 4; + 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; + // 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 set of user-defined (key, value) data that provides additional // information about the log entry. - map labels = 11; - - // Deprecated. Output only. Additional metadata about the monitored resource. - // - // Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have - // this field populated for GKE versions older than 1.12.6. For GKE versions - // 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes - // pod labels that used to be in `metadata.userLabels` will now be present in - // the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system - // labels that were present in the `metadata.systemLabels` field will no - // longer be available in the LogEntry. - google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; + map labels = 11 [(google.api.field_behavior) = OPTIONAL]; // Optional. Information about an operation associated with the log entry, if // applicable. - LogEntryOperation operation = 15; + 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: + // 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` - string trace = 22; + string trace = 22 [(google.api.field_behavior) = OPTIONAL]; // Optional. The span ID within the trace associated with the log entry. // // 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". - string span_id = 27; + // `000000000000004a`. + string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; // Optional. The sampling decision of the trace associated with the log entry. // @@ -176,11 +164,10 @@ message LogEntry { // for storage when this log entry was written, or the sampling decision was // unknown at the time. A non-sampled `trace` value is still useful as a // request correlation identifier. The default is False. - bool trace_sampled = 30; + 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; + // Optional. Source code location information associated with the log entry, if any. + LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL]; } // Additional information about a potentially long-running operation with which @@ -188,18 +175,18 @@ message LogEntry { message LogEntryOperation { // Optional. An arbitrary operation identifier. Log entries with the same // identifier are assumed to be part of the same operation. - string id = 1; + string id = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. An arbitrary producer identifier. The combination of `id` and // `producer` must be globally unique. Examples for `producer`: // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - string producer = 2; + string producer = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Set this to True if this is the first log entry in the operation. - bool first = 3; + bool first = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Set this to True if this is the last log entry in the operation. - bool last = 4; + bool last = 4 [(google.api.field_behavior) = OPTIONAL]; } // Additional information about the source code location that produced the log @@ -207,11 +194,11 @@ message LogEntryOperation { message LogEntrySourceLocation { // Optional. Source file name. Depending on the runtime environment, this // might be a simple name or a fully-qualified name. - string file = 1; + string file = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Line within the source file. 1-based; 0 indicates no line number // available. - int64 line = 2; + int64 line = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Human-readable name of the function or method being invoked, with // optional context such as the class or package name. This information may be @@ -219,5 +206,5 @@ message LogEntrySourceLocation { // less meaningful. The format can vary by language. For example: // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` // (Python). - string function = 3; + string function = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/google/logging/v2/logging.proto b/google/logging/v2/logging.proto index c3a52463..00af178c 100644 --- a/google/logging/v2/logging.proto +++ b/google/logging/v2/logging.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.logging.v2; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; @@ -28,6 +27,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -142,7 +142,7 @@ message DeleteLogRequest { string log_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Log" + type: "logging.googleapis.com/Log" } ]; } @@ -162,13 +162,16 @@ message WriteLogEntriesRequest { // "projects/my-project-id/logs/syslog" // "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" // - // The permission logging.logEntries.create is needed on each - // project, organization, billing account, or folder that is receiving - // new log entries, whether the resource is specified in - // logName or in an individual log entry. - string log_name = 1 [(google.api.resource_reference) = { - type: "logging.googleapis.com/Log" - }]; + // The permission `logging.logEntries.create` is needed on each project, + // organization, billing account, or folder that is receiving new log + // entries, whether the resource is specified in `logName` or in an + // individual log entry. + string log_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "logging.googleapis.com/Log" + } + ]; // Optional. A default monitored resource object that is assigned to all log // entries in `entries` that do not specify a value for `resource`. Example: @@ -178,13 +181,13 @@ message WriteLogEntriesRequest { // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} // // See [LogEntry][google.logging.v2.LogEntry]. - google.api.MonitoredResource resource = 2; + 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 // as a label in this parameter, then the log entry's label is not changed. // See [LogEntry][google.logging.v2.LogEntry]. - map labels = 3; + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; // Required. The log entries to send to Logging. The order of log // entries in this list does not matter. Values supplied in this method's @@ -216,19 +219,16 @@ message WriteLogEntriesRequest { // 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. - bool partial_success = 5; + bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. If true, the request should expect normal response, but the // entries won't be persisted nor exported. Useful for checking whether the // logging API endpoints are working properly before sending valuable data. - bool dry_run = 6; + bool dry_run = 6 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from WriteLogEntries. -// empty -message WriteLogEntriesResponse { - -} +message WriteLogEntriesResponse {} // Error details for WriteLogEntries with partial success. message WriteLogEntriesPartialErrors { @@ -243,11 +243,6 @@ message WriteLogEntriesPartialErrors { // The parameters to `ListLogEntries`. message ListLogEntriesRequest { - // Deprecated. Use `resource_names` instead. One or more project identifiers - // or project numbers from which to retrieve log entries. Example: - // `"my-project-1A"`. - repeated string project_ids = 1 [deprecated = true]; - // Required. Names of one or more parent resources from which to // retrieve log entries: // @@ -272,7 +267,7 @@ message ListLogEntriesRequest { // that is not listed in `resource_names` will cause the filter to return no // results. // The maximum length of the filter is 20000 characters. - string filter = 2; + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. How the results should be sorted. Presently, the only permitted // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first @@ -280,18 +275,18 @@ message ListLogEntriesRequest { // `LogEntry.timestamp` (oldest first), and the second option returns entries // in order of decreasing timestamps (newest first). Entries with equal // timestamps are returned in order of their `insert_id` values. - string order_by = 3; + string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `next_page_token` in the // response indicates that more results might be available. - int32 page_size = 4; + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the // preceding call to this method. `page_token` must be the value of // `next_page_token` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 5; + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from `ListLogEntries`. @@ -319,13 +314,13 @@ message ListMonitoredResourceDescriptorsRequest { // 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 = 1; + int32 page_size = 1 [(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 = 2; + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListMonitoredResourceDescriptors. @@ -347,20 +342,23 @@ message ListLogsRequest { // "organizations/[ORGANIZATION_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]" // "folders/[FOLDER_ID]" - string parent = 1 [(google.api.resource_reference) = { - child_type: "logging.googleapis.com/Log" - }]; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (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; + 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; + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListLogs. diff --git a/google/logging/v2/logging.yaml b/google/logging/v2/logging.yaml index bd64c6ae..5d04a82e 100644 --- a/google/logging/v2/logging.yaml +++ b/google/logging/v2/logging.yaml @@ -37,6 +37,13 @@ authentication: canonical_scopes: |- https://www.googleapis.com/auth/cloud-platform, https://www.googleapis.com/auth/logging.admin + - selector: google.logging.v2.ConfigServiceV2.GetBucket + 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.GetCmekSettings oauth: canonical_scopes: |- @@ -58,6 +65,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.ListBuckets + 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.ListExclusions oauth: canonical_scopes: |- diff --git a/google/logging/v2/logging_config.proto b/google/logging/v2/logging_config.proto index 7fb830de..1062a652 100644 --- a/google/logging/v2/logging_config.proto +++ b/google/logging/v2/logging_config.proto @@ -43,6 +43,79 @@ service ConfigServiceV2 { "https://www.googleapis.com/auth/logging.admin," "https://www.googleapis.com/auth/logging.read"; + // Lists buckets (Beta). + 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=organizations/*/locations/*}/buckets" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*}/buckets" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a bucket (Beta). + 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=organizations/*/locations/*/buckets/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/buckets/*}" + } + }; + } + + // Updates a 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. + // + // If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION + // will be returned. + // + // A buckets region may not be modified after it is created. + // This method is in Beta. + rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket) { + option (google.api.http) = { + patch: "/v2/{name=*/*/locations/*/buckets/*}" + body: "bucket" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + body: "bucket" + } + }; + } + // Lists sinks. rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { option (google.api.http) = { @@ -333,6 +406,48 @@ service ConfigServiceV2 { } } +// Describes a repository of logs (Beta). +message LogBucket { + option (google.api.resource) = { + type: "logging.googleapis.com/LogBucket" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" + }; + + // The resource name of the bucket. + // For example: + // "projects/my-project-id/locations/my-location/buckets/my-bucket-id The + // supported locations are: + // "global" + // "us-central1" + // + // For the location of `global` it is unspecified where logs are actually + // stored. + // Once a bucket has been created, the location can not be changed. + string name = 1; + + // 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 last update timestamp of the bucket. + 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 this value is set to zero at bucket creation time, the default time of + // 30 days will be used. + int32 retention_days = 11; + + // Output only. The bucket lifecycle state. + LifecycleState lifecycle_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Describes a sink used to export log entries to one of the following // destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a // Cloud Pub/Sub topic. A logs filter controls which log entries are exported. @@ -340,7 +455,7 @@ service ConfigServiceV2 { // folder. message LogSink { option (google.api.resource) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" pattern: "projects/{project}/sinks/{sink}" pattern: "organizations/{organization}/sinks/{sink}" pattern: "folders/{folder}/sinks/{sink}" @@ -361,12 +476,12 @@ message LogSink { V1 = 2; } - // Required. The client-assigned sink identifier, unique within the - // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are - // limited to 100 characters and can include only the following characters: - // upper and lower-case alphanumeric characters, underscores, hyphens, and - // periods. First character has to be alphanumeric. - string name = 1; + // Required. The client-assigned sink identifier, unique within the project. Example: + // `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100 + // characters and can include only the following characters: upper and + // lower-case alphanumeric characters, underscores, hyphens, and periods. + // First character has to be alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The export destination: // @@ -378,36 +493,37 @@ message LogSink { // have permission to write to the destination or else the log // entries are not exported. For more information, see // [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). - string destination = 3 [(google.api.resource_reference) = { - type: "*" - }]; + string destination = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "*" + } + ]; // Optional. An [advanced logs filter](/logging/docs/view/advanced-queries). The only // exported log entries are those that are in the resource owning the sink and // that match the filter. For example: // // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR - string filter = 5; + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. A description of this sink. // The maximum length of the description is 8000 characters. - string description = 18; + 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. - bool disabled = 19; + bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; // Deprecated. The log entry format to use for this sink's exported log // entries. The v2 format is used by default and cannot be changed. VersionFormat output_version_format = 6 [deprecated = true]; - // Output only. An IAM identity—a service account or group—under - // which Logging writes the exported log entries to the sink's destination. - // This field is set 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. + // Output only. An IAM identity–a service account or group—under which Logging + // writes the exported log entries to the sink's destination. This field is + // set 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. // // Until you grant this identity write-access to the destination, log entry // exports from this sink will fail. For more information, @@ -430,12 +546,12 @@ message LogSink { // // logName:("projects/test-project1/" OR "projects/test-project2/") AND // resource.type=gce_instance - bool include_children = 9; + bool include_children = 9 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Destination dependent options. + // Destination dependent options. oneof options { // Optional. Options that affect sinks exporting data to BigQuery. - BigQueryOptions bigquery_options = 12; + BigQueryOptions bigquery_options = 12 [(google.api.field_behavior) = OPTIONAL]; } // Output only. The creation timestamp of the sink. @@ -447,12 +563,6 @@ message LogSink { // // This field may not be present for older sinks. google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Do not use. This field is ignored. - google.protobuf.Timestamp start_time = 10 [deprecated = true]; - - // Do not use. This field is ignored. - google.protobuf.Timestamp end_time = 11 [deprecated = true]; } // Options that change functionality of a sink exporting data to BigQuery. @@ -464,7 +574,7 @@ message BigQueryOptions { // present and [special query // syntax](/bigquery/docs/querying-partitioned-tables) has to be used instead. // In both cases, tables are sharded based on UTC timezone. - bool use_partitioned_tables = 1; + 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. @@ -475,6 +585,113 @@ message BigQueryOptions { bool uses_timestamp_column_partitioning = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// LogBucket lifecycle states (Beta). +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 bucket has been marked for deletion by the user. + DELETE_REQUESTED = 2; +} + +// The parameters to `ListBuckets` (Beta). +message ListBucketsRequest { + // Required. The parent resource whose buckets are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + // + // Note: The locations portion of the resource must be specified, but + // supplying the character `-` in place of [LOCATION_ID] will return all + // buckets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + }]; + + // 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. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListBuckets (Beta). +message ListBucketsResponse { + // A list of buckets. + repeated LogBucket buckets = 1; + + // If there might be more results than appear 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 `UpdateBucket` (Beta). +message UpdateBucketRequest { + // Required. The full resource name of the bucket to update. + // + // "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]" + // + // Example: + // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also + // requires permission "resourcemanager.projects.updateLiens" to set the + // locked property + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; + + // 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. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // Example: `updateMask=retention_days`. + google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `GetBucket` (Beta). +message GetBucketRequest { + // Required. The resource name of the bucket: + // + // "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]" + // + // Example: + // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + // The parameters to `ListSinks`. message ListSinksRequest { // Required. The parent resource whose sinks are to be listed: @@ -486,7 +703,7 @@ message ListSinksRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Sink" + child_type: "logging.googleapis.com/LogSink" } ]; @@ -494,12 +711,12 @@ message ListSinksRequest { // 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; + 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. - int32 page_size = 3; + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from `ListSinks`. @@ -526,7 +743,7 @@ message GetSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" } ]; } @@ -544,7 +761,7 @@ message CreateSinkRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Sink" + child_type: "logging.googleapis.com/LogSink" } ]; @@ -563,13 +780,13 @@ message CreateSinkRequest { // 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]. - bool unique_writer_identity = 3; + 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]" @@ -580,12 +797,12 @@ message UpdateSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + 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] @@ -599,7 +816,7 @@ message UpdateSinkRequest { // `writer_identity` is changed to a unique service account. // + It is an error if the old value is true and the new value is // set to false or defaulted to false. - bool unique_writer_identity = 3; + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Field mask that specifies the fields in `sink` that need // an update. A sink field will be overwritten if, and only if, it is @@ -615,13 +832,13 @@ message UpdateSinkRequest { // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // // Example: `updateMask=filter`. - google.protobuf.FieldMask update_mask = 4; + 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]" @@ -632,7 +849,7 @@ message DeleteSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" } ]; } @@ -645,21 +862,21 @@ message DeleteSinkRequest { // apply to child resources, and that you can't exclude audit log entries. message LogExclusion { option (google.api.resource) = { - type: "logging.googleapis.com/Exclusion" + type: "logging.googleapis.com/LogExclusion" pattern: "projects/{project}/exclusions/{exclusion}" pattern: "organizations/{organization}/exclusions/{exclusion}" pattern: "folders/{folder}/exclusions/{exclusion}" 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. - string name = 1; + // 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. - string description = 2; + string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Required. An [advanced logs filter](/logging/docs/view/advanced-queries) // that matches the log entries to be excluded. By using the @@ -669,23 +886,23 @@ message LogExclusion { // entries from Google Cloud Storage buckets: // // `"resource.type=gcs_bucket severity=ERROR" // // The maximum length of the filter is 20000 characters. - string filter = 3; + string filter = 3 [(google.api.field_behavior) = REQUIRED]; // Optional. The metric descriptor associated with the logs-based metric. // If unspecified, it uses a default metric descriptor with a DELTA metric @@ -160,7 +160,7 @@ 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.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. @@ -181,7 +181,7 @@ message LogMetric { // distribution. // // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - string value_extractor = 6; + string value_extractor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. A map from a label key string to an extractor expression which is // used to extract data from a log entry field and assign as the label value. @@ -197,22 +197,22 @@ message LogMetric { // // 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; + 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.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.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.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. @@ -235,12 +235,12 @@ message ListLogMetricsRequest { // 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; + 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. - int32 page_size = 3; + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListLogMetrics. @@ -262,7 +262,7 @@ message GetLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; } @@ -277,7 +277,7 @@ message CreateLogMetricRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + child_type: "logging.googleapis.com/LogMetric" } ]; @@ -298,7 +298,7 @@ message UpdateLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; @@ -314,7 +314,7 @@ message DeleteLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; }