blob: e8e9ccc82e24451fbe87b8debe4355c52fd501f1 (
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
/* This Protocol Buffer has been updated for supporting TOSCA-based objects.
* The only granularity for executing CRUD operations is at the TopologyTemplate level.
*
* The names of the objects are assigned according to the TOSCA standard, and can be
* mapped as follows in the Verigraph domain:
* TopologyTemplate -> Graph
* NodeTemplate -> Node
* RelationshipTemplate -> Neighbour (partial)
*/
syntax = "proto3";
package verigraph;
option java_multiple_files = true;
option java_package = "it.polito.verigraph.grpc";
option java_outer_classname = "VerigraphProto";
/** gRPC */
service Verigraph {
// Obtains a list of graphs
rpc GetGraphs (GetRequest) returns (stream GraphGrpc) {}
// Obtains a graph
rpc GetGraph (RequestID) returns (GraphGrpc) {}
// Obtains a list of Nodes
rpc GetNodes (RequestID) returns (stream NodeGrpc) {}
// Obtains a node
rpc GetNode (RequestID) returns (NodeGrpc) {}
// Obtains a list of Neighbours
rpc GetNeighbours (RequestID) returns (stream NeighbourGrpc) {}
// Obtains a Neighbour
rpc GetNeighbour (RequestID) returns (NeighbourGrpc) {}
// Creates a graph
rpc CreateGraph (GraphGrpc) returns (NewGraph) {}
// Delete a graph
rpc DeleteGraph (RequestID) returns (Status) {}
// Updates a graph
rpc UpdateGraph (GraphGrpc) returns (NewGraph) {}
// Verify a policy
rpc VerifyPolicy (Policy) returns (VerificationGrpc) {}
// Creates a Node
rpc CreateNode (NodeGrpc) returns (NewNode) {}
// Delete a Node
rpc DeleteNode (RequestID) returns (Status) {}
// Updates a Node
rpc UpdateNode (NodeGrpc) returns (NewNode) {}
// Configures a Node
rpc ConfigureNode (ConfigurationGrpc) returns (Status) {}
// Creates a neighbour
rpc CreateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
// Delete a neighbour
rpc DeleteNeighbour (RequestID) returns (Status) {}
// Updates a neighbour
rpc UpdateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
/** TOSCA gRPC */
// Obtain a list of topology templates
rpc GetTopologyTemplates (GetRequest) returns (stream TopologyTemplateGrpc) {}
// Obtain a topology template
rpc GetTopologyTemplate (ToscaRequestID) returns (TopologyTemplateGrpc) {}
// Create a TopologyTemplate
rpc CreateTopologyTemplate (TopologyTemplateGrpc) returns (NewTopologyTemplate) {}
// Delete a TopologyTemplate
rpc DeleteTopologyTemplate (ToscaRequestID) returns (Status) {}
// Update a TopologyTemplate
rpc UpdateTopologyTemplate (TopologyTemplateGrpc) returns (NewTopologyTemplate) {}
// Verify a ToscaPolicy
rpc VerifyToscaPolicy (ToscaPolicy) returns (ToscaVerificationGrpc) {}
}
/** Messages */
message GetRequest {
}
message RequestID {
int64 idGraph = 1;
int64 idNode = 2;
int64 idNeighbour = 3;
}
message Policy{
int64 idGraph = 1;
string source = 2;
string destination = 3;
enum PolicyType {
reachability = 0;
isolation = 1;
traversal = 2;
}
PolicyType type = 4;
string middlebox = 5;
}
message ConfigurationGrpc{
int64 idGraph = 1;
int64 idNode = 2;
string description = 3;
string configuration = 4;
string id = 5;
}
message NodeGrpc{
int64 idGraph = 1;
string name = 2;
int64 id = 3;//long
enum FunctionalType {
antispam = 0;
cache = 1;
dpi = 2;
endhost = 3;
endpoint = 4;
fieldmodifier = 5;
firewall = 6;
mailclient = 7;
mailserver = 8;
nat = 9;
vpnaccess = 10;
vpnexit = 11;
webclient = 12;
webserver = 13;
}
FunctionalType functional_type = 4;
repeated NeighbourGrpc neighbour = 5;
ConfigurationGrpc configuration = 6;
string errorMessage = 7;
}
message GraphGrpc{
int64 id = 1;//long
repeated NodeGrpc node = 2;
string errorMessage = 3;
}
message NeighbourGrpc{
int64 idGraph = 1;
int64 idNode = 2;
string name = 3;
int64 id = 4;//long
string errorMessage = 5;
}
message NewGraph{
bool success = 1;
GraphGrpc graph = 2;
string errorMessage = 3;
}
message NewNode{
bool success = 1;
NodeGrpc node = 2;
string errorMessage = 3;
}
message NewNeighbour{
bool success = 1;
NeighbourGrpc neighbour = 2;
string errorMessage = 3;
}
message TestGrpc {
repeated NodeGrpc node = 1;
string result = 2;
}
message VerificationGrpc{
bool successOfOperation = 1;
string result = 2;
string comment = 3;
repeated TestGrpc test = 4;
string errorMessage = 5;
}
message Status{
bool success = 1;
string errorMessage = 2;
}
/** TOSCA Messages */
message ToscaRequestID {
string idTopologyTemplate = 1;
}
message TopologyTemplateGrpc{
string id = 1;
string name = 2;
repeated NodeTemplateGrpc nodeTemplate = 3;
repeated RelationshipTemplateGrpc relationshipTemplate = 4;
string errorMessage = 5;
}
message NewTopologyTemplate{
bool success = 1;
TopologyTemplateGrpc topologyTemplate = 2;
string errorMessage = 3;
}
message NodeTemplateGrpc{
string id = 1;
string name = 2;
enum Type {
antispam = 0;
cache = 1;
dpi = 2;
endhost = 3;
endpoint = 4;
fieldmodifier = 5;
firewall = 6;
mailclient = 7;
mailserver = 8;
nat = 9;
vpnaccess = 10;
vpnexit = 11;
webclient = 12;
webserver = 13;
}
Type type = 3;
ToscaConfigurationGrpc configuration = 4;
string errorMessage = 5;
}
message RelationshipTemplateGrpc{
string idSourceNodeTemplate = 1;
string idTargetNodeTemplate = 2;
string id = 3;
string name = 4;
string errorMessage = 5;
}
message ToscaPolicy{
string idTopologyTemplate = 1;
string source = 2;
string destination = 3;
enum PolicyType {
reachability = 0;
isolation = 1;
traversal = 2;
}
PolicyType type = 4;
string middlebox = 5;
}
message ToscaConfigurationGrpc{
string id = 1;
string description = 2;
string configuration = 3;
}
message ToscaTestGrpc {
repeated NodeTemplateGrpc nodeTemplate = 1;
string result = 2;
}
message ToscaVerificationGrpc{
bool successOfOperation = 1;
string result = 2;
string comment = 3;
repeated ToscaTestGrpc test = 4;
string errorMessage = 5;
}
|