Skip to content

Commit

Permalink
docs(samples): include metadata file, add exclusions for samples to h…
Browse files Browse the repository at this point in the history
…andwritten libraries (#1229)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9

feat: Update Logging API with latest changes
PiperOrigin-RevId: 429289471

Source-Link: googleapis/googleapis@acd5f89

Source-Link: googleapis/googleapis-gen@8a12622
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGExMjYyMjUzNmFlMmU5YTg5NzgxOThhMTUxZTg5MjM0YjgzOWIyMCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Feb 18, 2022
1 parent c1d9e36 commit 5eddc7d
Show file tree
Hide file tree
Showing 53 changed files with 18,868 additions and 7,976 deletions.
50 changes: 41 additions & 9 deletions protos/google/logging/v2/log_entry.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@ syntax = "proto3";

package google.logging.v2;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/monitored_resource.proto";
import "google/api/resource.proto";
Expand All @@ -24,8 +25,6 @@ import "google/logging/type/log_severity.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.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";
Expand All @@ -37,8 +36,6 @@ option php_namespace = "Google\\Cloud\\Logging\\V2";
option ruby_package = "Google::Cloud::Logging::V2";

// An individual entry in a log.
//
//
message LogEntry {
option (google.api.resource) = {
type: "logging.googleapis.com/Log"
Expand All @@ -62,12 +59,13 @@ message LogEntry {
//
// `[LOG_ID]` must be URL-encoded within `log_name`. Example:
// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
//
// `[LOG_ID]` must be less than 512 characters long and can only include the
// following characters: upper and lower case alphanumeric characters,
// forward-slash, underscore, hyphen, and period.
//
// For backward compatibility, if `log_name` begins with a forward-slash, such
// as `/projects/...`, then the log entry is ingested as usual but the
// as `/projects/...`, then the log entry is ingested as usual, but the
// 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.
Expand Down Expand Up @@ -126,7 +124,7 @@ message LogEntry {
// de-duplication in the export of logs.
//
// If the `insert_id` is omitted when writing a log entry, the Logging API
// assigns its own unique identifier in this field.
// assigns its own unique identifier in this field.
//
// In queries, the `insert_id` is also used to order log entries that have
// the same `log_name` and `timestamp` values.
Expand All @@ -136,8 +134,20 @@ message LogEntry {
// 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.
// Optional. A map of key, value pairs that provides additional information about the
// log entry. The labels can be user-defined or system-defined.
//
// User-defined labels are arbitrary key, value pairs that you can use to
// classify logs.
//
// System-defined labels are defined by GCP services for platform logs.
// They have two components - a service namespace component and the
// attribute name. For example: `compute.googleapis.com/resource_name`.
//
// Cloud Logging truncates label keys that exceed 512 B and label
// values that exceed 64 KB upon their associated log entry being
// written. The truncation is indicated by an ellipsis at the
// end of the character string.
map<string, string> labels = 11 [(google.api.field_behavior) = OPTIONAL];

// Optional. Information about an operation associated with the log entry, if
Expand Down Expand Up @@ -168,6 +178,10 @@ message LogEntry {

// Optional. Source code location information associated with the log entry, if any.
LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL];

// Optional. Information indicating this LogEntry is part of a sequence of multiple log
// entries split from a single LogEntry.
LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL];
}

// Additional information about a potentially long-running operation with which
Expand Down Expand Up @@ -208,3 +222,21 @@ message LogEntrySourceLocation {
// (Python).
string function = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Additional information used to correlate multiple log entries. Used when a
// single LogEntry would exceed the Google Cloud Logging size limit and is
// split across multiple log entries.
message LogSplit {
// A globally unique identifier for all log entries in a sequence of split log
// entries. All log entries with the same |LogSplit.uid| are assumed to be
// part of the same sequence of split log entries.
string uid = 1;

// The index of this LogEntry in the sequence of split log entries. Log
// entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
// entries.
int32 index = 2;

// The total number of log entries that the original LogEntry was split into.
int32 total_splits = 3;
}
114 changes: 62 additions & 52 deletions protos/google/logging/v2/logging.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@ 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";
Expand All @@ -27,7 +28,6 @@ import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.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";
Expand All @@ -48,10 +48,10 @@ service LoggingServiceV2 {
"https://www.googleapis.com/auth/logging.read,"
"https://www.googleapis.com/auth/logging.write";

// Deletes all the log entries in a log. The log reappears if it receives new
// entries. Log entries written shortly before the delete operation might not
// be deleted. Entries received after the delete operation with a timestamp
// before the operation will be deleted.
// Deletes all the log entries in a log for the _Default Log Bucket. The log
// reappears if it receives new entries. Log entries written shortly before
// the delete operation might not be deleted. Entries received after the
// delete operation with a timestamp before the operation will be deleted.
rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{log_name=projects/*/logs/*}"
Expand Down Expand Up @@ -140,14 +140,15 @@ service LoggingServiceV2 {
message DeleteLogRequest {
// Required. The resource name of the log to delete:
//
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
//
// `[LOG_ID]` must be URL-encoded. For example,
// `"projects/my-project-id/logs/syslog"`,
// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
// `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
//
// For more information about log names, see
// [LogEntry][google.logging.v2.LogEntry].
string log_name = 1 [
Expand All @@ -163,15 +164,15 @@ message WriteLogEntriesRequest {
// Optional. A default log resource name that is assigned to all log entries
// in `entries` that do not specify a value for `log_name`:
//
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
//
// `[LOG_ID]` must be URL-encoded. For example:
//
// "projects/my-project-id/logs/syslog"
// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
//
// The permission `logging.logEntries.create` is needed on each project,
// organization, billing account, or folder that is receiving new log
Expand Down Expand Up @@ -214,14 +215,14 @@ message WriteLogEntriesRequest {
// the entries later in the list. See the `entries.list` method.
//
// Log entries with timestamps that are more than the
// [logs retention period](https://cloud.google.com/logging/quota-policy) in
// [logs retention period](https://cloud.google.com/logging/quotas) in
// the past or more than 24 hours in the future will not be available when
// calling `entries.list`. However, those log entries can still be [exported
// with
// LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
//
// To improve throughput and to avoid exceeding the
// [quota limit](https://cloud.google.com/logging/quota-policy) for calls to
// [quota limit](https://cloud.google.com/logging/quotas) for calls to
// `entries.write`, you should try to include several log entries in this
// list, rather than calling this method for each individual log entry.
repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -258,16 +259,17 @@ message ListLogEntriesRequest {
// Required. Names of one or more parent resources from which to
// retrieve log entries:
//
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
// * `projects/[PROJECT_ID]`
// * `organizations/[ORGANIZATION_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
// * `folders/[FOLDER_ID]`
//
// May alternatively be one or more views:
//
// May alternatively be one or more views
// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
//
// Projects listed in the `project_ids` field are added to this list.
repeated string resource_names = 8 [
Expand All @@ -294,10 +296,10 @@ message ListLogEntriesRequest {
// timestamps are returned in order of their `insert_id` values.
string order_by = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The maximum number of results to return from this request.
// Default is 50. If the value is negative or exceeds 1000,
// the request is rejected. The presence of `next_page_token` in the
// response indicates that more results might be available.
// Optional. The maximum number of results to return from this request. Default is 50.
// If the value is negative or exceeds 1000, the request is rejected. The
// presence of `next_page_token` in the response indicates that more results
// might be available.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. If present, then retrieve the next batch of results from the
Expand Down Expand Up @@ -356,10 +358,10 @@ message ListMonitoredResourceDescriptorsResponse {
message ListLogsRequest {
// Required. The resource name that owns the logs:
//
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
// * `projects/[PROJECT_ID]`
// * `organizations/[ORGANIZATION_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
// * `folders/[FOLDER_ID]`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -379,17 +381,24 @@ message ListLogsRequest {
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The resource name that owns the logs:
// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
//
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
//
// To support legacy queries, it could also be:
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
repeated string resource_names = 8 [(google.api.field_behavior) = OPTIONAL];
//
// * `projects/[PROJECT_ID]`
// * `organizations/[ORGANIZATION_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
// * `folders/[FOLDER_ID]`
repeated string resource_names = 8 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
child_type: "logging.googleapis.com/Log"
}
];
}

// Result returned from ListLogs.
Expand All @@ -409,16 +418,17 @@ message ListLogsResponse {
message TailLogEntriesRequest {
// Required. Name of a parent resource from which to retrieve log entries:
//
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
// * `projects/[PROJECT_ID]`
// * `organizations/[ORGANIZATION_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
// * `folders/[FOLDER_ID]`
//
// May alternatively be one or more views:
// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
// "organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
//
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED];

// Optional. A filter that chooses which log entries to return. See [Advanced
Expand Down
Loading

0 comments on commit 5eddc7d

Please sign in to comment.