@@ -6,10 +6,179 @@ option go_package = "golang.anshulg.com/popcorntime/go_encoder/api/proto";
6
6
7
7
service WorkerService {
8
8
rpc Status (WorkerStatusRequest ) returns (WorkerStatusResponse ) {}
9
+ rpc Info (WorkerInfoRequest ) returns (WorkerInfoResponse ) {}
9
10
}
10
11
11
12
message WorkerStatusRequest {}
12
-
13
13
message WorkerStatusResponse {
14
14
string msg = 1 ;
15
+ }
16
+
17
+ message WorkerInfoRequest {}
18
+ message WorkerInfoResponse {
19
+ reserved 4 ;
20
+ MemoryInfo memory = 1 ;
21
+ CPUInfo cpu = 2 ;
22
+ StorageInfo storage = 3 ;
23
+ // TopologyInfo topology = 4;
24
+ NetworkInfo network = 5 ;
25
+ PCIInfo pci = 6 ;
26
+ GPUInfo gpu = 7 ;
27
+ }
28
+
29
+ message MemoryInfo {
30
+ uint64 physical = 1 ;
31
+ uint64 usable = 2 ;
32
+ }
33
+
34
+ message CPUInfo {
35
+ uint32 cores = 1 ;
36
+ uint32 threads = 2 ;
37
+
38
+ message Processor {
39
+ int32 id = 1 ;
40
+ uint32 numCores = 2 ;
41
+ uint32 numThreads = 3 ;
42
+ string vendor = 4 ;
43
+ string model = 5 ;
44
+ repeated string capabilities = 6 ;
45
+
46
+ message Core {
47
+ int32 id = 1 ;
48
+ int32 index = 2 ;
49
+ uint32 numThreads = 3 ;
50
+ repeated int32 logicalProcessors = 4 ;
51
+ }
52
+ repeated Core cores = 7 ;
53
+ }
54
+ repeated Processor processors = 3 ;
55
+ }
56
+
57
+ message StorageInfo {
58
+ uint64 totalBytes = 1 ;
59
+ repeated Disk disks = 2 ;
60
+
61
+ message Disk {
62
+ string name = 1 ;
63
+ uint64 sizeBytes = 2 ;
64
+ uint64 physicalBlockSizeBytes = 3 ;
65
+ bool isRemovable = 4 ;
66
+ DriveType driveType = 5 ;
67
+ StorageController storageController = 6 ;
68
+ sint32 numaNodeID = 7 ;
69
+ string vendor = 8 ;
70
+ string model = 9 ;
71
+ string serialNumber = 10 ;
72
+ string wwn = 11 ;
73
+ repeated Partition partitions = 12 ;
74
+
75
+ enum StorageController {
76
+ UNKNOWN = 0 ;
77
+ SCSI = 1 ;
78
+ IDE = 2 ;
79
+ VIRTIO = 3 ;
80
+ MMC = 4 ;
81
+ NVME = 5 ;
82
+ }
83
+ message Partition {
84
+ string name = 1 ;
85
+ uint64 sizeBytes = 2 ;
86
+ string mountPoint = 3 ;
87
+ string type = 4 ;
88
+ bool isReadOnly = 5 ;
89
+ string uuid = 6 ;
90
+ }
91
+ }
92
+ }
93
+
94
+ enum DriveType {
95
+ UNKNOWN = 0 ;
96
+ HDD = 1 ;
97
+ FDD = 2 ;
98
+ ODD = 3 ;
99
+ SSD = 4 ;
100
+ }
101
+
102
+ message TopologyInfo {
103
+ Architecture architecture = 1 ;
104
+ repeated Node nodes = 2 ;
105
+
106
+ enum Architecture {
107
+ NUMA = 0 ;
108
+ SMP = 1 ;
109
+ }
110
+ message Node {
111
+ int32 id = 1 ;
112
+ }
113
+ }
114
+
115
+ message NetworkInfo {
116
+ message NIC {
117
+ string name = 1 ;
118
+ string macAddress = 2 ;
119
+ bool isVirtual = 3 ;
120
+ repeated NICCapability capabilities = 4 ;
121
+ string PCIAddress = 5 ;
122
+
123
+ message NICCapability {
124
+ string name = 1 ;
125
+ bool isEnabled = 2 ;
126
+ bool canEnable = 3 ;
127
+ }
128
+ }
129
+
130
+ repeated NIC controllers = 1 ;
131
+ }
132
+
133
+ message PCIInfo {
134
+ message Device {
135
+ Vendor vendor = 1 ;
136
+ Vendor.Product product = 2 ;
137
+ Vendor.Product subsystem = 3 ;
138
+ Class class = 4 ;
139
+ Class.SubClass subclass = 5 ;
140
+ Class.ProgrammingInterface pi = 6 ;
141
+ string driver = 7 ;
142
+ }
143
+ repeated Device devices = 1 ;
144
+
145
+ message Class {
146
+ string id = 1 ;
147
+ string name = 2 ;
148
+ repeated SubClass subclasses = 3 ;
149
+
150
+ message SubClass {
151
+ string id = 1 ;
152
+ string name = 2 ;
153
+ repeated ProgrammingInterface pInterfaces = 3 ;
154
+ }
155
+
156
+ message ProgrammingInterface {
157
+ string id = 1 ;;
158
+ string name = 2 ;
159
+ }
160
+ }
161
+
162
+ message Vendor {
163
+ string id = 1 ;
164
+ string name = 2 ;
165
+ repeated Product products = 3 ;
166
+
167
+ message Product {
168
+ string vendorId = 1 ;
169
+ string id = 2 ;
170
+ string name = 3 ;
171
+ repeated Product subsystems = 4 ;
172
+ }
173
+ }
174
+ }
175
+
176
+ message GPUInfo {
177
+ message Card {
178
+ uint32 index = 1 ;
179
+ string address = 2 ;
180
+ PCIInfo.Device device = 3 ;
181
+ TopologyInfo.Node node = 4 ;
182
+ }
183
+ repeated Card card = 1 ;
15
184
}
0 commit comments