#[non_exhaustive]pub struct Operation {
pub operation_id: String,
pub operation_name: String,
pub consumer_id: String,
pub start_time: Option<Timestamp>,
pub end_time: Option<Timestamp>,
pub labels: HashMap<String, String>,
pub metric_value_sets: Vec<MetricValueSet>,
pub log_entries: Vec<LogEntry>,
pub importance: Importance,
pub extensions: Vec<Any>,
/* private fields */
}Expand description
Represents information regarding an operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.operation_id: StringIdentity of the operation. This must be unique within the scope of the service that generated the operation. If the service calls Check() and Report() on the same operation, the two calls should carry the same id.
UUID version 4 is recommended, though not required. In scenarios where an operation is computed from existing information and an idempotent id is desirable for deduplication purpose, UUID version 5 is recommended. See RFC 4122 for details.
operation_name: StringFully qualified name of the operation. Reserved for future use.
consumer_id: StringIdentity of the consumer who is using the service. This field should be filled in for the operations initiated by a consumer, but not for service-initiated operations that are not related to a specific consumer.
- This can be in one of the following formats:
- project:PROJECT_ID,
- project
_number:PROJECT_NUMBER, - projects/PROJECT_ID or PROJECT_NUMBER,
- folders/FOLDER_NUMBER,
- organizations/ORGANIZATION_NUMBER,
- api
_key:API_KEY.
start_time: Option<Timestamp>Required. Start time of the operation.
end_time: Option<Timestamp>End time of the operation. Required when the operation is used in ServiceController.Report, but optional when the operation is used in ServiceController.Check.
labels: HashMap<String, String>Labels describing the operation. Only the following labels are allowed:
- Labels describing monitored resources as defined in the service configuration.
- Default labels of metric values. When specified, labels defined in the metric value override these default.
- The following labels defined by Google Cloud Platform:
cloud.googleapis.com/locationdescribing the location where the operation happened,servicecontrol.googleapis.com/user_agentdescribing the user agent of the API request,servicecontrol.googleapis.com/service_agentdescribing the service used to handle the API request (e.g. ESP),servicecontrol.googleapis.com/platformdescribing the platform where the API is served, such as App Engine, Compute Engine, or Kubernetes Engine.
metric_value_sets: Vec<MetricValueSet>Represents information about this operation. Each MetricValueSet corresponds to a metric defined in the service configuration. The data type used in the MetricValueSet must agree with the data type specified in the metric definition.
Within a single operation, it is not allowed to have more than one MetricValue instances that have the same metric names and identical label value combinations. If a request has such duplicated MetricValue instances, the entire request is rejected with an invalid argument error.
log_entries: Vec<LogEntry>Represents information to be logged.
importance: ImportanceDO NOT USE. This is an experimental field.
extensions: Vec<Any>Unimplemented.
Implementations§
Source§impl Operation
impl Operation
pub fn new() -> Self
Sourcepub fn set_operation_id<T: Into<String>>(self, v: T) -> Self
pub fn set_operation_id<T: Into<String>>(self, v: T) -> Self
Sets the value of operation_id.
Sourcepub fn set_operation_name<T: Into<String>>(self, v: T) -> Self
pub fn set_operation_name<T: Into<String>>(self, v: T) -> Self
Sets the value of operation_name.
Sourcepub fn set_consumer_id<T: Into<String>>(self, v: T) -> Self
pub fn set_consumer_id<T: Into<String>>(self, v: T) -> Self
Sets the value of consumer_id.
Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sets the value of start_time.
Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
Sourcepub fn set_end_time<T>(self, v: T) -> Self
pub fn set_end_time<T>(self, v: T) -> Self
Sets the value of end_time.
Sourcepub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of end_time.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_metric_value_sets<T, V>(self, v: T) -> Self
pub fn set_metric_value_sets<T, V>(self, v: T) -> Self
Sets the value of metric_value_sets.
Sourcepub fn set_log_entries<T, V>(self, v: T) -> Self
pub fn set_log_entries<T, V>(self, v: T) -> Self
Sets the value of log_entries.
Sourcepub fn set_importance<T: Into<Importance>>(self, v: T) -> Self
pub fn set_importance<T: Into<Importance>>(self, v: T) -> Self
Sets the value of importance.
Sourcepub fn set_extensions<T, V>(self, v: T) -> Self
pub fn set_extensions<T, V>(self, v: T) -> Self
Sets the value of extensions.