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
This commit is contained in:
Google APIs 2020-03-06 09:13:30 -08:00 committed by Copybara-Service
parent 007605bf9a
commit 8f488efd7b
11 changed files with 1369 additions and 923 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<string, string> 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<string, string> 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
// <code>"000000000000004a"</code>.
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];
}

View File

@ -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 <code>logging.logEntries.create</code> is needed on each
// project, organization, billing account, or folder that is receiving
// new log entries, whether the resource is specified in
// <code>logName</code> 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<string, string> labels = 3;
map<string, string> 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.

View File

@ -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: |-

View File

@ -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&mdash;a service account or group&mdash;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 identitya service account or group&mdash;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 sample(insertId, 0.99)"`
string filter = 3;
string filter = 3 [(google.api.field_behavior) = REQUIRED];
// Optional. If set to True, then this exclusion is disabled and it does not
// exclude any log entries. You can [update an
// exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
// value of this field.
bool disabled = 4;
bool disabled = 4 [(google.api.field_behavior) = OPTIONAL];
// Output only. The creation timestamp of the exclusion.
//
// This field may not be present for older exclusions.
google.protobuf.Timestamp create_time = 5;
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.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The parameters to `ListExclusions`.
@ -699,7 +916,7 @@ message ListExclusionsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "logging.googleapis.com/Exclusion"
child_type: "logging.googleapis.com/LogExclusion"
}
];
@ -707,12 +924,12 @@ message ListExclusionsRequest {
// 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 `ListExclusions`.
@ -739,7 +956,7 @@ message GetExclusionRequest {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "logging.googleapis.com/Exclusion"
type: "logging.googleapis.com/LogExclusion"
}
];
}
@ -757,13 +974,13 @@ message CreateExclusionRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "logging.googleapis.com/Exclusion"
child_type: "logging.googleapis.com/LogExclusion"
}
];
// Required. The new exclusion, whose `name` parameter is an exclusion name
// that is not already used in the parent resource.
LogExclusion exclusion = 2;
LogExclusion exclusion = 2 [(google.api.field_behavior) = REQUIRED];
}
// The parameters to `UpdateExclusion`.
@ -779,16 +996,16 @@ message UpdateExclusionRequest {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "logging.googleapis.com/Exclusion"
type: "logging.googleapis.com/LogExclusion"
}
];
// 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
// 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.
//
@ -810,7 +1027,7 @@ message DeleteExclusionRequest {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "logging.googleapis.com/Exclusion"
type: "logging.googleapis.com/LogExclusion"
}
];
}
@ -833,7 +1050,12 @@ message GetCmekSettingsRequest {
// Note: CMEK for the Logs Router can currently only be configured for GCP
// organizations. Once configured, it applies to all projects and folders in
// the GCP organization.
string name = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "logging.googleapis.com/CmekSettings"
}
];
}
// The parameters to
@ -854,13 +1076,13 @@ message UpdateCmekSettingsRequest {
// Note: CMEK for the Logs Router can currently only be configured for GCP
// organizations. Once configured, it applies to all projects and folders in
// the GCP organization.
string name = 1;
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The CMEK settings to update.
//
// See [Enabling CMEK for Logs
// Router](/logging/docs/routing/managed-encryption) for more information.
CmekSettings cmek_settings = 2;
CmekSettings cmek_settings = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. Field mask identifying which fields from `cmek_settings` should
// be updated. A field will be overwritten if and only if it is in the update
@ -869,7 +1091,7 @@ message UpdateCmekSettingsRequest {
// See [FieldMask][google.protobuf.FieldMask] for more information.
//
// Example: `"updateMask=kmsKeyName"`
google.protobuf.FieldMask update_mask = 3;
google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Describes the customer-managed encryption key (CMEK) settings associated with
@ -882,8 +1104,16 @@ message UpdateCmekSettingsRequest {
// See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption)
// for more information.
message CmekSettings {
// Output Only. The resource name of the CMEK settings.
string name = 1;
option (google.api.resource) = {
type: "logging.googleapis.com/CmekSettings"
pattern: "projects/{project}/cmekSettings"
pattern: "organizations/{organization}/cmekSettings"
pattern: "folders/{folder}/cmekSettings"
pattern: "billingAccounts/{billing_account}/cmekSettings"
};
// Output only. The resource name of the CMEK settings.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The resource name for the configured Cloud KMS key.
//
@ -911,8 +1141,8 @@ message CmekSettings {
// Router](/logging/docs/routing/managed-encryption) for more information.
string kms_key_name = 2;
// Output Only. The service account that will be used by the Logs Router to
// access your Cloud KMS key.
// Output only. The service account that will be used by the Logs Router to access your
// Cloud KMS key.
//
// Before enabling CMEK for Logs Router, you must first assign the role
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
@ -922,5 +1152,5 @@ message CmekSettings {
//
// See [Enabling CMEK for Logs
// Router](/logging/docs/routing/managed-encryption) for more information.
string service_account_id = 3;
string service_account_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

View File

@ -0,0 +1,572 @@
type: com.google.api.codegen.ConfigProto
config_schema_version: 1.0.0
language_settings:
java:
package_name: com.google.cloud.logging.v2
interface_names:
google.logging.v2.ConfigServiceV2: Config
google.logging.v2.LoggingServiceV2: Logging
google.logging.v2.MetricsServiceV2: Metrics
python:
package_name: google.cloud.logging_v2.gapic
go:
package_name: cloud.google.com/go/logging/apiv2
domain_layer_location: cloud.google.com/go/logging
csharp:
package_name: Google.Cloud.Logging.V2
release_level: GA
ruby:
package_name: Google::Cloud::Logging::V2
php:
package_name: Google\Cloud\Logging\V2
nodejs:
package_name: logging.v2
domain_layer_location: google-cloud
collections:
- name_pattern: projects/{project}
entity_name: project
# C#: Already GA, do not use common resource name for 'project'
- name_pattern: "projects/{project}/logs/{log}"
entity_name: log
language_overrides:
- language: java
entity_name: project_log
- name_pattern: "projects/{project}/sinks/{sink}"
entity_name: sink
language_overrides:
- language: java
entity_name: project_sink
- name_pattern: projects/{project}/metrics/{metric}
entity_name: metric
language_overrides:
- language: java
entity_name: project_metric
- name_pattern: "projects/{project}/exclusions/{exclusion}"
entity_name: exclusion
language_overrides:
- language: java
entity_name: project_exclusion
- name_pattern: organizations/{organization}
entity_name: organization
- name_pattern: organizations/{organization}/logs/{log}
entity_name: organization_log
- name_pattern: organizations/{organization}/sinks/{sink}
entity_name: organization_sink
- name_pattern: organizations/{organization}/exclusions/{exclusion}
entity_name: organization_exclusion
- name_pattern: folders/{folder}
entity_name: folder
- name_pattern: folders/{folder}/logs/{log}
entity_name: folder_log
- name_pattern: folders/{folder}/sinks/{sink}
entity_name: folder_sink
- name_pattern: folders/{folder}/exclusions/{exclusion}
entity_name: folder_exclusion
- name_pattern: billingAccounts/{billing_account}
entity_name: billing
- name_pattern: billingAccounts/{billing_account}/logs/{log}
entity_name: billing_log
- name_pattern: billingAccounts/{billing_account}/sinks/{sink}
entity_name: billing_sink
- name_pattern: billingAccounts/{billing_account}/exclusions/{exclusion}
entity_name: billing_exclusion
collection_oneofs:
- oneof_name: parent_oneof
collection_names:
- project
- organization
- folder
- billing
- oneof_name: sink_oneof
collection_names:
- sink
- organization_sink
- folder_sink
- billing_sink
- oneof_name: exclusion_oneof
collection_names:
- exclusion
- organization_exclusion
- folder_exclusion
- billing_exclusion
- oneof_name: log_oneof
collection_names:
- log
- organization_log
- folder_log
- billing_log
- oneof_name: metric_oneof
collection_names:
- metric
interfaces:
- name: google.logging.v2.ConfigServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
- name: write_sink
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: ListSinks
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: sinks
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetSink
flattening:
groups:
- parameters:
- sink_name
required_fields:
- sink_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateSink
flattening:
groups:
- parameters:
- parent
- sink
required_fields:
- parent
- sink
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 120000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateSink
flattening:
groups:
- parameters:
- sink_name
- sink
- update_mask
- parameters:
- sink_name
- sink
required_fields:
- sink_name
- sink
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 120000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteSink
flattening:
groups:
- parameters:
- sink_name
required_fields:
- sink_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: ListExclusions
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: exclusions
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetExclusion
flattening:
groups:
- parameters:
- name
required_fields:
- name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateExclusion
flattening:
groups:
- parameters:
- parent
- exclusion
required_fields:
- parent
- exclusion
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateExclusion
flattening:
groups:
- parameters:
- name
- exclusion
- update_mask
required_fields:
- name
- exclusion
- update_mask
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteExclusion
flattening:
groups:
- parameters:
- name
required_fields:
- name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: google.logging.v2.MetricsServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: ListLogMetrics
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: metrics
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetLogMetric
flattening:
groups:
- parameters:
- metric_name
required_fields:
- metric_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateLogMetric
flattening:
groups:
- parameters:
- parent
- metric
required_fields:
- parent
- metric
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateLogMetric
flattening:
groups:
- parameters:
- metric_name
- metric
required_fields:
- metric_name
- metric
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteLogMetric
flattening:
groups:
- parameters:
- metric_name
required_fields:
- metric_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: google.logging.v2.LoggingServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
- name: list
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: DeleteLog
flattening:
groups:
- parameters:
- log_name
required_fields:
- log_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
log_name: log_oneof
resource_name_treatment: STATIC_TYPES
- name: WriteLogEntries
flattening:
groups:
- parameters:
- log_name
- resource
- labels
- entries
required_fields:
- entries
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
log_name: log_oneof
resource_name_treatment: STATIC_TYPES
batching:
thresholds:
element_count_threshold: 1000
request_byte_threshold: 1048576 # 1 MiB
delay_threshold_millis: 50
flow_control_element_limit: 100000
flow_control_byte_limit: 10485760 # 10 MiB
flow_control_limit_exceeded_behavior: THROW_EXCEPTION
batch_descriptor:
batched_field: entries
discriminator_fields:
- log_name
- resource
- labels
- name: ListLogEntries
flattening:
groups:
- parameters:
- resource_names
- filter
- order_by
required_fields:
- resource_names
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: entries
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 10000
field_name_patterns:
resource_names: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: ListMonitoredResourceDescriptors
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: resource_descriptors
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
resource_name_treatment: STATIC_TYPES
- name: ListLogs
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: log_names
retry_codes_name: idempotent
retry_params_name: default
field_name_patterns:
parent: parent_oneof
timeout_millis: 60000
resource_name_treatment: STATIC_TYPES
resource_name_generation:
- message_name: LogMetric
field_entity_map:
name: metric_oneof
- message_name: DeleteLogRequest
field_entity_map:
log_name: log_oneof
- message_name: WriteLogEntriesRequest
field_entity_map:
log_name: log_oneof
- message_name: ListLogEntriesRequest
field_entity_map:
resource_names: parent_oneof
- message_name: LogEntry
field_entity_map:
log_name: log_oneof
- message_name: LogSink
field_entity_map:
destination: "*"
- message_name: ListSinksRequest
field_entity_map:
parent: parent_oneof
- message_name: GetSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: CreateSinkRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: DeleteSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: ListLogMetricsRequest
field_entity_map:
parent: parent_oneof
- message_name: GetLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: CreateLogMetricRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: DeleteLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: ListLogsRequest
field_entity_map:
parent: parent_oneof
- message_name: ListExclusionsRequest
field_entity_map:
parent: parent_oneof
- message_name: GetExclusionRequest
field_entity_map:
name: exclusion_oneof
- message_name: CreateExclusionRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateExclusionRequest
field_entity_map:
name: exclusion_oneof
- message_name: DeleteExclusionRequest
field_entity_map:
name: exclusion_oneof

View File

@ -1,12 +1,8 @@
type: com.google.api.codegen.ConfigProto
config_schema_version: 1.0.0
config_schema_version: 2.0.0
language_settings:
java:
package_name: com.google.cloud.logging.v2
interface_names:
google.logging.v2.ConfigServiceV2: Config
google.logging.v2.LoggingServiceV2: Logging
google.logging.v2.MetricsServiceV2: Metrics
python:
package_name: google.cloud.logging_v2.gapic
go:
@ -22,551 +18,3 @@ language_settings:
nodejs:
package_name: logging.v2
domain_layer_location: google-cloud
collections:
- name_pattern: projects/{project}
entity_name: project
# C#: Already GA, do not use common resource name for 'project'
- name_pattern: "projects/{project}/logs/{log}"
entity_name: log
language_overrides:
- language: java
entity_name: project_log
- name_pattern: "projects/{project}/sinks/{sink}"
entity_name: sink
language_overrides:
- language: java
entity_name: project_sink
- name_pattern: projects/{project}/metrics/{metric}
entity_name: metric
language_overrides:
- language: java
entity_name: project_metric
- name_pattern: "projects/{project}/exclusions/{exclusion}"
entity_name: exclusion
language_overrides:
- language: java
entity_name: project_exclusion
- name_pattern: organizations/{organization}
entity_name: organization
- name_pattern: organizations/{organization}/logs/{log}
entity_name: organization_log
- name_pattern: organizations/{organization}/sinks/{sink}
entity_name: organization_sink
- name_pattern: organizations/{organization}/exclusions/{exclusion}
entity_name: organization_exclusion
- name_pattern: folders/{folder}
entity_name: folder
- name_pattern: folders/{folder}/logs/{log}
entity_name: folder_log
- name_pattern: folders/{folder}/sinks/{sink}
entity_name: folder_sink
- name_pattern: folders/{folder}/exclusions/{exclusion}
entity_name: folder_exclusion
- name_pattern: billingAccounts/{billing_account}
entity_name: billing
- name_pattern: billingAccounts/{billing_account}/logs/{log}
entity_name: billing_log
- name_pattern: billingAccounts/{billing_account}/sinks/{sink}
entity_name: billing_sink
- name_pattern: billingAccounts/{billing_account}/exclusions/{exclusion}
entity_name: billing_exclusion
collection_oneofs:
- oneof_name: parent_oneof
collection_names:
- project
- organization
- folder
- billing
- oneof_name: sink_oneof
collection_names:
- sink
- organization_sink
- folder_sink
- billing_sink
- oneof_name: exclusion_oneof
collection_names:
- exclusion
- organization_exclusion
- folder_exclusion
- billing_exclusion
- oneof_name: log_oneof
collection_names:
- log
- organization_log
- folder_log
- billing_log
- oneof_name: metric_oneof
collection_names:
- metric
interfaces:
- name: google.logging.v2.ConfigServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
- name: write_sink
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: ListSinks
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: sinks
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetSink
flattening:
groups:
- parameters:
- sink_name
required_fields:
- sink_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateSink
flattening:
groups:
- parameters:
- parent
- sink
required_fields:
- parent
- sink
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 120000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateSink
flattening:
groups:
- parameters:
- sink_name
- sink
- update_mask
- parameters:
- sink_name
- sink
required_fields:
- sink_name
- sink
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 120000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteSink
flattening:
groups:
- parameters:
- sink_name
required_fields:
- sink_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
sink_name: sink_oneof
resource_name_treatment: STATIC_TYPES
- name: ListExclusions
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: exclusions
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetExclusion
flattening:
groups:
- parameters:
- name
required_fields:
- name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateExclusion
flattening:
groups:
- parameters:
- parent
- exclusion
required_fields:
- parent
- exclusion
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateExclusion
flattening:
groups:
- parameters:
- name
- exclusion
- update_mask
required_fields:
- name
- exclusion
- update_mask
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteExclusion
flattening:
groups:
- parameters:
- name
required_fields:
- name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
name: exclusion_oneof
resource_name_treatment: STATIC_TYPES
- name: google.logging.v2.MetricsServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: ListLogMetrics
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
token_field: page_token
page_size_field: page_size
response:
token_field: next_page_token
resources_field: metrics
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: GetLogMetric
flattening:
groups:
- parameters:
- metric_name
required_fields:
- metric_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: CreateLogMetric
flattening:
groups:
- parameters:
- parent
- metric
required_fields:
- parent
- metric
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
parent: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: UpdateLogMetric
flattening:
groups:
- parameters:
- metric_name
- metric
required_fields:
- metric_name
- metric
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: DeleteLogMetric
flattening:
groups:
- parameters:
- metric_name
required_fields:
- metric_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
metric_name: metric_oneof
resource_name_treatment: STATIC_TYPES
- name: google.logging.v2.LoggingServiceV2
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- INTERNAL
- name: non_idempotent
retry_codes: []
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
- name: list
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
methods:
- name: DeleteLog
flattening:
groups:
- parameters:
- log_name
required_fields:
- log_name
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
log_name: log_oneof
resource_name_treatment: STATIC_TYPES
- name: WriteLogEntries
flattening:
groups:
- parameters:
- log_name
- resource
- labels
- entries
required_fields:
- entries
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
field_name_patterns:
log_name: log_oneof
resource_name_treatment: STATIC_TYPES
batching:
thresholds:
element_count_threshold: 1000
request_byte_threshold: 1048576 # 1 MiB
delay_threshold_millis: 50
flow_control_element_limit: 100000
flow_control_byte_limit: 10485760 # 10 MiB
flow_control_limit_exceeded_behavior: THROW_EXCEPTION
batch_descriptor:
batched_field: entries
discriminator_fields:
- log_name
- resource
- labels
- name: ListLogEntries
flattening:
groups:
- parameters:
- resource_names
- filter
- order_by
required_fields:
- resource_names
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: entries
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 10000
field_name_patterns:
resource_names: parent_oneof
resource_name_treatment: STATIC_TYPES
- name: ListMonitoredResourceDescriptors
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: resource_descriptors
retry_codes_name: idempotent
retry_params_name: default
timeout_millis: 60000
resource_name_treatment: STATIC_TYPES
- name: ListLogs
flattening:
groups:
- parameters:
- parent
required_fields:
- parent
page_streaming:
request:
page_size_field: page_size
token_field: page_token
response:
token_field: next_page_token
resources_field: log_names
retry_codes_name: idempotent
retry_params_name: default
field_name_patterns:
parent: parent_oneof
timeout_millis: 60000
resource_name_treatment: STATIC_TYPES
resource_name_generation:
- message_name: LogMetric
field_entity_map:
name: metric_oneof
- message_name: DeleteLogRequest
field_entity_map:
log_name: log_oneof
- message_name: WriteLogEntriesRequest
field_entity_map:
log_name: log_oneof
- message_name: ListLogEntriesRequest
field_entity_map:
resource_names: parent_oneof
- message_name: LogEntry
field_entity_map:
log_name: log_oneof
- message_name: LogSink
field_entity_map:
destination: "*"
- message_name: ListSinksRequest
field_entity_map:
parent: parent_oneof
- message_name: GetSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: CreateSinkRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: DeleteSinkRequest
field_entity_map:
sink_name: sink_oneof
- message_name: ListLogMetricsRequest
field_entity_map:
parent: parent_oneof
- message_name: GetLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: CreateLogMetricRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: DeleteLogMetricRequest
field_entity_map:
metric_name: metric_oneof
- message_name: ListLogsRequest
field_entity_map:
parent: parent_oneof
- message_name: ListExclusionsRequest
field_entity_map:
parent: parent_oneof
- message_name: GetExclusionRequest
field_entity_map:
name: exclusion_oneof
- message_name: CreateExclusionRequest
field_entity_map:
parent: parent_oneof
- message_name: UpdateExclusionRequest
field_entity_map:
name: exclusion_oneof
- message_name: DeleteExclusionRequest
field_entity_map:
name: exclusion_oneof

View File

@ -98,7 +98,7 @@ service MetricsServiceV2 {
// by the bucket options.
message LogMetric {
option (google.api.resource) = {
type: "logging.googleapis.com/Metric"
type: "logging.googleapis.com/LogMetric"
pattern: "projects/{project}/metrics/{metric}"
};
@ -124,20 +124,20 @@ message LogMetric {
// However, when the metric identifier appears as the `[METRIC_ID]` part of a
// `metric_name` API parameter, then the metric identifier must be
// URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`.
string name = 1;
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. A description of this metric, which is used in documentation.
// The maximum length of the description is 8000 characters.
string description = 2;
string description = 2 [(google.api.field_behavior) = OPTIONAL];
// Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
// which is used to match log entries.
// Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
// used to match log entries.
// Example:
//
// "resource.type=gae_app AND 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<string, string> label_extractors = 7;
map<string, string> 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"
}
];
}