-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.proto
119 lines (98 loc) · 2.29 KB
/
messages.proto
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
syntax = "proto3";
option optimize_for = LITE_RUNTIME;
service RegistrationService {
rpc register (RegisterMessage) returns (ResponseMessage) { }
rpc unregister (UnregisterMessage) returns (ResponseMessage) { }
rpc update_status (StatusMessage) returns (ResponseMessage) { }
}
service ManagerAgent {
rpc execute (RequestMessage) returns (ResponseMessage) {}
rpc refresh_resources (UserInfo) returns (ResponseMessage) {}
rpc create_user (UserInfo) returns (UserInfo) {}
rpc delete_user (UserInfo) returns (Empty) {
}
rpc heartbeat (Empty) returns (Empty) {
}
}
message RegisterMessage {
string name = 1;
string endpoint = 2;
string description = 3;
}
message UnregisterMessage {
string name = 1;
string endpoint = 2;
}
message StatusMessage {
repeated Resource resources = 1;
string username = 2;
string manager_name = 3;
}
enum Method {
LIST_RESOURCES = 0;
PROVIDE_RESOURCES = 1;
RELEASE_RESOURCES = 2;
VALIDATE_RESOURCES = 3;
}
enum Result {
Ok = 0;
ERROR = 1;
}
message RequestMessage {
Method method = 1;
string payload = 2;
UserInfo user_info = 3;
}
message ResponseMessage {
Result result = 1;
oneof message {
ListResourceResponse list_resource = 2;
ProvideResourceResponse provide_resource = 3;
RefreshResourceResponse refresh_resource = 4;
}
string error_message = 5;
}
message ListResourceResponse {
repeated ResourceMetadata resources = 1;
}
message ProvideResourceResponse {
repeated Resource resources = 1;
}
message RefreshResourceResponse {
repeated ResourceMetadata resources = 1;
}
message ResourceMetadata {
string resource_id = 1;
string description = 2;
int32 cardinality = 3;
Testbed testbed = 4;
string node_type = 5;
}
enum Testbed {
SURREY = 0;
FOKUS = 1;
DT = 2;
ADS = 3;
ERICSSON = 4;
SURREY_DEV = 5;
FOKUS_DEV = 6;
DT_DEV = 7;
ADS_DEV = 8;
ERICSSON_DEV = 9;
ANY = 10;
TEST = 11;
}
message UserInfo {
string id = 1;
string name = 2;
string password = 3;
string ob_project_id = 4;
// int32 is the vaule of the Testbed enum
map<int32, string> testbed_tenants = 5;
}
message Resource {
string id = 1;
string content = 2;
}
message Empty {
}