summaryrefslogtreecommitdiffstats
path: root/proto/val.proto
blob: 2d65b7c9943a2cc33dd8f93364bac642e5465888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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;
}