VOL-3448: Introduce returning error for GetHWComponentInfo , GetMetric , GetSoftwareVersion APIs

Change-Id: Ia592bcc642ad5aa3b3891b8bdd1f9cf21bd51da2
diff --git a/go/dmi/sw_management_service.pb.go b/go/dmi/sw_management_service.pb.go
index 382bf2a..f3ef3e6 100644
--- a/go/dmi/sw_management_service.pb.go
+++ b/go/dmi/sw_management_service.pb.go
@@ -69,6 +69,61 @@
 	return nil
 }
 
+type GetSoftwareVersionInformationResponse struct {
+	Status               Status                      `protobuf:"varint,1,opt,name=status,proto3,enum=dmi.Status" json:"status,omitempty"`
+	Reason               Reason                      `protobuf:"varint,2,opt,name=reason,proto3,enum=dmi.Reason" json:"reason,omitempty"`
+	Info                 *SoftwareVersionInformation `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"`
+	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
+	XXX_unrecognized     []byte                      `json:"-"`
+	XXX_sizecache        int32                       `json:"-"`
+}
+
+func (m *GetSoftwareVersionInformationResponse) Reset()         { *m = GetSoftwareVersionInformationResponse{} }
+func (m *GetSoftwareVersionInformationResponse) String() string { return proto.CompactTextString(m) }
+func (*GetSoftwareVersionInformationResponse) ProtoMessage()    {}
+func (*GetSoftwareVersionInformationResponse) Descriptor() ([]byte, []int) {
+	return fileDescriptor_000929e4bec891d7, []int{1}
+}
+
+func (m *GetSoftwareVersionInformationResponse) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_GetSoftwareVersionInformationResponse.Unmarshal(m, b)
+}
+func (m *GetSoftwareVersionInformationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_GetSoftwareVersionInformationResponse.Marshal(b, m, deterministic)
+}
+func (m *GetSoftwareVersionInformationResponse) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_GetSoftwareVersionInformationResponse.Merge(m, src)
+}
+func (m *GetSoftwareVersionInformationResponse) XXX_Size() int {
+	return xxx_messageInfo_GetSoftwareVersionInformationResponse.Size(m)
+}
+func (m *GetSoftwareVersionInformationResponse) XXX_DiscardUnknown() {
+	xxx_messageInfo_GetSoftwareVersionInformationResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GetSoftwareVersionInformationResponse proto.InternalMessageInfo
+
+func (m *GetSoftwareVersionInformationResponse) GetStatus() Status {
+	if m != nil {
+		return m.Status
+	}
+	return Status_UNDEFINED_STATUS
+}
+
+func (m *GetSoftwareVersionInformationResponse) GetReason() Reason {
+	if m != nil {
+		return m.Reason
+	}
+	return Reason_UNDEFINED_REASON
+}
+
+func (m *GetSoftwareVersionInformationResponse) GetInfo() *SoftwareVersionInformation {
+	if m != nil {
+		return m.Info
+	}
+	return nil
+}
+
 type DownloadImageRequest struct {
 	DeviceUuid           *Uuid             `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
 	ImageInfo            *ImageInformation `protobuf:"bytes,2,opt,name=image_info,json=imageInfo,proto3" json:"image_info,omitempty"`
@@ -81,7 +136,7 @@
 func (m *DownloadImageRequest) String() string { return proto.CompactTextString(m) }
 func (*DownloadImageRequest) ProtoMessage()    {}
 func (*DownloadImageRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_000929e4bec891d7, []int{1}
+	return fileDescriptor_000929e4bec891d7, []int{2}
 }
 
 func (m *DownloadImageRequest) XXX_Unmarshal(b []byte) error {
@@ -118,38 +173,43 @@
 
 func init() {
 	proto.RegisterType((*SoftwareVersionInformation)(nil), "dmi.SoftwareVersionInformation")
+	proto.RegisterType((*GetSoftwareVersionInformationResponse)(nil), "dmi.GetSoftwareVersionInformationResponse")
 	proto.RegisterType((*DownloadImageRequest)(nil), "dmi.DownloadImageRequest")
 }
 
 func init() { proto.RegisterFile("dmi/sw_management_service.proto", fileDescriptor_000929e4bec891d7) }
 
 var fileDescriptor_000929e4bec891d7 = []byte{
-	// 387 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,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x78, 0x60, 0xb7, 0x6e, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x4a, 0xed, 0x39, 0xbf,
-	0x02, 0x00, 0x00,
+	// 458 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x5d, 0x6b, 0x13, 0x41,
+	0x14, 0x65, 0x13, 0x29, 0x74, 0xd6, 0x36, 0xed, 0x50, 0x21, 0xee, 0x4b, 0x4a, 0x44, 0x08, 0x85,
+	0x66, 0x65, 0xd3, 0x17, 0xad, 0x08, 0x4a, 0x41, 0xf3, 0xa0, 0xe0, 0x46, 0x7d, 0xf0, 0x65, 0x99,
+	0xec, 0xdc, 0xa4, 0x03, 0xce, 0xdc, 0x38, 0x33, 0xbb, 0xd1, 0x3f, 0xe2, 0x4f, 0xd0, 0xbf, 0x29,
+	0xf3, 0x11, 0x53, 0x69, 0x03, 0x7d, 0xdb, 0x3d, 0xf7, 0x9c, 0x33, 0x67, 0xee, 0xbd, 0x43, 0x06,
+	0x5c, 0x8a, 0xdc, 0xac, 0x2b, 0xc9, 0x14, 0x5b, 0x82, 0x04, 0x65, 0x2b, 0x03, 0xba, 0x15, 0x35,
+	0x8c, 0x57, 0x1a, 0x2d, 0xd2, 0x2e, 0x97, 0x22, 0x3b, 0x76, 0xac, 0x1a, 0xa5, 0x44, 0x65, 0x02,
+	0x9e, 0x3d, 0x74, 0xd0, 0xf5, 0x3a, 0xfe, 0xd1, 0x68, 0x23, 0x24, 0x5b, 0x46, 0xe5, 0xf0, 0x57,
+	0x42, 0xb2, 0x19, 0x2e, 0xec, 0x9a, 0x69, 0xf8, 0x02, 0xda, 0x08, 0x54, 0x53, 0xb5, 0x40, 0x2d,
+	0x99, 0x15, 0xa8, 0xe8, 0x0b, 0xd2, 0x63, 0xb5, 0x15, 0x2d, 0x54, 0x6d, 0x28, 0x9a, 0x7e, 0x72,
+	0xda, 0x1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, 0x7b, 0xde, 0xfb, 0x1d, 0xd3, 0xdc, 0xa1, 0xd3, 0xab, 0xec, 0xcc, 0x03,
+	0xf7, 0xeb, 0xf7, 0x2b, 0x72, 0xf0, 0xdf, 0x85, 0xe9, 0x63, 0x2f, 0xbe, 0xab, 0x09, 0xd9, 0xd1,
+	0xf6, 0x12, 0x61, 0x20, 0xcf, 0x12, 0x7a, 0x41, 0x0e, 0x5e, 0xbb, 0x4d, 0x61, 0x16, 0x82, 0xfe,
+	0x56, 0x9a, 0xbb, 0x54, 0x97, 0xe4, 0xa4, 0x84, 0x16, 0xb4, 0xfd, 0x84, 0xb3, 0xb0, 0x2a, 0xf7,
+	0x17, 0xbf, 0xb9, 0xfc, 0xfa, 0x7c, 0x29, 0xec, 0x75, 0x33, 0x1f, 0xd7, 0x28, 0x73, 0x5c, 0x81,
+	0xaa, 0x51, 0xf3, 0x3c, 0x4c, 0xe0, 0x7c, 0xfb, 0xac, 0xce, 0x85, 0xb2, 0xa0, 0x17, 0xac, 0x86,
+	0xbc, 0x9d, 0xe4, 0x4b, 0xcc, 0xb9, 0x14, 0xf3, 0x3d, 0xff, 0x52, 0x26, 0x7f, 0x03, 0x00, 0x00,
+	0xff, 0xff, 0x6d, 0x7d, 0x3b, 0xc8, 0x86, 0x03, 0x00, 0x00,
 }
 
 // Reference imports to suppress errors if they are not otherwise used.
@@ -165,7 +225,7 @@
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
 type NativeSoftwareManagementServiceClient interface {
 	// Get the software version information of the Active and Standby images
-	GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*SoftwareVersionInformation, error)
+	GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*GetSoftwareVersionInformationResponse, error)
 	// Downloads and installs the image in the standby partition, returns the status/progress of the Install
 	DownloadImage(ctx context.Context, in *DownloadImageRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_DownloadImageClient, error)
 	// Activates and runs the OLT with the image in the standby partition. If things are fine this image will
@@ -173,7 +233,7 @@
 	// Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
 	ActivateImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_ActivateImageClient, error)
 	// Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
-	// This API is to be used if operator wants to go back to the pervious software
+	// This API is to be used if operator wants to go back to the previous software
 	RevertToStandbyImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_RevertToStandbyImageClient, error)
 }
 
@@ -185,8 +245,8 @@
 	return &nativeSoftwareManagementServiceClient{cc}
 }
 
-func (c *nativeSoftwareManagementServiceClient) GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*SoftwareVersionInformation, error) {
-	out := new(SoftwareVersionInformation)
+func (c *nativeSoftwareManagementServiceClient) GetSoftwareVersion(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*GetSoftwareVersionInformationResponse, error) {
+	out := new(GetSoftwareVersionInformationResponse)
 	err := c.cc.Invoke(ctx, "/dmi.NativeSoftwareManagementService/GetSoftwareVersion", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -293,7 +353,7 @@
 // NativeSoftwareManagementServiceServer is the server API for NativeSoftwareManagementService service.
 type NativeSoftwareManagementServiceServer interface {
 	// Get the software version information of the Active and Standby images
-	GetSoftwareVersion(context.Context, *HardwareID) (*SoftwareVersionInformation, error)
+	GetSoftwareVersion(context.Context, *HardwareID) (*GetSoftwareVersionInformationResponse, error)
 	// Downloads and installs the image in the standby partition, returns the status/progress of the Install
 	DownloadImage(*DownloadImageRequest, NativeSoftwareManagementService_DownloadImageServer) error
 	// Activates and runs the OLT with the image in the standby partition. If things are fine this image will
@@ -301,7 +361,7 @@
 	// Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
 	ActivateImage(*HardwareID, NativeSoftwareManagementService_ActivateImageServer) error
 	// Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
-	// This API is to be used if operator wants to go back to the pervious software
+	// This API is to be used if operator wants to go back to the previous software
 	RevertToStandbyImage(*HardwareID, NativeSoftwareManagementService_RevertToStandbyImageServer) error
 }