1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.api.servicecontrol.v1; 18 19import "google/api/servicecontrol/v1/log_entry.proto"; 20import "google/api/servicecontrol/v1/metric_value.proto"; 21import "google/protobuf/any.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option cc_enable_arenas = true; 25option csharp_namespace = "Google.Cloud.ServiceControl.V1"; 26option go_package = "cloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb"; 27option java_multiple_files = true; 28option java_outer_classname = "OperationProto"; 29option java_package = "com.google.api.servicecontrol.v1"; 30option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; 31option ruby_package = "Google::Cloud::ServiceControl::V1"; 32 33// Represents information regarding an operation. 34message Operation { 35 // Defines the importance of the data contained in the operation. 36 enum Importance { 37 // Allows data caching, batching, and aggregation. It provides 38 // higher performance with higher data loss risk. 39 LOW = 0; 40 41 // Disables data aggregation to minimize data loss. It is for operations 42 // that contains significant monetary value or audit trail. This feature 43 // only applies to the client libraries. 44 HIGH = 1; 45 } 46 47 // Identity of the operation. This must be unique within the scope of the 48 // service that generated the operation. If the service calls 49 // Check() and Report() on the same operation, the two calls should carry 50 // the same id. 51 // 52 // UUID version 4 is recommended, though not required. 53 // In scenarios where an operation is computed from existing information 54 // and an idempotent id is desirable for deduplication purpose, UUID version 5 55 // is recommended. See RFC 4122 for details. 56 string operation_id = 1; 57 58 // Fully qualified name of the operation. Reserved for future use. 59 string operation_name = 2; 60 61 // Identity of the consumer who is using the service. 62 // This field should be filled in for the operations initiated by a 63 // consumer, but not for service-initiated operations that are 64 // not related to a specific consumer. 65 // 66 // - This can be in one of the following formats: 67 // - project:PROJECT_ID, 68 // - project`_`number:PROJECT_NUMBER, 69 // - projects/PROJECT_ID or PROJECT_NUMBER, 70 // - folders/FOLDER_NUMBER, 71 // - organizations/ORGANIZATION_NUMBER, 72 // - api`_`key:API_KEY. 73 string consumer_id = 3; 74 75 // Required. Start time of the operation. 76 google.protobuf.Timestamp start_time = 4; 77 78 // End time of the operation. 79 // Required when the operation is used in 80 // [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report], 81 // but optional when the operation is used in 82 // [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. 83 google.protobuf.Timestamp end_time = 5; 84 85 // Labels describing the operation. Only the following labels are allowed: 86 // 87 // - Labels describing monitored resources as defined in 88 // the service configuration. 89 // - Default labels of metric values. When specified, labels defined in the 90 // metric value override these default. 91 // - The following labels defined by Google Cloud Platform: 92 // - `cloud.googleapis.com/location` describing the location where the 93 // operation happened, 94 // - `servicecontrol.googleapis.com/user_agent` describing the user agent 95 // of the API request, 96 // - `servicecontrol.googleapis.com/service_agent` describing the service 97 // used to handle the API request (e.g. ESP), 98 // - `servicecontrol.googleapis.com/platform` describing the platform 99 // where the API is served, such as App Engine, Compute Engine, or 100 // Kubernetes Engine. 101 map<string, string> labels = 6; 102 103 // Represents information about this operation. Each MetricValueSet 104 // corresponds to a metric defined in the service configuration. 105 // The data type used in the MetricValueSet must agree with 106 // the data type specified in the metric definition. 107 // 108 // Within a single operation, it is not allowed to have more than one 109 // MetricValue instances that have the same metric names and identical 110 // label value combinations. If a request has such duplicated MetricValue 111 // instances, the entire request is rejected with 112 // an invalid argument error. 113 repeated MetricValueSet metric_value_sets = 7; 114 115 // Represents information to be logged. 116 repeated LogEntry log_entries = 8; 117 118 // DO NOT USE. This is an experimental field. 119 Importance importance = 11; 120 121 // Unimplemented. 122 repeated google.protobuf.Any extensions = 16; 123} 124