multiservice.thrift
2 KB
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
namespace cpp multiservice
namespace java pl.waw.ipipan.zil.multiservice.thrift
namespace py multiservice.facade
include "types.thrift"
enum RequestStatus {
PENDING,
IN_PROGRESS,
DONE,
FAILED,
DUMPED
}
enum OptionType {
STRING,
INT,
FLOAT,
BOOLEAN
}
enum ServiceType {
INPUT,
ANNOTATING,
OUTPUT
}
struct RequestPart {
1: string serviceName,
2: map<string, string> options = []
}
struct StringRequest {
1: string text,
2: RequestPart inputSettings,
4: list<RequestPart> processingChain,
5: RequestPart outputSettings
}
struct ObjectRequest {
1: types.TText text,
2: list<RequestPart> processingChain
}
struct DaemonInfo {
1: string serviceName,
2: string host,
3: i32 port,
4: bool active
}
struct OptionInfo {
1: string name,
2: OptionType type,
3: string defaultValue,
4: bool mandatory = false
}
struct ServiceInfo {
1: string name,
2: ServiceType serviceType,
3: list<types.TAnnotationLayer> requiredLayers = [],
4: list<types.TAnnotationLayer> providedLayers,
5: list<OptionInfo> availableOptions = [],
}
exception RequestManagerException {
1: string message
}
service Multiservice {
string putStringRequest(1: StringRequest request),
string putObjectRequest(1: ObjectRequest request),
RequestStatus getRequestStatus(1: string requestToken),
string getResultString(1: string requestToken),
types.TText getResultObject(1: string requestToken),
types.MultiserviceException getException(1: string requestToken),
list<ServiceInfo> getServices(1: ServiceType serviceType),
list<DaemonInfo> getAllDaemons(),
list<DaemonInfo> getDaemons4Service(1: string serviceName),
list<types.TAnnotationLayer> getLayersProvidedByService(1: string serviceName),
list<types.TAnnotationLayer> getLayersRequiredByService(1: string serviceName),
}