From e884cb8794dc152f8bb58c257d93e38060f9b131 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 14 Mar 2017 10:51:47 +1100 Subject: [PATCH] logging: update from proto (#1739) Fix #481. --- .../cloud/logging/spi/v2/ConfigClient.java | 17 +++++--- .../cloud/logging/spi/v2/LoggingClient.java | 43 +++++++++++++------ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java index f832b59806a4..4ca4168a1d0c 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java @@ -182,8 +182,9 @@ public final ConfigSettings getSettings() { * } * * - * @param parent Required. The parent resource whose sinks are to be listed. Examples: - * `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final ListSinksPagedResponse listSinks(ParentNameOneof parent) { @@ -285,9 +286,11 @@ public final UnaryCallable listSinksCallabl * } * * - * @param sinkName Required. The parent resource name of the sink: + * @param sinkName Required. The resource name of the sink: *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" *

Example: `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -362,6 +365,7 @@ public final UnaryCallable getSinkCallable() { * * @param parent Required. The resource in which to create the sink: *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not * already in use. @@ -452,6 +456,8 @@ public final UnaryCallable createSinkCallable() { * resource and the sink identifier: *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" *

Example: `"projects/my-project-id/sinks/my-sink-id"`. * @param sink Required. The updated sink, whose name is the same identifier that appears as part * of `sink_name`. If `sink_name` does not exist, then this method creates a new sink. @@ -541,8 +547,9 @@ public final UnaryCallable updateSinkCallable() { * resource and the sink identifier: *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - *

It is an error if the sink does not exist. Example: - * `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink does not exist. + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteSink(SinkNameOneof sinkName) { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java index 502b0e408da5..0cf9223416c5 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java @@ -193,7 +193,8 @@ public final LoggingSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes all the log entries in a log. The log reappears if it receives new entries. + * 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. * *

Sample code: * @@ -206,6 +207,7 @@ public final LoggingSettings getSettings() { * * @param logName 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]" *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more * information about log names, see [LogEntry][google.logging.v2.LogEntry]. @@ -220,7 +222,8 @@ public final void deleteLog(LogNameOneof logName) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes all the log entries in a log. The log reappears if it receives new entries. + * 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. * *

Sample code: * @@ -243,7 +246,8 @@ private final void deleteLog(DeleteLogRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes all the log entries in a log. The log reappears if it receives new entries. + * 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. * *

Sample code: * @@ -265,7 +269,7 @@ public final UnaryCallable deleteLogCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * Writes log entries to Stackdriver Logging. * *

Sample code: * @@ -282,6 +286,7 @@ public final UnaryCallable deleteLogCallable() { * @param logName 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]" *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"` or * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more * information about log names, see [LogEntry][google.logging.v2.LogEntry]. @@ -295,8 +300,12 @@ public final UnaryCallable deleteLogCallable() { * parameter, then the log entry's label is not changed. See * [LogEntry][google.logging.v2.LogEntry]. * @param entries Required. The log entries to write. Values supplied for the fields `log_name`, - * `resource`, and `labels` in this `entries.write` request are added to those log entries - * that do not provide their own values for the fields. + * `resource`, and `labels` in this `entries.write` request are inserted into those log + * entries in this list that do not provide their own values. + *

Stackdriver Logging also creates and inserts values for `timestamp` and `insert_id` if + * the entries do not provide them. The created `insert_id` for the N'th entry in this list + * will be greater than earlier entries and less than later entries. Otherwise, the order of + * log entries in this list does not matter. *

To improve throughput and to avoid exceeding the [quota limit](/logging/quota-policy) * for calls to `entries.write`, you should write multiple log entries at once rather than * calling this method for each individual log entry. @@ -320,7 +329,7 @@ public final WriteLogEntriesResponse writeLogEntries( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * Writes log entries to Stackdriver Logging. * *

Sample code: * @@ -343,7 +352,7 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * Writes log entries to Stackdriver Logging. * *

Sample code: * @@ -382,9 +391,10 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ * } * * - * @param resourceNames Required. Names of one or more resources from which to retrieve log + * @param resourceNames 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 listed in the `project_ids` field are added to this list. * @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs * Filters](/logging/docs/view/advanced_filters). Only log entries that match the filter are @@ -396,7 +406,7 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ * are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in * order of increasing values of `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 `LogEntry.insertId`. + * timestamps are returned in order of their `insert_id` values. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final ListLogEntriesPagedResponse listLogEntries( @@ -573,7 +583,8 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the logs in projects or organizations. Only logs that have entries are listed. + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. * *

Sample code: * @@ -588,6 +599,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * * @param parent Required. The resource name that owns the logs: *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final ListLogsPagedResponse listLogs(ParentNameOneof parent) { @@ -598,7 +610,8 @@ public final ListLogsPagedResponse listLogs(ParentNameOneof parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the logs in projects or organizations. Only logs that have entries are listed. + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. * *

Sample code: * @@ -623,7 +636,8 @@ public final ListLogsPagedResponse listLogs(ListLogsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the logs in projects or organizations. Only logs that have entries are listed. + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. * *

Sample code: * @@ -647,7 +661,8 @@ public final UnaryCallable listLogsPaged // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the logs in projects or organizations. Only logs that have entries are listed. + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. * *

Sample code: *