blob: 1ca65e738dda12b91472df7ca8e9945c5ed12717 [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001syntax = "proto3";
2
3option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
4package dmi;
5
6import "dmi/commons.proto";
7import "dmi/hw.proto";
Andrea Campanellacb990bc2020-09-22 12:50:56 +02008import "google/protobuf/empty.proto";
Amit Ghosh09f28362020-06-12 21:52:19 +01009
10// Protos for the management of a hardware and it's components
11
12message PhysicalInventoryRequest {
13 Uuid device_uuid = 1;
14}
15
16message PhysicalInventoryResponse {
17 Status status = 1;
18 Reason reason = 2;
19 Hardware inventory = 3;
20}
21
22message HWComponentInfoGetRequest {
23 Uuid device_uuid = 1;
24 Uuid component_uuid = 2;
25 string component_name = 3;
26}
27
aghoshc301dcd2020-09-03 16:55:34 +010028message HWComponentInfoGetResponse {
29 Status status = 1;
30 Reason reason = 2;
31 Component component = 3;
32}
33
Amit Ghosh09f28362020-06-12 21:52:19 +010034message HWComponentInfoSetRequest {
35 Uuid device_uuid = 1;
36 Uuid component_uuid = 2;
37 string component_name = 3;
38 ModifiableComponent changes = 4;
39}
40
41message HWComponentInfoSetResponse {
42 Status status = 1;
43 Reason reason = 2;
44}
45
46message StartManagingDeviceResponse {
47 Status status = 1;
48 Reason reason = 2;
49 Uuid device_uuid = 3;
50}
51
Amit Ghosh366228e2020-07-06 13:46:42 +010052message StopManagingDeviceRequest {
53 string name = 1;
54}
55
56message StopManagingDeviceResponse {
57 Status status = 1;
58 Reason reason = 2;
59}
60
Andrea Campanellacb990bc2020-09-22 12:50:56 +020061message ManagedDevicesResponse {
62 repeated ModifiableComponent devices = 1;
63}
64
amit.ghosh188a84f2020-09-27 20:59:25 +020065message SetLoggingEndpointRequest {
66 Uuid device_uuid = 1;
67 string logging_endpoint = 2;
68 string logging_protocol = 3;
69}
70
71message SetRemoteEndpointResponse {
72 Status status = 1;
73 Reason reason = 2;
74}
75
76message GetLoggingEndpointResponse {
77 Status status = 1;
78 Reason reason = 2;
79 string logging_endpoint = 3;
80 string logging_protocol = 4;
81}
82
83message SetMsgBusEndpointRequest {
84 string msgbus_endpoint = 1;
85}
86
87message GetMsgBusEndpointResponse {
88 Status status = 1;
89 Reason reason = 2;
90 string msgbus_endpoint = 3;
91}
92
Andrea Campanellab91e9a42020-10-09 14:31:43 +020093message EntitiesLogLevel {
94 LogLevel logLevel = 1;
95 repeated string entities = 2;
96}
97
98message SetLogLevelRequest {
99 Uuid device_uuid = 1;
100 repeated EntitiesLogLevel loglevels = 2;
101}
102
103message SetLogLevelResponse {
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200104 Uuid device_uuid = 1;
105 Status status = 2;
106 Reason reason = 3;
107}
108
109message GetLogLevelRequest {
110 Uuid device_uuid = 1;
111 repeated string entities = 2;
112}
113
114message GetLogLevelResponse {
115 Uuid device_uuid = 1;
116 repeated EntitiesLogLevel logLevels = 2;
117 Status status = 3;
118 Reason reason = 4;
119}
120
121message GetLoggableEntitiesRequest {
122 Uuid device_uuid = 1;
123}
124
125
126
Amit Ghosh09f28362020-06-12 21:52:19 +0100127service NativeHWManagementService {
128 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100129 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
130 // and their meanings in this context is mentioned below:
131 // name = The unique name that needs to be assigned to this hardware;
132 // class = COMPONENT_TYPE_UNDEFINED;
133 // parent = nil;
134 // alias = Optional;
135 // asset_id = Optional;
136 // uri = IP Address of the Hardware;
137 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100138
Amit Ghosh366228e2020-07-06 13:46:42 +0100139 // Stop management of a device and clean up any context and caches for that device
140 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
141
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200142 // Returns an object containing a list of devices managed by this entity
143 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
144
Amit Ghosh09f28362020-06-12 21:52:19 +0100145 // Get the HW inventory details of the Device
146 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
147
148 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100149 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100150
151 // Sets the permissible attributes of a HW component
152 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200153
154 // Sets the location to which logs need to be shipped
155 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
156
157 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100158 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200159
160 // Sets the location of the Message Bus to which events and metrics are shipped
161 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
162
163 // Gets the configured location to which the events and metrics are being shipped
164 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200165
166 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
167 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
168 // interface, package etc.
169 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
170
amit.ghosh5d97dba2020-11-12 16:45:27 +0100171 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200172 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
173 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
174 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
175
176 // Gets the configured log level for a certain entity on a certain device.
177 // If no entity is specified in the request all the entities with their log level should be returned.
178 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100179}