Merge "update verigraph"
[parser.git] / verigraph / src / main / proto / verigraph.proto
1 syntax = "proto3";
2
3 package verigraph;
4
5 option java_multiple_files = true;
6 option java_package = "it.polito.verigraph.grpc";
7 option java_outer_classname = "VerigraphProto";
8
9 // The service definition.
10 service Verigraph {
11   // Obtains a list of graphs
12   rpc GetGraphs (GetRequest) returns (stream GraphGrpc) {}
13   // Obtains a graph
14   rpc GetGraph (RequestID) returns (GraphGrpc) {}
15   // Obtains a list of Nodes
16   rpc GetNodes (RequestID) returns (stream NodeGrpc) {}
17   // Obtains a node
18   rpc GetNode (RequestID) returns (NodeGrpc) {}
19   // Obtains a list of Neighbours
20   rpc GetNeighbours (RequestID) returns (stream NeighbourGrpc) {}
21   // Obtains a Neighbour
22   rpc GetNeighbour (RequestID) returns (NeighbourGrpc) {}
23
24   // Creates a graph
25   rpc CreateGraph (GraphGrpc) returns (NewGraph) {}
26   // Delete a graph
27   rpc DeleteGraph (RequestID) returns (Status) {}
28   // Updates a graph
29   rpc UpdateGraph (GraphGrpc) returns (NewGraph) {}
30   // Verify a policy
31   rpc VerifyPolicy (Policy) returns (VerificationGrpc) {}
32
33   // Creates a Node
34   rpc CreateNode (NodeGrpc) returns (NewNode) {}
35   // Delete a Node
36   rpc DeleteNode (RequestID) returns (Status) {}
37   // Updates a Node
38   rpc UpdateNode (NodeGrpc) returns (NewNode) {}
39   // Configures a Node
40   rpc ConfigureNode (ConfigurationGrpc) returns (Status) {}
41
42   // Creates a neighbour
43   rpc CreateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
44   // Delete a neighbour
45   rpc DeleteNeighbour (RequestID) returns (Status) {}
46   // Updates a neighbour
47   rpc UpdateNeighbour (NeighbourGrpc) returns (NewNeighbour) {}
48 }
49
50 message GetRequest {
51 }
52
53 message RequestID {
54   int64 idGraph = 1;
55   int64 idNode = 2;
56   int64 idNeighbour = 3;
57 }
58
59 message Policy{
60 int64 idGraph = 1;
61 string source = 2;
62   string destination = 3;
63   enum PolicyType {
64    reachability = 0;
65    isolation = 1;
66    traversal = 2;
67 }
68 PolicyType type = 4;
69 string middlebox = 5;
70 }
71
72 message ConfigurationGrpc{
73 int64 idGraph = 1;
74 int64 idNode = 2;
75 string description = 3;
76 string configuration = 4;
77 string id = 5;
78 }
79
80 message NodeGrpc{
81 int64 idGraph = 1;
82 string name = 2;
83 int64 id = 3;//long
84 enum FunctionalType {
85 antispam = 0;
86    cache = 1;
87    dpi = 2;
88    endhost = 3;
89    endpoint = 4;
90    fieldmodifier = 5;
91    firewall = 6;
92    mailclient = 7;
93    mailserver = 8;
94    nat = 9;
95    vpnaccess = 10;
96    vpnexit = 11;
97    webclient = 12;
98    webserver = 13;
99 }
100 FunctionalType functional_type = 4;
101 repeated NeighbourGrpc neighbour = 5;
102 ConfigurationGrpc configuration = 6;
103 string errorMessage = 7;
104 }
105
106 message GraphGrpc{
107 int64 id = 1;//long
108 repeated NodeGrpc node = 2;
109 string errorMessage = 3;
110 }
111
112 message NeighbourGrpc{
113 int64 idGraph = 1;
114   int64 idNode = 2;
115 string name = 3;
116   int64 id = 4;//long
117   string errorMessage = 5;
118 }
119
120 message NewGraph{
121 bool success = 1;
122 GraphGrpc graph = 2;
123 string errorMessage = 3;
124 }
125
126 message NewNode{
127 bool success = 1;
128 NodeGrpc node = 2;
129 string errorMessage = 3;
130 }
131
132 message NewNeighbour{
133 bool success = 1;
134 NeighbourGrpc neighbour = 2;
135 string errorMessage = 3;
136 }
137
138 message TestGrpc {
139   repeated NodeGrpc node = 1;
140   string result = 2;
141 }
142
143 message VerificationGrpc{
144 bool successOfOperation = 1;
145 string result = 2;
146 string comment = 3;
147 repeated TestGrpc test = 4;
148 string errorMessage = 5;
149 }
150
151 message Status{
152 bool success = 1;
153 string errorMessage = 2;
154 }