syntax = "proto3"; package data_connection.v1; option csharp_namespace = "ZB.MOM.WW.OtOpcUa.Commons.Protos.DataConnection.V1"; import "google/protobuf/timestamp.proto"; service DataConnectionService { rpc GetCapabilities(CapabilitiesRequest) returns (CapabilitiesResponse); rpc Browse(BrowseRequest) returns (BrowseResponse); rpc GetMetadata(MetadataRequest) returns (MetadataResponse); rpc Read(ReadRequest) returns (ReadResponse); rpc Write(WriteRequest) returns (WriteResponse); rpc Subscribe(stream SubscriptionCommand) returns (stream SubscriptionFrame); } enum ValueKind { VALUE_KIND_UNSPECIFIED = 0; VALUE_KIND_NULL = 1; VALUE_KIND_BOOLEAN = 2; VALUE_KIND_INT8 = 3; VALUE_KIND_INT16 = 4; VALUE_KIND_INT32 = 5; VALUE_KIND_INT64 = 6; VALUE_KIND_UINT8 = 7; VALUE_KIND_UINT16 = 8; VALUE_KIND_UINT32 = 9; VALUE_KIND_UINT64 = 10; VALUE_KIND_FLOAT = 11; VALUE_KIND_DOUBLE = 12; VALUE_KIND_STRING = 13; VALUE_KIND_BYTES = 14; VALUE_KIND_TIMESTAMP = 15; VALUE_KIND_GUID = 16; VALUE_KIND_ARRAY = 17; } message TypedValue { ValueKind kind = 1; oneof payload { bool boolean = 2; sint64 signed = 3; uint64 unsigned = 4; float float_value = 5; double double_value = 6; string string_value = 7; bytes bytes_value = 8; google.protobuf.Timestamp timestamp = 9; string guid = 10; TypedArray array = 11; } } message TypedArray { ValueKind element_kind = 1; repeated uint32 dimensions = 2; repeated TypedValue elements = 3; } message Address { string origin_cluster_id = 1; string namespace_uri = 2; string identifier_kind = 3; string identifier = 4; } message View { Address address = 1; int32 realm = 2; optional string mapping_id = 3; int64 mapping_revision = 4; string subject = 5; } message Serving { string node_id = 1; string incarnation = 2; string role = 3; int64 catalog_epoch = 4; int64 authority_epoch = 5; int64 serving_generation = 6; } message Sample { TypedValue value = 1; uint32 status_code = 2; google.protobuf.Timestamp source_timestamp = 3; google.protobuf.Timestamp server_timestamp = 4; Serving serving = 5; int64 version = 6; } message Budget { int64 timeout_ticks = 1; int32 max_items = 2; int64 max_bytes = 3; } message Limits { int32 max_page_items = 1; int32 max_batch_items = 2; int32 max_message_bytes = 3; int32 max_monitored_items = 4; int32 max_streams = 5; int64 max_pending_bytes = 6; int64 max_metadata_lease_ticks = 7; int64 max_session_lifetime_ticks = 8; int64 write_retry_window_ticks = 9; optional int32 max_value_elements = 10; } message CapabilitiesRequest { int32 protocol_major = 1; int32 protocol_minor = 2; } message CapabilitiesResponse { int32 protocol_major = 1; int32 protocol_minor = 2; Serving serving = 3; int32 readiness = 4; uint32 operations = 5; repeated ValueKind value_kinds = 6; Limits limits = 7; bool compact_batches = 8; int32 compact_codec_version = 9; string cluster_id = 10; bool subscription_age_readiness = 11; bool response_serving_identity = 12; bool write_serving_generation_enforced = 13; } message Metadata { View view = 1; string browse_name = 2; string node_kind = 3; ValueKind value_kind = 4; int32 value_rank = 5; repeated int32 dimensions = 6; bool writable = 7; uint32 allowed_operations = 8; int64 catalog_revision = 9; optional string stable_source_id = 10; optional string engineering_units = 11; bool is_stale = 12; optional ValueKind array_element_kind = 13; } message Lease { int64 catalog_epoch = 1; int64 authority_epoch = 2; int64 duration_ticks = 3; } message BrowseRequest { View parent = 1; optional string filter = 2; optional string continuation = 3; Budget budget = 4; } message BrowseResponse { View parent = 1; int32 status = 2; repeated Metadata items = 3; bool complete = 4; optional string continuation = 5; Lease lease = 6; Serving serving = 7; } message MetadataRequest { repeated View views = 1; Budget budget = 2; } message MetadataResult { string correlation_id = 1; int32 status = 2; Metadata value = 3; optional string diagnostic = 4; } message MetadataResponse { repeated MetadataResult items = 1; Serving serving = 2; } message ReadItem { string correlation_id = 1; View view = 2; optional int64 maximum_age_ticks = 3; } message ReadRequest { repeated ReadItem items = 1; Budget budget = 2; } message ReadResult { string correlation_id = 1; int32 status = 2; int32 readiness = 3; optional int64 age_ticks = 4; Sample sample = 5; optional string diagnostic = 6; } message ReadResponse { repeated ReadResult items = 1; Serving serving = 2; } message WriteItem { string correlation_id = 1; string operation_id = 2; View view = 3; TypedValue value = 4; int64 expected_catalog_revision = 5; string expected_serving_incarnation = 6; int64 remaining_budget_ticks = 7; optional int64 expected_serving_generation = 8; } message WriteRequest { repeated WriteItem items = 1; Budget budget = 2; } message WriteResult { string correlation_id = 1; int32 state = 2; uint32 status_code = 3; optional string diagnostic = 4; } message WriteResponse { repeated WriteResult items = 1; Serving serving = 2; } message Handle { string subscription_id = 1; int64 stream_epoch = 2; uint64 handle = 3; int64 item_revision = 4; } message Settings { int64 sampling_ticks = 1; int64 publishing_ticks = 2; int32 trigger = 3; optional double deadband = 4; } message SubscriptionItem { string client_item_id = 1; View view = 2; Settings settings = 3; } message SubscriptionCommand { string subscription_id = 1; int64 stream_epoch = 2; string command_id = 3; int64 acknowledgement_timeout_ticks = 4; oneof command { Open open = 5; ItemChanges add = 6; ItemChanges modify = 7; HandleChanges remove = 8; } } message Open { repeated SubscriptionItem items = 1; bool watch_catalog_only = 2; int64 session_lifetime_ticks = 3; Budget snapshot_budget = 4; } message ItemChanges { repeated SubscriptionItem items = 1; } message HandleChanges { repeated Handle items = 1; } message ItemAck { string client_item_id = 1; int32 status = 2; Handle handle = 3; Settings revised_settings = 4; optional string diagnostic = 5; } message Ack { string command_id = 1; repeated ItemAck items = 2; } message Watermark { int32 partition_id = 1; int64 version = 2; } message Control { int32 kind = 1; repeated Watermark watermarks = 2; int64 catalog_epoch = 3; int64 authority_epoch = 4; optional string diagnostic = 5; } message ValueUpdate { Handle handle = 1; Sample sample = 2; // Age since normalized origin-cache ingress, not sensor measurement age. optional int64 origin_age_ticks = 3; optional int32 readiness = 4; } message Values { bool is_snapshot = 1; repeated ValueUpdate items = 2; } // Override messages distinguish absent timestamp from an inherited default. message TimestampOverride { google.protobuf.Timestamp value = 1; } message CompactUpdate { uint64 handle = 1; int64 item_revision = 2; int64 version = 3; TypedValue value = 4; optional uint32 status_code = 5; TimestampOverride source_timestamp = 6; TimestampOverride server_timestamp = 7; // Age since normalized origin-cache ingress, not sensor measurement age. optional int64 origin_age_ticks = 8; optional int32 readiness = 9; } message CompactValues { bool is_snapshot = 1; Serving serving = 2; uint32 default_status_code = 3; google.protobuf.Timestamp default_source_timestamp = 4; google.protobuf.Timestamp default_server_timestamp = 5; repeated CompactUpdate items = 6; } message SubscriptionFrame { string subscription_id = 1; int64 stream_epoch = 2; int64 sequence = 3; Serving serving = 8; oneof frame { Ack ack = 4; Control control = 5; Values values = 6; CompactValues compact_values = 7; } }