blob: 382bf2ac277774779408a56906dc7c23be835dee [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001// Code generated by protoc-gen-go. DO NOT EDIT.
2// source: dmi/sw_management_service.proto
3
4package dmi
5
6import (
7 context "context"
8 fmt "fmt"
9 proto "github.com/golang/protobuf/proto"
10 grpc "google.golang.org/grpc"
11 math "math"
12)
13
14// Reference imports to suppress errors if they are not otherwise used.
15var _ = proto.Marshal
16var _ = fmt.Errorf
17var _ = math.Inf
18
19// This is a compile-time assertion to ensure that this generated file
20// is compatible with the proto package it is being compiled against.
21// A compilation error at this line likely means your copy of the
22// proto package needs to be updated.
23const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
24
25type SoftwareVersionInformation struct {
26 ActiveVersions []*ImageVersion `protobuf:"bytes,1,rep,name=active_versions,json=activeVersions,proto3" json:"active_versions,omitempty"`
27 StandbyVersions []*ImageVersion `protobuf:"bytes,2,rep,name=standby_versions,json=standbyVersions,proto3" json:"standby_versions,omitempty"`
28 XXX_NoUnkeyedLiteral struct{} `json:"-"`
29 XXX_unrecognized []byte `json:"-"`
30 XXX_sizecache int32 `json:"-"`
31}
32
33func (m *SoftwareVersionInformation) Reset() { *m = SoftwareVersionInformation{} }
34func (m *SoftwareVersionInformation) String() string { return proto.CompactTextString(m) }
35func (*SoftwareVersionInformation) ProtoMessage() {}
36func (*SoftwareVersionInformation) Descriptor() ([]byte, []int) {
37 return fileDescriptor_000929e4bec891d7, []int{0}
38}
39
40func (m *SoftwareVersionInformation) XXX_Unmarshal(b []byte) error {
41 return xxx_messageInfo_SoftwareVersionInformation.Unmarshal(m, b)
42}
43func (m *SoftwareVersionInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
44 return xxx_messageInfo_SoftwareVersionInformation.Marshal(b, m, deterministic)
45}
46func (m *SoftwareVersionInformation) XXX_Merge(src proto.Message) {
47 xxx_messageInfo_SoftwareVersionInformation.Merge(m, src)
48}
49func (m *SoftwareVersionInformation) XXX_Size() int {
50 return xxx_messageInfo_SoftwareVersionInformation.Size(m)
51}
52func (m *SoftwareVersionInformation) XXX_DiscardUnknown() {
53 xxx_messageInfo_SoftwareVersionInformation.DiscardUnknown(m)
54}
55
56var xxx_messageInfo_SoftwareVersionInformation proto.InternalMessageInfo
57
58func (m *SoftwareVersionInformation) GetActiveVersions() []*ImageVersion {
59 if m != nil {
60 return m.ActiveVersions
61 }
62 return nil
63}
64
65func (m *SoftwareVersionInformation) GetStandbyVersions() []*ImageVersion {
66 if m != nil {
67 return m.StandbyVersions
68 }
69 return nil
70}
71
72type DownloadImageRequest struct {
73 DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
74 ImageInfo *ImageInformation `protobuf:"bytes,2,opt,name=image_info,json=imageInfo,proto3" json:"image_info,omitempty"`
75 XXX_NoUnkeyedLiteral struct{} `json:"-"`
76 XXX_unrecognized []byte `json:"-"`
77 XXX_sizecache int32 `json:"-"`
78}
79
80func (m *DownloadImageRequest) Reset() { *m = DownloadImageRequest{} }
81func (m *DownloadImageRequest) String() string { return proto.CompactTextString(m) }
82func (*DownloadImageRequest) ProtoMessage() {}
83func (*DownloadImageRequest) Descriptor() ([]byte, []int) {
84 return fileDescriptor_000929e4bec891d7, []int{1}
85}
86
87func (m *DownloadImageRequest) XXX_Unmarshal(b []byte) error {
88 return xxx_messageInfo_DownloadImageRequest.Unmarshal(m, b)
89}
90func (m *DownloadImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
91 return xxx_messageInfo_DownloadImageRequest.Marshal(b, m, deterministic)
92}
93func (m *DownloadImageRequest) XXX_Merge(src proto.Message) {
94 xxx_messageInfo_DownloadImageRequest.Merge(m, src)
95}
96func (m *DownloadImageRequest) XXX_Size() int {
97 return xxx_messageInfo_DownloadImageRequest.Size(m)
98}
99func (m *DownloadImageRequest) XXX_DiscardUnknown() {
100 xxx_messageInfo_DownloadImageRequest.DiscardUnknown(m)
101}
102
103var xxx_messageInfo_DownloadImageRequest proto.InternalMessageInfo
104
105func (m *DownloadImageRequest) GetDeviceUuid() *Uuid {
106 if m != nil {
107 return m.DeviceUuid
108 }
109 return nil
110}
111
112func (m *DownloadImageRequest) GetImageInfo() *ImageInformation {
113 if m != nil {
114 return m.ImageInfo
115 }
116 return nil
117}
118
119func init() {
120 proto.RegisterType((*SoftwareVersionInformation)(nil), "dmi.SoftwareVersionInformation")
121 proto.RegisterType((*DownloadImageRequest)(nil), "dmi.DownloadImageRequest")
122}
123
124func init() { proto.RegisterFile("dmi/sw_management_service.proto", fileDescriptor_000929e4bec891d7) }
125
126var fileDescriptor_000929e4bec891d7 = []byte{
127 // 387 bytes of a gzipped FileDescriptorProto
128 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0xaf, 0xd2, 0x30,
129 0x18, 0xc5, 0x33, 0x48, 0x4c, 0x28, 0x22, 0xd8, 0x60, 0x82, 0x7b, 0x81, 0xf0, 0x44, 0x4c, 0xd8,
130 0x0c, 0xf0, 0xa2, 0x18, 0x13, 0x0d, 0x51, 0x79, 0xd0, 0x87, 0x4d, 0x7d, 0xf0, 0x65, 0x29, 0xeb,
131 0xb7, 0xd1, 0xc4, 0xb6, 0xd8, 0x76, 0x9b, 0xfe, 0x23, 0x3e, 0xf9, 0xc7, 0x9a, 0xb5, 0xc3, 0x79,
132 0xef, 0xe5, 0xde, 0xdc, 0xb7, 0xed, 0xf4, 0xfc, 0xbe, 0xf6, 0x9c, 0x7c, 0x68, 0x4a, 0x39, 0x0b,
133 0x75, 0x95, 0x70, 0x22, 0x48, 0x0e, 0x1c, 0x84, 0x49, 0x34, 0xa8, 0x92, 0xa5, 0x10, 0x9c, 0x94,
134 0x34, 0x12, 0x77, 0x29, 0x67, 0xfe, 0xc3, 0xda, 0x75, 0xac, 0x9c, 0xe4, 0xe3, 0x86, 0x61, 0x9c,
135 0xe4, 0x8d, 0x6d, 0xfe, 0xdb, 0x43, 0x7e, 0x2c, 0x33, 0x53, 0x11, 0x05, 0x5f, 0x41, 0x69, 0x26,
136 0xc5, 0x5e, 0x64, 0x52, 0x71, 0x62, 0x98, 0x14, 0xf8, 0x25, 0x1a, 0x92, 0xd4, 0xb0, 0x12, 0x92,
137 0xd2, 0x1d, 0xea, 0x89, 0x37, 0xeb, 0x2e, 0xfa, 0xab, 0xc7, 0x01, 0xe5, 0x2c, 0xd8, 0xd7, 0x93,
138 0x1a, 0x2c, 0x7a, 0xe4, 0x9c, 0xcd, 0xaf, 0xc6, 0xaf, 0xd0, 0x48, 0x1b, 0x22, 0xe8, 0xe1, 0x57,
139 0x0b, 0x77, 0x6e, 0x83, 0x87, 0x8d, 0xf5, 0x4c, 0xcf, 0x7f, 0xa2, 0xf1, 0x4e, 0x56, 0xe2, 0xbb,
140 0x24, 0xd4, 0x1a, 0x23, 0xf8, 0x51, 0x80, 0x36, 0xf8, 0x19, 0xea, 0x53, 0xa8, 0x73, 0x26, 0x45,
141 0xc1, 0xe8, 0xc4, 0x9b, 0x79, 0x8b, 0xfe, 0xaa, 0x67, 0x07, 0x7e, 0x29, 0x18, 0x8d, 0x90, 0x3b,
142 0xad, 0xbf, 0xf1, 0x06, 0x21, 0x9b, 0x35, 0x61, 0x22, 0x93, 0x93, 0x8e, 0xb5, 0x3e, 0x69, 0xef,
143 0xfe, 0x2f, 0x68, 0xd4, 0x63, 0x67, 0x65, 0xf5, 0xa7, 0x83, 0xa6, 0x9f, 0x48, 0x1d, 0xe5, 0x5c,
144 0xcc, 0xc7, 0x7f, 0x25, 0xc7, 0xae, 0x63, 0xfc, 0x0e, 0xe1, 0xf7, 0x60, 0xae, 0x15, 0x87, 0x87,
145 0x76, 0xf6, 0x07, 0xa2, 0x68, 0xad, 0xee, 0x77, 0xfe, 0xd4, 0x0a, 0x77, 0xf4, 0xfb, 0x1a, 0x0d,
146 0xae, 0xa4, 0xc4, 0x4f, 0x2d, 0x71, 0x29, 0xb9, 0x3f, 0x6a, 0x5f, 0x1e, 0x1b, 0x62, 0x0a, 0xfd,
147 0xdc, 0xc3, 0x1b, 0x34, 0x78, 0x53, 0xb7, 0x4e, 0x0c, 0x38, 0xfe, 0xc6, 0x13, 0x2e, 0x51, 0x5b,
148 0x34, 0x8e, 0xa0, 0x04, 0x65, 0x3e, 0xcb, 0xd8, 0xd5, 0x7e, 0x7f, 0xf8, 0xed, 0xf6, 0xdb, 0x8b,
149 0x9c, 0x99, 0x63, 0x71, 0x08, 0x52, 0xc9, 0x43, 0x79, 0x02, 0x91, 0x4a, 0x45, 0x43, 0x57, 0xfb,
150 0xb2, 0xdd, 0xc7, 0x25, 0x13, 0x06, 0x54, 0x46, 0x52, 0x08, 0xcb, 0x75, 0x98, 0xcb, 0x90, 0x72,
151 0x76, 0x78, 0x60, 0xb7, 0x6e, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x4a, 0xed, 0x39, 0xbf,
152 0x02, 0x00, 0x00,
153}
154
155// Reference imports to suppress errors if they are not otherwise used.
156var _ context.Context
157var _ grpc.ClientConn
158
159// This is a compile-time assertion to ensure that this generated file
160// is compatible with the grpc package it is being compiled against.
161const _ = grpc.SupportPackageIsVersion4
162
163// NativeSoftwareManagementServiceClient is the client API for NativeSoftwareManagementService service.
164//
165// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
166type NativeSoftwareManagementServiceClient interface {
167 // Get the software version information of the Active and Standby images
168 GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*SoftwareVersionInformation, error)
169 // Downloads and installs the image in the standby partition, returns the status/progress of the Install
170 DownloadImage(ctx context.Context, in *DownloadImageRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_DownloadImageClient, error)
171 // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
172 // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
173 // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
174 ActivateImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_ActivateImageClient, error)
175 // Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
176 // This API is to be used if operator wants to go back to the pervious software
177 RevertToStandbyImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_RevertToStandbyImageClient, error)
178}
179
180type nativeSoftwareManagementServiceClient struct {
181 cc *grpc.ClientConn
182}
183
184func NewNativeSoftwareManagementServiceClient(cc *grpc.ClientConn) NativeSoftwareManagementServiceClient {
185 return &nativeSoftwareManagementServiceClient{cc}
186}
187
188func (c *nativeSoftwareManagementServiceClient) GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*SoftwareVersionInformation, error) {
189 out := new(SoftwareVersionInformation)
190 err := c.cc.Invoke(ctx, "/dmi.NativeSoftwareManagementService/GetSoftwareVersion", in, out, opts...)
191 if err != nil {
192 return nil, err
193 }
194 return out, nil
195}
196
197func (c *nativeSoftwareManagementServiceClient) DownloadImage(ctx context.Context, in *DownloadImageRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_DownloadImageClient, error) {
198 stream, err := c.cc.NewStream(ctx, &_NativeSoftwareManagementService_serviceDesc.Streams[0], "/dmi.NativeSoftwareManagementService/DownloadImage", opts...)
199 if err != nil {
200 return nil, err
201 }
202 x := &nativeSoftwareManagementServiceDownloadImageClient{stream}
203 if err := x.ClientStream.SendMsg(in); err != nil {
204 return nil, err
205 }
206 if err := x.ClientStream.CloseSend(); err != nil {
207 return nil, err
208 }
209 return x, nil
210}
211
212type NativeSoftwareManagementService_DownloadImageClient interface {
213 Recv() (*ImageStatus, error)
214 grpc.ClientStream
215}
216
217type nativeSoftwareManagementServiceDownloadImageClient struct {
218 grpc.ClientStream
219}
220
221func (x *nativeSoftwareManagementServiceDownloadImageClient) Recv() (*ImageStatus, error) {
222 m := new(ImageStatus)
223 if err := x.ClientStream.RecvMsg(m); err != nil {
224 return nil, err
225 }
226 return m, nil
227}
228
229func (c *nativeSoftwareManagementServiceClient) ActivateImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_ActivateImageClient, error) {
230 stream, err := c.cc.NewStream(ctx, &_NativeSoftwareManagementService_serviceDesc.Streams[1], "/dmi.NativeSoftwareManagementService/ActivateImage", opts...)
231 if err != nil {
232 return nil, err
233 }
234 x := &nativeSoftwareManagementServiceActivateImageClient{stream}
235 if err := x.ClientStream.SendMsg(in); err != nil {
236 return nil, err
237 }
238 if err := x.ClientStream.CloseSend(); err != nil {
239 return nil, err
240 }
241 return x, nil
242}
243
244type NativeSoftwareManagementService_ActivateImageClient interface {
245 Recv() (*ImageStatus, error)
246 grpc.ClientStream
247}
248
249type nativeSoftwareManagementServiceActivateImageClient struct {
250 grpc.ClientStream
251}
252
253func (x *nativeSoftwareManagementServiceActivateImageClient) Recv() (*ImageStatus, error) {
254 m := new(ImageStatus)
255 if err := x.ClientStream.RecvMsg(m); err != nil {
256 return nil, err
257 }
258 return m, nil
259}
260
261func (c *nativeSoftwareManagementServiceClient) RevertToStandbyImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_RevertToStandbyImageClient, error) {
262 stream, err := c.cc.NewStream(ctx, &_NativeSoftwareManagementService_serviceDesc.Streams[2], "/dmi.NativeSoftwareManagementService/RevertToStandbyImage", opts...)
263 if err != nil {
264 return nil, err
265 }
266 x := &nativeSoftwareManagementServiceRevertToStandbyImageClient{stream}
267 if err := x.ClientStream.SendMsg(in); err != nil {
268 return nil, err
269 }
270 if err := x.ClientStream.CloseSend(); err != nil {
271 return nil, err
272 }
273 return x, nil
274}
275
276type NativeSoftwareManagementService_RevertToStandbyImageClient interface {
277 Recv() (*ImageStatus, error)
278 grpc.ClientStream
279}
280
281type nativeSoftwareManagementServiceRevertToStandbyImageClient struct {
282 grpc.ClientStream
283}
284
285func (x *nativeSoftwareManagementServiceRevertToStandbyImageClient) Recv() (*ImageStatus, error) {
286 m := new(ImageStatus)
287 if err := x.ClientStream.RecvMsg(m); err != nil {
288 return nil, err
289 }
290 return m, nil
291}
292
293// NativeSoftwareManagementServiceServer is the server API for NativeSoftwareManagementService service.
294type NativeSoftwareManagementServiceServer interface {
295 // Get the software version information of the Active and Standby images
296 GetSoftwareVersion(context.Context, *HardwareID) (*SoftwareVersionInformation, error)
297 // Downloads and installs the image in the standby partition, returns the status/progress of the Install
298 DownloadImage(*DownloadImageRequest, NativeSoftwareManagementService_DownloadImageServer) error
299 // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
300 // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
301 // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
302 ActivateImage(*HardwareID, NativeSoftwareManagementService_ActivateImageServer) error
303 // Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
304 // This API is to be used if operator wants to go back to the pervious software
305 RevertToStandbyImage(*HardwareID, NativeSoftwareManagementService_RevertToStandbyImageServer) error
306}
307
308func RegisterNativeSoftwareManagementServiceServer(s *grpc.Server, srv NativeSoftwareManagementServiceServer) {
309 s.RegisterService(&_NativeSoftwareManagementService_serviceDesc, srv)
310}
311
312func _NativeSoftwareManagementService_GetSoftwareVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
313 in := new(HardwareID)
314 if err := dec(in); err != nil {
315 return nil, err
316 }
317 if interceptor == nil {
318 return srv.(NativeSoftwareManagementServiceServer).GetSoftwareVersion(ctx, in)
319 }
320 info := &grpc.UnaryServerInfo{
321 Server: srv,
322 FullMethod: "/dmi.NativeSoftwareManagementService/GetSoftwareVersion",
323 }
324 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
325 return srv.(NativeSoftwareManagementServiceServer).GetSoftwareVersion(ctx, req.(*HardwareID))
326 }
327 return interceptor(ctx, in, info, handler)
328}
329
330func _NativeSoftwareManagementService_DownloadImage_Handler(srv interface{}, stream grpc.ServerStream) error {
331 m := new(DownloadImageRequest)
332 if err := stream.RecvMsg(m); err != nil {
333 return err
334 }
335 return srv.(NativeSoftwareManagementServiceServer).DownloadImage(m, &nativeSoftwareManagementServiceDownloadImageServer{stream})
336}
337
338type NativeSoftwareManagementService_DownloadImageServer interface {
339 Send(*ImageStatus) error
340 grpc.ServerStream
341}
342
343type nativeSoftwareManagementServiceDownloadImageServer struct {
344 grpc.ServerStream
345}
346
347func (x *nativeSoftwareManagementServiceDownloadImageServer) Send(m *ImageStatus) error {
348 return x.ServerStream.SendMsg(m)
349}
350
351func _NativeSoftwareManagementService_ActivateImage_Handler(srv interface{}, stream grpc.ServerStream) error {
352 m := new(HardwareID)
353 if err := stream.RecvMsg(m); err != nil {
354 return err
355 }
356 return srv.(NativeSoftwareManagementServiceServer).ActivateImage(m, &nativeSoftwareManagementServiceActivateImageServer{stream})
357}
358
359type NativeSoftwareManagementService_ActivateImageServer interface {
360 Send(*ImageStatus) error
361 grpc.ServerStream
362}
363
364type nativeSoftwareManagementServiceActivateImageServer struct {
365 grpc.ServerStream
366}
367
368func (x *nativeSoftwareManagementServiceActivateImageServer) Send(m *ImageStatus) error {
369 return x.ServerStream.SendMsg(m)
370}
371
372func _NativeSoftwareManagementService_RevertToStandbyImage_Handler(srv interface{}, stream grpc.ServerStream) error {
373 m := new(HardwareID)
374 if err := stream.RecvMsg(m); err != nil {
375 return err
376 }
377 return srv.(NativeSoftwareManagementServiceServer).RevertToStandbyImage(m, &nativeSoftwareManagementServiceRevertToStandbyImageServer{stream})
378}
379
380type NativeSoftwareManagementService_RevertToStandbyImageServer interface {
381 Send(*ImageStatus) error
382 grpc.ServerStream
383}
384
385type nativeSoftwareManagementServiceRevertToStandbyImageServer struct {
386 grpc.ServerStream
387}
388
389func (x *nativeSoftwareManagementServiceRevertToStandbyImageServer) Send(m *ImageStatus) error {
390 return x.ServerStream.SendMsg(m)
391}
392
393var _NativeSoftwareManagementService_serviceDesc = grpc.ServiceDesc{
394 ServiceName: "dmi.NativeSoftwareManagementService",
395 HandlerType: (*NativeSoftwareManagementServiceServer)(nil),
396 Methods: []grpc.MethodDesc{
397 {
398 MethodName: "GetSoftwareVersion",
399 Handler: _NativeSoftwareManagementService_GetSoftwareVersion_Handler,
400 },
401 },
402 Streams: []grpc.StreamDesc{
403 {
404 StreamName: "DownloadImage",
405 Handler: _NativeSoftwareManagementService_DownloadImage_Handler,
406 ServerStreams: true,
407 },
408 {
409 StreamName: "ActivateImage",
410 Handler: _NativeSoftwareManagementService_ActivateImage_Handler,
411 ServerStreams: true,
412 },
413 {
414 StreamName: "RevertToStandbyImage",
415 Handler: _NativeSoftwareManagementService_RevertToStandbyImage_Handler,
416 ServerStreams: true,
417 },
418 },
419 Metadata: "dmi/sw_management_service.proto",
420}