summaryrefslogtreecommitdiffstats
path: root/proto/val.proto
diff options
context:
space:
mode:
authorRoger Zanoni <rzanoni@igalia.com>2023-12-28 20:07:05 -0300
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2024-01-29 12:07:20 +0000
commitc323ab8fde212120d8d1914d453afeb55b3576e5 (patch)
tree2f3565da1e623d69297b00d2a5e1e2b261692810 /proto/val.proto
parent5f1b6075982b872b5db4e2195e53d19529278d5c (diff)
Update HVAC app to use grpc-web instead of websockets
Adapt the HTML5 applications to use kuksa.val service Bug-AGL: SPEC-4599 Signed-off-by: Roger Zanoni <rzanoni@igalia.com> Change-Id: I3e36a6c08041db8fb59fd7f20497c1c156bbb2f7
Diffstat (limited to 'proto/val.proto')
-rw-r--r--proto/val.proto115
1 files changed, 115 insertions, 0 deletions
diff --git a/proto/val.proto b/proto/val.proto
new file mode 100644
index 0000000..2d65b7c
--- /dev/null
+++ b/proto/val.proto
@@ -0,0 +1,115 @@
+/********************************************************************************
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License 2.0 which is available at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+syntax = "proto3";
+
+package kuksa.val.v1;
+
+option go_package = "kuksa/val/v1";
+
+import "types.proto";
+
+// Note on authorization:
+// Tokens (auth-token or auth-uuid) are sent as (GRPC / http2) metadata.
+//
+// The auth-token is a JWT compliant token as the examples found here:
+// https://github.com/eclipse/kuksa.val/tree/master/kuksa_certificates/jwt
+//
+// See also https://github.com/eclipse/kuksa.val/blob/master/doc/jwt.md
+//
+// Upon reception of auth-token, server shall generate an auth-uuid in metadata
+// that the client can use instead of auth-token in subsequent calls.
+
+service VAL {
+ // Get entries
+ rpc Get(GetRequest) returns (GetResponse);
+
+ // Set entries
+ rpc Set(SetRequest) returns (SetResponse);
+
+ // Subscribe to a set of entries
+ //
+ // Returns a stream of notifications.
+ //
+ // InvalidArgument is returned if the request is malformed.
+ rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);
+
+ // Shall return information that allows the client to determine
+ // what server/server implementation/version it is talking to
+ // eg. kuksa-databroker 0.5.1
+ rpc GetServerInfo(GetServerInfoRequest) returns (GetServerInfoResponse);
+}
+
+// Define which data we want
+message EntryRequest {
+ string path = 1;
+ View view = 2;
+ repeated Field fields = 3;
+}
+
+// Request a set of entries.
+message GetRequest {
+ repeated EntryRequest entries = 1;
+}
+
+// Global errors are specified in `error`.
+// Errors for individual entries are specified in `errors`.
+message GetResponse {
+ repeated DataEntry entries = 1;
+ repeated DataEntryError errors = 2;
+ Error error = 3;
+}
+
+// Define the data we want to set
+message EntryUpdate {
+ DataEntry entry = 1;
+ repeated Field fields = 2;
+}
+
+// A list of entries to be updated
+message SetRequest {
+ repeated EntryUpdate updates = 1;
+}
+
+// Global errors are specified in `error`.
+// Errors for individual entries are specified in `errors`.
+message SetResponse {
+ Error error = 1;
+ repeated DataEntryError errors = 2;
+}
+
+// Define what to subscribe totime
+message SubscribeEntry {
+ string path = 1;
+ View view = 2;
+ repeated Field fields = 3;
+}
+
+// Subscribe to changes in datapoints.
+message SubscribeRequest {
+ repeated SubscribeEntry entries = 1;
+}
+
+// A subscription response
+message SubscribeResponse {
+ repeated EntryUpdate updates = 1;
+}
+
+message GetServerInfoRequest {
+ // Nothing yet
+}
+
+message GetServerInfoResponse {
+ string name = 1;
+ string version = 2;
+}