Skip to content

Commit

Permalink
feat: add CMEK config and update grpc config logic (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Feb 10, 2020
1 parent 395a31d commit a3fb0f3
Show file tree
Hide file tree
Showing 17 changed files with 33,345 additions and 30,528 deletions.
24 changes: 20 additions & 4 deletions protos/google/logging/v2/log_entry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ syntax = "proto3";
package google.logging.v2;

import "google/api/monitored_resource.proto";
import "google/api/resource.proto";
import "google/logging/type/http_request.proto";
import "google/logging/type/log_severity.proto";
import "google/protobuf/any.proto";
Expand All @@ -36,7 +37,17 @@ option php_namespace = "Google\\Cloud\\Logging\\V2";

// An individual entry in a log.
//
//
message LogEntry {
option (google.api.resource) = {
type: "logging.googleapis.com/Log"
pattern: "projects/{project}/logs/{log}"
pattern: "organizations/{organization}/logs/{log}"
pattern: "folders/{folder}/logs/{log}"
pattern: "billingAccounts/{billing_account}/logs/{log}"
name_field: "log_name"
};

// Required. The resource name of the log to which this log entry belongs:
//
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
Expand Down Expand Up @@ -111,10 +122,15 @@ message LogEntry {

// 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 can be
// removed. If omitted in new log entries, then Logging assigns its own unique
// identifier. The `insert_id` is also used to order log entries that have the
// same `timestamp` value.
// `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.
//
// If the `insert_id` is omitted when writing a log entry, the Logging API
// 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.
string insert_id = 4;

// Optional. Information about the HTTP request associated with this log
Expand Down
41 changes: 30 additions & 11 deletions protos/google/logging/v2/logging.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ syntax = "proto3";

package google.logging.v2;

import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/monitored_resource.proto";
import "google/api/resource.proto";
import "google/logging/v2/log_entry.proto";
import "google/logging/v2/logging_config.proto";
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";
import "google/api/client.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Logging.V2";
Expand All @@ -45,10 +47,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.
// 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.
rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{log_name=projects/*/logs/*}"
Expand All @@ -65,6 +67,7 @@ service LoggingServiceV2 {
delete: "/v2/{log_name=billingAccounts/*/logs/*}"
}
};
option (google.api.method_signature) = "log_name";
}

// Writes log entries to Logging. This API method is the
Expand All @@ -79,6 +82,7 @@ service LoggingServiceV2 {
post: "/v2/entries:write"
body: "*"
};
option (google.api.method_signature) = "log_name,resource,labels,entries";
}

// Lists log entries. Use this method to retrieve log entries that originated
Expand Down Expand Up @@ -116,6 +120,7 @@ service LoggingServiceV2 {
get: "/v2/{parent=billingAccounts/*}/logs"
}
};
option (google.api.method_signature) = "parent";
}
}

Expand All @@ -133,7 +138,12 @@ message DeleteLogRequest {
// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
// For more information about log names, see
// [LogEntry][google.logging.v2.LogEntry].
string log_name = 1;
string log_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "logging.googleapis.com/Log"
}
];
}

// The parameters to WriteLogEntries.
Expand All @@ -155,7 +165,9 @@ message WriteLogEntriesRequest {
// 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;
string log_name = 1 [(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:
Expand Down Expand Up @@ -196,7 +208,7 @@ message WriteLogEntriesRequest {
// [quota limit](/logging/quota-policy) 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;
repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED];

// Optional. Whether valid entries should be written even if some other
// entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
Expand Down Expand Up @@ -245,10 +257,15 @@ message ListLogEntriesRequest {
//
//
// Projects listed in the `project_ids` field are added to this list.
repeated string resource_names = 8;
repeated string resource_names = 8 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "logging.googleapis.com/Log"
}
];

// Optional. A filter that chooses which log entries to return. See [Advanced
// Logs Filters](/logging/docs/view/advanced_filters). Only log entries that
// Logs Queries](/logging/docs/view/advanced-queries). Only log entries that
// match the filter are returned. An empty filter matches all log entries in
// the resources listed in `resource_names`. Referencing a parent resource
// that is not listed in `resource_names` will cause the filter to return no
Expand Down Expand Up @@ -329,7 +346,9 @@ message ListLogsRequest {
// "organizations/[ORGANIZATION_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
string parent = 1;
string parent = 1 [(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
Expand Down
Loading

0 comments on commit a3fb0f3

Please sign in to comment.