blob: a805b036a034131cd98ff421669ef2f7183545bb [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 {
104 repeated DeviceLogResponse responses = 1;
105}
106
107message DeviceLogResponse{
108 Uuid device_uuid = 1;
109 Status status = 2;
110 Reason reason = 3;
111}
112
113message GetLogLevelRequest {
114 Uuid device_uuid = 1;
115 repeated string entities = 2;
116}
117
118message GetLogLevelResponse {
119 Uuid device_uuid = 1;
120 repeated EntitiesLogLevel logLevels = 2;
121 Status status = 3;
122 Reason reason = 4;
123}
124
125message GetLoggableEntitiesRequest {
126 Uuid device_uuid = 1;
127}
128
129
130
Amit Ghosh09f28362020-06-12 21:52:19 +0100131service NativeHWManagementService {
132 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100133 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
134 // and their meanings in this context is mentioned below:
135 // name = The unique name that needs to be assigned to this hardware;
136 // class = COMPONENT_TYPE_UNDEFINED;
137 // parent = nil;
138 // alias = Optional;
139 // asset_id = Optional;
140 // uri = IP Address of the Hardware;
141 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100142
Amit Ghosh366228e2020-07-06 13:46:42 +0100143 // Stop management of a device and clean up any context and caches for that device
144 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
145
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200146 // Returns an object containing a list of devices managed by this entity
147 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
148
Amit Ghosh09f28362020-06-12 21:52:19 +0100149 // Get the HW inventory details of the Device
150 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
151
152 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100153 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100154
155 // Sets the permissible attributes of a HW component
156 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200157
158 // Sets the location to which logs need to be shipped
159 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
160
161 // Gets the configured location to which the logs are being shipped
162 rpc GetLoggingEndpoint(Uuid) returns(GetLoggingEndpointResponse);
163
164 // Sets the location of the Message Bus to which events and metrics are shipped
165 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
166
167 // Gets the configured location to which the events and metrics are being shipped
168 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200169
170 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
171 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
172 // interface, package etc.
173 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
174
175 // Sets the log level for one or more devices for each given entity to a certain level.
176 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
177 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
178 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
179
180 // Gets the configured log level for a certain entity on a certain device.
181 // If no entity is specified in the request all the entities with their log level should be returned.
182 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100183}