parent
3930ed4c8f
commit
1753a41502
7 changed files with 732 additions and 0 deletions
@ -0,0 +1,2 @@ |
||||
# Introduction |
||||
The Google logging service. |
@ -0,0 +1,69 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.type; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_outer_classname = "HttpRequestProto"; |
||||
option java_package = "com.google.logging.type"; |
||||
|
||||
|
||||
// A common proto for logging HTTP requests. |
||||
// |
||||
message HttpRequest { |
||||
// The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. |
||||
string request_method = 1; |
||||
|
||||
// The scheme (http, https), the host name, the path and the query |
||||
// portion of the URL that was requested. |
||||
// Example: `"http://example.com/some/info?color=red"`. |
||||
string request_url = 2; |
||||
|
||||
// The size of the HTTP request message in bytes, including the request |
||||
// headers and the request body. |
||||
int64 request_size = 3; |
||||
|
||||
// The response code indicating the status of response. |
||||
// Examples: 200, 404. |
||||
int32 status = 4; |
||||
|
||||
// The size of the HTTP response message sent back to the client, in bytes, |
||||
// including the response headers and the response body. |
||||
int64 response_size = 5; |
||||
|
||||
// The user agent sent by the client. Example: |
||||
// `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`. |
||||
string user_agent = 6; |
||||
|
||||
// The IP address (IPv4 or IPv6) of the client that issued the HTTP |
||||
// request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. |
||||
string remote_ip = 7; |
||||
|
||||
// The referer URL of the request, as defined in |
||||
// [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). |
||||
string referer = 8; |
||||
|
||||
// Whether or not an entity was served from cache |
||||
// (with or without validation). |
||||
bool cache_hit = 9; |
||||
|
||||
// Whether or not the response was validated with the origin server before |
||||
// being served from cache. This field is only meaningful if `cache_hit` is |
||||
// True. |
||||
bool validated_with_origin_server = 10; |
||||
} |
@ -0,0 +1,62 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.type; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_outer_classname = "LogSeverityProto"; |
||||
option java_package = "com.google.logging.type"; |
||||
|
||||
|
||||
// The severity of the event described in a log entry. These guideline severity |
||||
// levels are ordered, with numerically smaller levels treated as less severe |
||||
// than numerically larger levels. If the source of the log entries uses a |
||||
// different set of severity levels, the client should select the closest |
||||
// corresponding `LogSeverity` value. For example, Java's FINE, FINER, and |
||||
// FINEST levels might all map to `LogSeverity.DEBUG`. If the original severity |
||||
// code must be preserved, it can be stored in the payload. |
||||
// |
||||
enum LogSeverity { |
||||
// The log entry has no assigned severity level. |
||||
DEFAULT = 0; |
||||
|
||||
// Debug or trace information. |
||||
DEBUG = 100; |
||||
|
||||
// Routine information, such as ongoing status or performance. |
||||
INFO = 200; |
||||
|
||||
// Normal but significant events, such as start up, shut down, or |
||||
// configuration. |
||||
NOTICE = 300; |
||||
|
||||
// Warning events might cause problems. |
||||
WARNING = 400; |
||||
|
||||
// Error events are likely to cause problems. |
||||
ERROR = 500; |
||||
|
||||
// Critical events cause more severe problems or brief outages. |
||||
CRITICAL = 600; |
||||
|
||||
// A person must take an action immediately. |
||||
ALERT = 700; |
||||
|
||||
// One or more systems are unusable. |
||||
EMERGENCY = 800; |
||||
} |
@ -0,0 +1,114 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.v2; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
import "google/api/monitored_resource.proto"; |
||||
import "google/logging/type/http_request.proto"; |
||||
import "google/logging/type/log_severity.proto"; |
||||
import "google/protobuf/any.proto"; |
||||
import "google/protobuf/struct.proto"; |
||||
import "google/protobuf/timestamp.proto"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_outer_classname = "LogEntryProto"; |
||||
option java_package = "com.google.logging.v2"; |
||||
|
||||
|
||||
// An individual entry in a log. |
||||
message LogEntry { |
||||
// Required. The resource name of the log to which this log entry |
||||
// belongs. The format of the name is |
||||
// `projects/<project-id>/logs/<log-id%gt;`. Examples: |
||||
// `"projects/my-projectid/logs/syslog"`, |
||||
// `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`. |
||||
// |
||||
// The log ID part of resource name must be less than 512 characters |
||||
// long and can only include the following characters: upper and |
||||
// lower case alphanumeric characters: [A-Za-z0-9]; and punctuation |
||||
// characters: forward-slash, underscore, hyphen, and period. |
||||
// Forward-slash (`/`) characters in the log ID must be URL-encoded. |
||||
string log_name = 12; |
||||
|
||||
// Required. The monitored resource associated with 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; |
||||
|
||||
// Required. The log entry payload, which can be one of multiple types. |
||||
oneof payload { |
||||
// The log entry payload, represented as a protocol buffer. |
||||
// You can only use `protoPayload` values that belong to a set of approved |
||||
// types. |
||||
google.protobuf.Any proto_payload = 2; |
||||
|
||||
// The log entry payload, represented as a Unicode string (UTF-8). |
||||
string text_payload = 3; |
||||
|
||||
// The log entry payload, represented as a structure that |
||||
// is expressed as a JSON object. |
||||
google.protobuf.Struct json_payload = 6; |
||||
} |
||||
|
||||
// Optional. The time the event described by the log entry occurred. If |
||||
// omitted, Cloud Logging will use the time the log entry is written. |
||||
google.protobuf.Timestamp timestamp = 9; |
||||
|
||||
// Optional. The severity of the log entry. The default value is |
||||
// `LogSeverity.DEFAULT`. |
||||
google.logging.type.LogSeverity severity = 10; |
||||
|
||||
// Optional. A unique ID for the log entry. If you provide this field, the |
||||
// logging service considers other log entries in the same log with the same |
||||
// ID as duplicates which can be removed. |
||||
// If omitted, Cloud Logging will generate a unique ID for this log entry. |
||||
string insert_id = 4; |
||||
|
||||
// Optional. Information about the HTTP request associated with this log entry, |
||||
// if applicable. |
||||
google.logging.type.HttpRequest http_request = 7; |
||||
|
||||
// Optional. A set of user-defined (key, value) data that provides additional |
||||
// information about the log entry. |
||||
map<string, string> labels = 11; |
||||
|
||||
// Optional. Information about an operation associated with the log entry, if |
||||
// applicable. |
||||
LogEntryOperation operation = 15; |
||||
} |
||||
|
||||
// Additional information about a potentially long-running operation with which |
||||
// a log entry is associated. |
||||
message LogEntryOperation { |
||||
// Required. An arbitrary operation identifier. Log entries with the |
||||
// same identifier are assumed to be part of the same operation. |
||||
// |
||||
string id = 1; |
||||
|
||||
// Required. 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; |
||||
|
||||
// Optional. Set this to True if this is the first log entry in the operation. |
||||
bool first = 3; |
||||
|
||||
// Optional. Set this to True if this is the last log entry in the operation. |
||||
bool last = 4; |
||||
} |
@ -0,0 +1,167 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.v2; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
import "google/api/monitored_resource.proto"; |
||||
import "google/logging/v2/log_entry.proto"; |
||||
import "google/protobuf/empty.proto"; |
||||
import "google/rpc/status.proto"; |
||||
|
||||
option cc_enable_arenas = true; |
||||
option java_multiple_files = true; |
||||
option java_outer_classname = "LoggingProto"; |
||||
option java_package = "com.google.logging.v2"; |
||||
|
||||
|
||||
// Service for ingesting and querying logs. |
||||
service LoggingServiceV2 { |
||||
// Deletes a log and all its log entries. |
||||
// The log will reappear if it receives new entries. |
||||
// |
||||
rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { |
||||
option (google.api.http) = { delete: "/v2beta1/{log_name=projects/*/logs/*}" }; |
||||
} |
||||
|
||||
// Writes log entries to Cloud Logging. |
||||
// All log entries in Cloud Logging are written by this method. |
||||
// |
||||
rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) { |
||||
option (google.api.http) = { post: "/v2beta1/entries:write" body: "*" }; |
||||
} |
||||
|
||||
// Lists log entries. Use this method to retrieve log entries from Cloud |
||||
// Logging. For ways to export log entries, see |
||||
// [Exporting Logs](/logging/docs/export). |
||||
// |
||||
rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) { |
||||
option (google.api.http) = { post: "/v2beta1/entries:list" body: "*" }; |
||||
} |
||||
|
||||
// Lists monitored resource descriptors that are used by Cloud Logging. |
||||
rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) { |
||||
option (google.api.http) = { get: "/v2beta1/monitoredResourceDescriptors" }; |
||||
} |
||||
} |
||||
|
||||
// The parameters to DeleteLog. |
||||
message DeleteLogRequest { |
||||
// Required. The resource name of the log to delete. Example: |
||||
// `"projects/my-project/logs/syslog"`. |
||||
string log_name = 1; |
||||
} |
||||
|
||||
// The parameters to WriteLogEntries. |
||||
message WriteLogEntriesRequest { |
||||
// Optional. A default log resource name for those log entries in `entries` |
||||
// that do not specify their own `logName`. Example: |
||||
// `"projects/my-project/logs/syslog"`. See |
||||
// [LogEntry][google.logging.v2.LogEntry]. |
||||
string log_name = 1; |
||||
|
||||
// Optional. A default monitored resource for those log entries in `entries` |
||||
// that do not specify their own `resource`. |
||||
google.api.MonitoredResource resource = 2; |
||||
|
||||
// Optional. User-defined `key:value` items that are added to |
||||
// the `labels` field of each log entry in `entries`, except when a log |
||||
// entry specifies its own `key:value` item with the same key. |
||||
// Example: `{ "size": "large", "color":"red" }` |
||||
map<string, string> labels = 3; |
||||
|
||||
// Required. The log entries to write. The log entries must have values for |
||||
// all required fields. |
||||
repeated LogEntry entries = 4; |
||||
} |
||||
|
||||
// Result returned from WriteLogEntries. |
||||
message WriteLogEntriesResponse { |
||||
|
||||
} |
||||
|
||||
// The parameters to `ListLogEntries`. |
||||
message ListLogEntriesRequest { |
||||
// Required. One or more project IDs or project numbers from which to retrieve |
||||
// log entries. Examples of a project ID: `"my-project-1A"`, `"1234567890"`. |
||||
repeated string project_ids = 1; |
||||
|
||||
// Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). |
||||
// The filter is compared against all log entries in the projects specified by |
||||
// `projectIds`. Only entries that match the filter are retrieved. An empty |
||||
// filter matches all log entries. |
||||
string filter = 2; |
||||
|
||||
// Optional. How the results should be sorted. Presently, the only permitted |
||||
// values are `"timestamp"` (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`. |
||||
string order_by = 3; |
||||
|
||||
// Optional. The maximum number of results to return from this request. Fewer |
||||
// results might be returned. You must check for the `nextPageToken` result to |
||||
// determine if additional results are available, which you can retrieve by |
||||
// passing the `nextPageToken` value in the `pageToken` parameter to the next |
||||
// request. |
||||
int32 page_size = 4; |
||||
|
||||
// Optional. If the `pageToken` request parameter is supplied, then the next |
||||
// page of results in the set are retrieved. The `pageToken` parameter must |
||||
// be set with the value of the `nextPageToken` result parameter from the |
||||
// previous request. The values of `projectIds`, `filter`, and `orderBy` must |
||||
// be the same as in the previous request. |
||||
string page_token = 5; |
||||
} |
||||
|
||||
// Result returned from `ListLogEntries`. |
||||
message ListLogEntriesResponse { |
||||
// A list of log entries. |
||||
repeated LogEntry entries = 1; |
||||
|
||||
// If there are more results than were returned, then `nextPageToken` is |
||||
// given a value in the response. To get the next batch of results, call |
||||
// this method again using the value of `nextPageToken` as `pageToken`. |
||||
string next_page_token = 2; |
||||
} |
||||
|
||||
// The parameters to ListMonitoredResourceDescriptors |
||||
message ListMonitoredResourceDescriptorsRequest { |
||||
// Optional. The maximum number of results to return from this request. Fewer |
||||
// results might be returned. You must check for the `nextPageToken` result to |
||||
// determine if additional results are available, which you can retrieve by |
||||
// passing the `nextPageToken` value in the `pageToken` parameter to the next |
||||
// request. |
||||
int32 page_size = 1; |
||||
|
||||
// Optional. If the `pageToken` request parameter is supplied, then the next |
||||
// page of results in the set are retrieved. The `pageToken` parameter must |
||||
// be set with the value of the `nextPageToken` result parameter from the |
||||
// previous request. |
||||
string page_token = 2; |
||||
} |
||||
|
||||
// Result returned from ListMonitoredResourceDescriptors. |
||||
message ListMonitoredResourceDescriptorsResponse { |
||||
// A list of resource descriptors. |
||||
repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1; |
||||
|
||||
// If there are more results than were returned, then `nextPageToken` is |
||||
// returned in the response. To get the next batch of results, call this |
||||
// method again using the value of `nextPageToken` as `pageToken`. |
||||
string next_page_token = 2; |
||||
} |
@ -0,0 +1,172 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.v2; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
import "google/logging/v1/logging_config.proto"; |
||||
import "google/protobuf/empty.proto"; |
||||
import "google/protobuf/timestamp.proto"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_outer_classname = "LoggingConfig"; |
||||
option java_package = "com.google.logging.v2"; |
||||
|
||||
|
||||
service ConfigServiceV2 { |
||||
// Lists sinks. |
||||
rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { |
||||
option (google.api.http) = { get: "/v2beta1/{project_name=projects/*}/sinks" }; |
||||
} |
||||
|
||||
// Gets a sink. |
||||
rpc GetSink(GetSinkRequest) returns (LogSink) { |
||||
option (google.api.http) = { get: "/v2beta1/{sink_name=projects/*/sinks/*}" }; |
||||
} |
||||
|
||||
// Creates a sink. |
||||
rpc CreateSink(CreateSinkRequest) returns (LogSink) { |
||||
option (google.api.http) = { post: "/v2beta1/{project_name=projects/*}/sinks" body: "sink" }; |
||||
} |
||||
|
||||
// Creates or updates a sink. |
||||
rpc UpdateSink(UpdateSinkRequest) returns (LogSink) { |
||||
option (google.api.http) = { put: "/v2beta1/{sink_name=projects/*/sinks/*}" body: "sink" }; |
||||
} |
||||
|
||||
// Deletes a sink. |
||||
rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { |
||||
option (google.api.http) = { delete: "/v2beta1/{sink_name=projects/*/sinks/*}" }; |
||||
} |
||||
} |
||||
|
||||
// Describes a sink used to export log entries outside Cloud Logging. |
||||
message LogSink { |
||||
// Available log entry formats. Log entries can be written to Cloud |
||||
// Logging in either format and can be exported in either format. |
||||
// Version 2 is the preferred format. |
||||
enum VersionFormat { |
||||
// An unspecified version format will default to V2. |
||||
VERSION_FORMAT_UNSPECIFIED = 0; |
||||
|
||||
// `LogEntry` version 2 format. |
||||
V2 = 1; |
||||
|
||||
// `LogEntry` version 1 format. |
||||
V1 = 2; |
||||
} |
||||
|
||||
// Required. The client-assigned sink identifier. Example: |
||||
// `"my-severe-errors-to-pubsub"`. |
||||
// Sink identifiers are limited to 1000 characters |
||||
// and can include only the following characters: `A-Z`, `a-z`, |
||||
// `0-9`, and the special characters `_-.`. |
||||
string name = 1; |
||||
|
||||
// The export destination. See |
||||
// [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). |
||||
// Examples: `"storage.googleapis.com/a-bucket"`, |
||||
// `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`. |
||||
string destination = 3; |
||||
|
||||
// An [advanced logs filter](/logging/docs/view/advanced_filters) |
||||
// that defines the log entries to be exported. The filter must be |
||||
// consistent with the log entry format designed by the |
||||
// `outputVersionFormat` parameter, regardless of the format of the |
||||
// log entry that was originally written to Cloud Logging. |
||||
// Example: `"logName:syslog AND severity>=ERROR"`. |
||||
string filter = 5; |
||||
|
||||
// The log entry version used when exporting log entries from this |
||||
// sink. This version does not have to correspond to the version of |
||||
// the log entry when it was written to Cloud Logging. |
||||
VersionFormat output_version_format = 6; |
||||
} |
||||
|
||||
// The parameters to `ListSinks`. |
||||
message ListSinksRequest { |
||||
// Required. The resource name of the project containing the sinks. |
||||
// Example: `"projects/my-logging-project"`, `"projects/01234567890"`. |
||||
string project_name = 1; |
||||
|
||||
// Optional. If the `pageToken` request parameter is supplied, then the next |
||||
// page of results in the set are retrieved. The `pageToken` parameter must |
||||
// be set with the value of the `nextPageToken` result parameter from the |
||||
// previous request. The value of `projectName` must be the same as in the |
||||
// previous request. |
||||
string page_token = 2; |
||||
|
||||
// Optional. The maximum number of results to return from this request. Fewer |
||||
// results might be returned. You must check for the `nextPageToken` result to |
||||
// determine if additional results are available, which you can retrieve by |
||||
// passing the `nextPageToken` value in the `pageToken` parameter to the next |
||||
// request. |
||||
int32 page_size = 3; |
||||
} |
||||
|
||||
// Result returned from `ListSinks`. |
||||
message ListSinksResponse { |
||||
// A list of sinks. |
||||
repeated LogSink sinks = 1; |
||||
|
||||
// If there are more results than were returned, then `nextPageToken` is |
||||
// given a value in the response. To get the next batch of results, call this |
||||
// method again using the value of `nextPageToken` as `pageToken`. |
||||
string next_page_token = 2; |
||||
} |
||||
|
||||
// The parameters to `GetSink`. |
||||
message GetSinkRequest { |
||||
// The resource name of the sink to return. |
||||
// Example: `"projects/my-project-id/sinks/my-sink-id"`. |
||||
string sink_name = 1; |
||||
} |
||||
|
||||
// The parameters to `CreateSink`. |
||||
message CreateSinkRequest { |
||||
// The resource name of the project in which to create the sink. |
||||
// Example: `"projects/my-project-id"`. |
||||
// |
||||
// The new sink must be provided in the request. |
||||
string project_name = 1; |
||||
|
||||
// The new sink, which must not have an identifier that already |
||||
// exists. |
||||
LogSink sink = 2; |
||||
} |
||||
|
||||
// The parameters to `UpdateSink`. |
||||
message UpdateSinkRequest { |
||||
// The resource name of the sink to update. |
||||
// Example: `"projects/my-project-id/sinks/my-sink-id"`. |
||||
// |
||||
// The updated sink must be provided in the request and have the |
||||
// same name that is specified in `sinkName`. If the sink does not |
||||
// exist, it is created. |
||||
string sink_name = 1; |
||||
|
||||
// The updated sink, whose name must be the same as the sink |
||||
// identifier in `sinkName`. If `sinkName` does not exist, then |
||||
// this method creates a new sink. |
||||
LogSink sink = 2; |
||||
} |
||||
|
||||
// The parameters to `DeleteSink`. |
||||
message DeleteSinkRequest { |
||||
// The resource name of the sink to delete. |
||||
// Example: `"projects/my-project-id/sinks/my-sink-id"`. |
||||
string sink_name = 1; |
||||
} |
@ -0,0 +1,146 @@ |
||||
// Copyright (c) 2015, Google Inc. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.logging.v2; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
import "google/protobuf/empty.proto"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_package = "com.google.logging.v2"; |
||||
|
||||
|
||||
service MetricsServiceV2 { |
||||
// Lists logs-based metrics. |
||||
rpc ListLogMetrics(ListLogMetricsRequest) returns (ListLogMetricsResponse) { |
||||
option (google.api.http) = { get: "/v2beta1/{project_name=projects/*}/metrics" }; |
||||
} |
||||
|
||||
// Gets a logs-based metric. |
||||
rpc GetLogMetric(GetLogMetricRequest) returns (LogMetric) { |
||||
option (google.api.http) = { get: "/v2beta1/{metric_name=projects/*/metrics/*}" }; |
||||
} |
||||
|
||||
// Creates a logs-based metric. |
||||
rpc CreateLogMetric(CreateLogMetricRequest) returns (LogMetric) { |
||||
option (google.api.http) = { post: "/v2beta1/{project_name=projects/*}/metrics" body: "metric" }; |
||||
} |
||||
|
||||
// Creates or updates a logs-based metric. |
||||
rpc UpdateLogMetric(UpdateLogMetricRequest) returns (LogMetric) { |
||||
option (google.api.http) = { put: "/v2beta1/{metric_name=projects/*/metrics/*}" body: "metric" }; |
||||
} |
||||
|
||||
// Deletes a logs-based metric. |
||||
rpc DeleteLogMetric(DeleteLogMetricRequest) returns (google.protobuf.Empty) { |
||||
option (google.api.http) = { delete: "/v2beta1/{metric_name=projects/*/metrics/*}" }; |
||||
} |
||||
} |
||||
|
||||
// Describes a logs-based metric. The value of the metric is the |
||||
// number of log entries that match a logs filter. |
||||
message LogMetric { |
||||
// Required. The client-assigned metric identifier. Example: |
||||
// `"severe_errors"`. Metric identifiers are limited to 1000 |
||||
// characters and can include only the following characters: `A-Z`, |
||||
// `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`. The |
||||
// forward-slash character (`/`) denotes a hierarchy of name pieces, |
||||
// and it cannot be the first character of the name. |
||||
string name = 1; |
||||
|
||||
// A description of this metric, which is used in documentation. |
||||
string description = 2; |
||||
|
||||
// An [advanced logs filter](/logging/docs/view/advanced_filters). |
||||
// Example: `"logName:syslog AND severity>=ERROR"`. |
||||
string filter = 3; |
||||
} |
||||
|
||||
// The parameters to ListLogMetrics. |
||||
message ListLogMetricsRequest { |
||||
// Required. The resource name of the project containing the metrics. |
||||
// Example: `"projects/my-project-id"`. |
||||
string project_name = 1; |
||||
|
||||
// Optional. If the `pageToken` request parameter is supplied, then the next |
||||
// page of results in the set are retrieved. The `pageToken` parameter must |
||||
// be set with the value of the `nextPageToken` result parameter from the |
||||
// previous request. The value of `projectName` must |
||||
// be the same as in the previous request. |
||||
string page_token = 2; |
||||
|
||||
// Optional. The maximum number of results to return from this request. Fewer |
||||
// results might be returned. You must check for the `nextPageToken` result to |
||||
// determine if additional results are available, which you can retrieve by |
||||
// passing the `nextPageToken` value in the `pageToken` parameter to the next |
||||
// request. |
||||
int32 page_size = 3; |
||||
} |
||||
|
||||
// Result returned from ListLogMetrics. |
||||
message ListLogMetricsResponse { |
||||
// A list of logs-based metrics. |
||||
repeated LogMetric metrics = 1; |
||||
|
||||
// If there are more results than were returned, then `nextPageToken` is given |
||||
// a value in the response. To get the next batch of results, call this |
||||
// method again using the value of `nextPageToken` as `pageToken`. |
||||
string next_page_token = 2; |
||||
} |
||||
|
||||
// The parameters to GetLogMetric. |
||||
message GetLogMetricRequest { |
||||
// The resource name of the desired metric. |
||||
// Example: `"projects/my-project-id/metrics/my-metric-id"`. |
||||
string metric_name = 1; |
||||
} |
||||
|
||||
// The parameters to CreateLogMetric. |
||||
message CreateLogMetricRequest { |
||||
// The resource name of the project in which to create the metric. |
||||
// Example: `"projects/my-project-id"`. |
||||
// |
||||
// The new metric must be provided in the request. |
||||
string project_name = 1; |
||||
|
||||
// The new logs-based metric, which must not have an identifier that |
||||
// already exists. |
||||
LogMetric metric = 2; |
||||
} |
||||
|
||||
// The parameters to UpdateLogMetric. |
||||
// |
||||
message UpdateLogMetricRequest { |
||||
// The resource name of the metric to update. |
||||
// Example: `"projects/my-project-id/metrics/my-metric-id"`. |
||||
// |
||||
// The updated metric must be provided in the request and have the |
||||
// same identifier that is specified in `metricName`. |
||||
// If the metric does not exist, it is created. |
||||
string metric_name = 1; |
||||
|
||||
// The updated metric, whose name must be the same as the |
||||
// metric identifier in `metricName`. If `metricName` does not |
||||
// exist, then a new metric is created. |
||||
LogMetric metric = 2; |
||||
} |
||||
|
||||
// The parameters to DeleteLogMetric. |
||||
message DeleteLogMetricRequest { |
||||
// The resource name of the metric to delete. |
||||
// Example: `"projects/my-project-id/metrics/my-metric-id"`. |
||||
string metric_name = 1; |
||||
} |
Loading…
Reference in new issue