// Copyright 2016 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"; import "google/protobuf/timestamp.proto"; option java_multiple_files = true; option java_outer_classname = "LoggingConfig"; option java_package = "com.google.logging.v2"; option go_package = "google.golang.org/genproto/googleapis/logging/v2"; // Service for configuring sinks used to export log entries outside Stackdriver // Logging. service ConfigServiceV2 { // Lists sinks. rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { option (google.api.http) = { get: "/v2beta1/{parent=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/{parent=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 Stackdriver 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). Only // log entries matching that filter are exported. The filter must be // consistent with the log entry format specified by the // `outputVersionFormat` parameter, regardless of the format of the // log entry that was originally written to Stackdriver Logging. // Example (V2 format): // `"logName=projects/my-projectid/logs/syslog AND severity>=ERROR"`. string filter = 5; // The log entry version to use for this sink's exported log entries. // This version does not have to correspond to the version of the log entry // when it was written to Stackdriver Logging. VersionFormat output_version_format = 6; } // The parameters to `ListSinks`. message ListSinksRequest { // Required. The resource name containing the sinks. // Example: `"projects/my-logging-project"`. string parent = 1; // Optional. If the `pageToken` parameter is supplied, then the next page of // results is retrieved. The `pageToken` parameter must be set to the value // of the `nextPageToken` from the previous response. // The value of `parent` must be the same as in the previous request. string page_token = 2; // Optional. The maximum number of results to return from this request. // You must check for presence of `nextPageToken` to determine if additional // results are available, which you can retrieve by passing the // `nextPageToken` value as the `pageToken` parameter in 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 // included in the response. To get the next set 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 in which to create the sink. // Example: `"projects/my-project-id"`. // // The new sink must be provided in the request. string parent = 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; }