[VOL-3494] GetManagedDevices API
Change-Id: If05610ebcf680ae5e2ba2886739b5737d5f43923
diff --git a/.gitignore b/.gitignore
index 29486a6..16a8d15 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@
.coverage
*coverage.xml
*results.xml
+sca-report/
# IDEs
.idea
diff --git a/dmi.pb b/dmi.pb
index 5ba3277..7965db6 100644
--- a/dmi.pb
+++ b/dmi.pb
Binary files differ
diff --git a/go/dmi/hw_management_service.pb.go b/go/dmi/hw_management_service.pb.go
index 4b023e9..b53e227 100644
--- a/go/dmi/hw_management_service.pb.go
+++ b/go/dmi/hw_management_service.pb.go
@@ -7,6 +7,7 @@
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
+ empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
math "math"
)
@@ -477,6 +478,45 @@
return Reason_UNDEFINED_REASON
}
+type ManagedDevicesResponse struct {
+ Devices []*ModifiableComponent `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ManagedDevicesResponse) Reset() { *m = ManagedDevicesResponse{} }
+func (m *ManagedDevicesResponse) String() string { return proto.CompactTextString(m) }
+func (*ManagedDevicesResponse) ProtoMessage() {}
+func (*ManagedDevicesResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{9}
+}
+
+func (m *ManagedDevicesResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ManagedDevicesResponse.Unmarshal(m, b)
+}
+func (m *ManagedDevicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ManagedDevicesResponse.Marshal(b, m, deterministic)
+}
+func (m *ManagedDevicesResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ManagedDevicesResponse.Merge(m, src)
+}
+func (m *ManagedDevicesResponse) XXX_Size() int {
+ return xxx_messageInfo_ManagedDevicesResponse.Size(m)
+}
+func (m *ManagedDevicesResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_ManagedDevicesResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ManagedDevicesResponse proto.InternalMessageInfo
+
+func (m *ManagedDevicesResponse) GetDevices() []*ModifiableComponent {
+ if m != nil {
+ return m.Devices
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*PhysicalInventoryRequest)(nil), "dmi.PhysicalInventoryRequest")
proto.RegisterType((*PhysicalInventoryResponse)(nil), "dmi.PhysicalInventoryResponse")
@@ -487,47 +527,52 @@
proto.RegisterType((*StartManagingDeviceResponse)(nil), "dmi.StartManagingDeviceResponse")
proto.RegisterType((*StopManagingDeviceRequest)(nil), "dmi.StopManagingDeviceRequest")
proto.RegisterType((*StopManagingDeviceResponse)(nil), "dmi.StopManagingDeviceResponse")
+ proto.RegisterType((*ManagedDevicesResponse)(nil), "dmi.ManagedDevicesResponse")
}
func init() { proto.RegisterFile("dmi/hw_management_service.proto", fileDescriptor_eae902e73066286d) }
var fileDescriptor_eae902e73066286d = []byte{
- // 547 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xd1, 0x6e, 0xd3, 0x30,
- 0x14, 0x55, 0xd6, 0x69, 0xa8, 0x77, 0xac, 0x12, 0x86, 0x87, 0x34, 0x88, 0x6d, 0x0a, 0x42, 0x42,
- 0xc0, 0x9a, 0xa9, 0x7b, 0x42, 0xbc, 0x01, 0xa2, 0xdd, 0x43, 0x27, 0x94, 0x68, 0xaa, 0xc4, 0x4b,
- 0xe5, 0xc6, 0xb7, 0xad, 0xa5, 0xd9, 0x0e, 0xb1, 0xd3, 0x69, 0xbf, 0x01, 0x7c, 0x00, 0x9f, 0xc4,
- 0x03, 0x1f, 0x84, 0xe2, 0xa4, 0x69, 0xd5,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, 0xd1, 0x9e, 0xb2, 0xfc, 0xe2, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x9d, 0xd6, 0xff,
+ 0x99, 0x07, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -554,6 +599,8 @@
StartManagingDevice(ctx context.Context, in *ModifiableComponent, opts ...grpc.CallOption) (NativeHWManagementService_StartManagingDeviceClient, error)
// Stop management of a device and clean up any context and caches for that device
StopManagingDevice(ctx context.Context, in *StopManagingDeviceRequest, opts ...grpc.CallOption) (*StopManagingDeviceResponse, error)
+ // Returns an object containing a list of devices managed by this entity
+ GetManagedDevices(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ManagedDevicesResponse, error)
// Get the HW inventory details of the Device
GetPhysicalInventory(ctx context.Context, in *PhysicalInventoryRequest, opts ...grpc.CallOption) (NativeHWManagementService_GetPhysicalInventoryClient, error)
// Get the details of a particular HW component
@@ -611,6 +658,15 @@
return out, nil
}
+func (c *nativeHWManagementServiceClient) GetManagedDevices(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ManagedDevicesResponse, error) {
+ out := new(ManagedDevicesResponse)
+ err := c.cc.Invoke(ctx, "/dmi.NativeHWManagementService/GetManagedDevices", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *nativeHWManagementServiceClient) GetPhysicalInventory(ctx context.Context, in *PhysicalInventoryRequest, opts ...grpc.CallOption) (NativeHWManagementService_GetPhysicalInventoryClient, error) {
stream, err := c.cc.NewStream(ctx, &_NativeHWManagementService_serviceDesc.Streams[1], "/dmi.NativeHWManagementService/GetPhysicalInventory", opts...)
if err != nil {
@@ -698,6 +754,8 @@
StartManagingDevice(*ModifiableComponent, NativeHWManagementService_StartManagingDeviceServer) error
// Stop management of a device and clean up any context and caches for that device
StopManagingDevice(context.Context, *StopManagingDeviceRequest) (*StopManagingDeviceResponse, error)
+ // Returns an object containing a list of devices managed by this entity
+ GetManagedDevices(context.Context, *empty.Empty) (*ManagedDevicesResponse, error)
// Get the HW inventory details of the Device
GetPhysicalInventory(*PhysicalInventoryRequest, NativeHWManagementService_GetPhysicalInventoryServer) error
// Get the details of a particular HW component
@@ -749,6 +807,24 @@
return interceptor(ctx, in, info, handler)
}
+func _NativeHWManagementService_GetManagedDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(empty.Empty)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(NativeHWManagementServiceServer).GetManagedDevices(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/dmi.NativeHWManagementService/GetManagedDevices",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(NativeHWManagementServiceServer).GetManagedDevices(ctx, req.(*empty.Empty))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _NativeHWManagementService_GetPhysicalInventory_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(PhysicalInventoryRequest)
if err := stream.RecvMsg(m); err != nil {
@@ -818,6 +894,10 @@
Handler: _NativeHWManagementService_StopManagingDevice_Handler,
},
{
+ MethodName: "GetManagedDevices",
+ Handler: _NativeHWManagementService_GetManagedDevices_Handler,
+ },
+ {
MethodName: "SetHWComponentInfo",
Handler: _NativeHWManagementService_SetHWComponentInfo_Handler,
},
diff --git a/protos/dmi/hw_management_service.proto b/protos/dmi/hw_management_service.proto
index 511a5d2..0584454 100644
--- a/protos/dmi/hw_management_service.proto
+++ b/protos/dmi/hw_management_service.proto
@@ -5,6 +5,7 @@
import "dmi/commons.proto";
import "dmi/hw.proto";
+import "google/protobuf/empty.proto";
// Protos for the management of a hardware and it's components
@@ -57,6 +58,10 @@
Reason reason = 2;
}
+message ManagedDevicesResponse {
+ repeated ModifiableComponent devices = 1;
+}
+
service NativeHWManagementService {
// Initializes context for a device and sets up required states
// In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
@@ -72,6 +77,9 @@
// Stop management of a device and clean up any context and caches for that device
rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
+ // Returns an object containing a list of devices managed by this entity
+ rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
+
// Get the HW inventory details of the Device
rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
diff --git a/python/dmi/commons_pb2.py b/python/dmi/commons_pb2.py
index d7673dc..a2c4cc2 100644
--- a/python/dmi/commons_pb2.py
+++ b/python/dmi/commons_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/commons.proto
-
+"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
diff --git a/python/dmi/hw_events_mgmt_service_pb2.py b/python/dmi/hw_events_mgmt_service_pb2.py
index dbb4697..3058c1f 100644
--- a/python/dmi/hw_events_mgmt_service_pb2.py
+++ b/python/dmi/hw_events_mgmt_service_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/hw_events_mgmt_service.proto
-
+"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
diff --git a/python/dmi/hw_management_service_pb2.py b/python/dmi/hw_management_service_pb2.py
index 1443583..1f7eff4 100644
--- a/python/dmi/hw_management_service_pb2.py
+++ b/python/dmi/hw_management_service_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/hw_management_service.proto
-
+"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
@@ -13,6 +13,7 @@
from dmi import commons_pb2 as dmi_dot_commons__pb2
from dmi import hw_pb2 as dmi_dot_hw__pb2
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
@@ -21,9 +22,9 @@
syntax='proto3',
serialized_options=b'Z9github.com/opencord/device-management-interface/v3/go/dmi',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x1f\x64mi/hw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\":\n\x18PhysicalInventoryRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\"w\n\x19PhysicalInventoryResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12 \n\tinventory\x18\x03 \x01(\x0b\x32\r.dmi.Hardware\"v\n\x19HWComponentInfoGetRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12!\n\x0e\x63omponent_uuid\x18\x02 \x01(\x0b\x32\t.dmi.Uuid\x12\x16\n\x0e\x63omponent_name\x18\x03 \x01(\t\"y\n\x1aHWComponentInfoGetResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12!\n\tcomponent\x18\x03 \x01(\x0b\x32\x0e.dmi.Component\"\xa1\x01\n\x19HWComponentInfoSetRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12!\n\x0e\x63omponent_uuid\x18\x02 \x01(\x0b\x32\t.dmi.Uuid\x12\x16\n\x0e\x63omponent_name\x18\x03 \x01(\t\x12)\n\x07\x63hanges\x18\x04 \x01(\x0b\x32\x18.dmi.ModifiableComponent\"V\n\x1aHWComponentInfoSetResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\"w\n\x1bStartManagingDeviceResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x03 \x01(\x0b\x32\t.dmi.Uuid\")\n\x19StopManagingDeviceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"V\n\x1aStopManagingDeviceResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason2\xd0\x03\n\x19NativeHWManagementService\x12S\n\x13StartManagingDevice\x12\x18.dmi.ModifiableComponent\x1a .dmi.StartManagingDeviceResponse0\x01\x12U\n\x12StopManagingDevice\x12\x1e.dmi.StopManagingDeviceRequest\x1a\x1f.dmi.StopManagingDeviceResponse\x12W\n\x14GetPhysicalInventory\x12\x1d.dmi.PhysicalInventoryRequest\x1a\x1e.dmi.PhysicalInventoryResponse0\x01\x12W\n\x12GetHWComponentInfo\x12\x1e.dmi.HWComponentInfoGetRequest\x1a\x1f.dmi.HWComponentInfoGetResponse0\x01\x12U\n\x12SetHWComponentInfo\x12\x1e.dmi.HWComponentInfoSetRequest\x1a\x1f.dmi.HWComponentInfoSetResponseB;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
+ serialized_pb=b'\n\x1f\x64mi/hw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\x1a\x1bgoogle/protobuf/empty.proto\":\n\x18PhysicalInventoryRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\"w\n\x19PhysicalInventoryResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12 \n\tinventory\x18\x03 \x01(\x0b\x32\r.dmi.Hardware\"v\n\x19HWComponentInfoGetRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12!\n\x0e\x63omponent_uuid\x18\x02 \x01(\x0b\x32\t.dmi.Uuid\x12\x16\n\x0e\x63omponent_name\x18\x03 \x01(\t\"y\n\x1aHWComponentInfoGetResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12!\n\tcomponent\x18\x03 \x01(\x0b\x32\x0e.dmi.Component\"\xa1\x01\n\x19HWComponentInfoSetRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12!\n\x0e\x63omponent_uuid\x18\x02 \x01(\x0b\x32\t.dmi.Uuid\x12\x16\n\x0e\x63omponent_name\x18\x03 \x01(\t\x12)\n\x07\x63hanges\x18\x04 \x01(\x0b\x32\x18.dmi.ModifiableComponent\"V\n\x1aHWComponentInfoSetResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\"w\n\x1bStartManagingDeviceResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x03 \x01(\x0b\x32\t.dmi.Uuid\")\n\x19StopManagingDeviceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"V\n\x1aStopManagingDeviceResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\"C\n\x16ManagedDevicesResponse\x12)\n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x18.dmi.ModifiableComponent2\x9a\x04\n\x19NativeHWManagementService\x12S\n\x13StartManagingDevice\x12\x18.dmi.ModifiableComponent\x1a .dmi.StartManagingDeviceResponse0\x01\x12U\n\x12StopManagingDevice\x12\x1e.dmi.StopManagingDeviceRequest\x1a\x1f.dmi.StopManagingDeviceResponse\x12H\n\x11GetManagedDevices\x12\x16.google.protobuf.Empty\x1a\x1b.dmi.ManagedDevicesResponse\x12W\n\x14GetPhysicalInventory\x12\x1d.dmi.PhysicalInventoryRequest\x1a\x1e.dmi.PhysicalInventoryResponse0\x01\x12W\n\x12GetHWComponentInfo\x12\x1e.dmi.HWComponentInfoGetRequest\x1a\x1f.dmi.HWComponentInfoGetResponse0\x01\x12U\n\x12SetHWComponentInfo\x12\x1e.dmi.HWComponentInfoSetRequest\x1a\x1f.dmi.HWComponentInfoSetResponseB;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
,
- dependencies=[dmi_dot_commons__pb2.DESCRIPTOR,dmi_dot_hw__pb2.DESCRIPTOR,])
+ dependencies=[dmi_dot_commons__pb2.DESCRIPTOR,dmi_dot_hw__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,])
@@ -55,8 +56,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=73,
- serialized_end=131,
+ serialized_start=102,
+ serialized_end=160,
)
@@ -101,8 +102,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=133,
- serialized_end=252,
+ serialized_start=162,
+ serialized_end=281,
)
@@ -147,8 +148,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=254,
- serialized_end=372,
+ serialized_start=283,
+ serialized_end=401,
)
@@ -193,8 +194,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=374,
- serialized_end=495,
+ serialized_start=403,
+ serialized_end=524,
)
@@ -246,8 +247,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=498,
- serialized_end=659,
+ serialized_start=527,
+ serialized_end=688,
)
@@ -285,8 +286,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=661,
- serialized_end=747,
+ serialized_start=690,
+ serialized_end=776,
)
@@ -331,8 +332,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=749,
- serialized_end=868,
+ serialized_start=778,
+ serialized_end=897,
)
@@ -363,8 +364,8 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=870,
- serialized_end=911,
+ serialized_start=899,
+ serialized_end=940,
)
@@ -402,8 +403,40 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=913,
- serialized_end=999,
+ serialized_start=942,
+ serialized_end=1028,
+)
+
+
+_MANAGEDDEVICESRESPONSE = _descriptor.Descriptor(
+ name='ManagedDevicesResponse',
+ full_name='dmi.ManagedDevicesResponse',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ create_key=_descriptor._internal_create_key,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='devices', full_name='dmi.ManagedDevicesResponse.devices', index=0,
+ number=1, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=1030,
+ serialized_end=1097,
)
_PHYSICALINVENTORYREQUEST.fields_by_name['device_uuid'].message_type = dmi_dot_hw__pb2._UUID
@@ -425,6 +458,7 @@
_STARTMANAGINGDEVICERESPONSE.fields_by_name['device_uuid'].message_type = dmi_dot_hw__pb2._UUID
_STOPMANAGINGDEVICERESPONSE.fields_by_name['status'].enum_type = dmi_dot_commons__pb2._STATUS
_STOPMANAGINGDEVICERESPONSE.fields_by_name['reason'].enum_type = dmi_dot_commons__pb2._REASON
+_MANAGEDDEVICESRESPONSE.fields_by_name['devices'].message_type = dmi_dot_hw__pb2._MODIFIABLECOMPONENT
DESCRIPTOR.message_types_by_name['PhysicalInventoryRequest'] = _PHYSICALINVENTORYREQUEST
DESCRIPTOR.message_types_by_name['PhysicalInventoryResponse'] = _PHYSICALINVENTORYRESPONSE
DESCRIPTOR.message_types_by_name['HWComponentInfoGetRequest'] = _HWCOMPONENTINFOGETREQUEST
@@ -434,6 +468,7 @@
DESCRIPTOR.message_types_by_name['StartManagingDeviceResponse'] = _STARTMANAGINGDEVICERESPONSE
DESCRIPTOR.message_types_by_name['StopManagingDeviceRequest'] = _STOPMANAGINGDEVICEREQUEST
DESCRIPTOR.message_types_by_name['StopManagingDeviceResponse'] = _STOPMANAGINGDEVICERESPONSE
+DESCRIPTOR.message_types_by_name['ManagedDevicesResponse'] = _MANAGEDDEVICESRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
PhysicalInventoryRequest = _reflection.GeneratedProtocolMessageType('PhysicalInventoryRequest', (_message.Message,), {
@@ -499,6 +534,13 @@
})
_sym_db.RegisterMessage(StopManagingDeviceResponse)
+ManagedDevicesResponse = _reflection.GeneratedProtocolMessageType('ManagedDevicesResponse', (_message.Message,), {
+ 'DESCRIPTOR' : _MANAGEDDEVICESRESPONSE,
+ '__module__' : 'dmi.hw_management_service_pb2'
+ # @@protoc_insertion_point(class_scope:dmi.ManagedDevicesResponse)
+ })
+_sym_db.RegisterMessage(ManagedDevicesResponse)
+
DESCRIPTOR._options = None
@@ -509,8 +551,8 @@
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
- serialized_start=1002,
- serialized_end=1466,
+ serialized_start=1100,
+ serialized_end=1638,
methods=[
_descriptor.MethodDescriptor(
name='StartManagingDevice',
@@ -533,9 +575,19 @@
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
+ name='GetManagedDevices',
+ full_name='dmi.NativeHWManagementService.GetManagedDevices',
+ index=2,
+ containing_service=None,
+ input_type=google_dot_protobuf_dot_empty__pb2._EMPTY,
+ output_type=_MANAGEDDEVICESRESPONSE,
+ serialized_options=None,
+ create_key=_descriptor._internal_create_key,
+ ),
+ _descriptor.MethodDescriptor(
name='GetPhysicalInventory',
full_name='dmi.NativeHWManagementService.GetPhysicalInventory',
- index=2,
+ index=3,
containing_service=None,
input_type=_PHYSICALINVENTORYREQUEST,
output_type=_PHYSICALINVENTORYRESPONSE,
@@ -545,7 +597,7 @@
_descriptor.MethodDescriptor(
name='GetHWComponentInfo',
full_name='dmi.NativeHWManagementService.GetHWComponentInfo',
- index=3,
+ index=4,
containing_service=None,
input_type=_HWCOMPONENTINFOGETREQUEST,
output_type=_HWCOMPONENTINFOGETRESPONSE,
@@ -555,7 +607,7 @@
_descriptor.MethodDescriptor(
name='SetHWComponentInfo',
full_name='dmi.NativeHWManagementService.SetHWComponentInfo',
- index=4,
+ index=5,
containing_service=None,
input_type=_HWCOMPONENTINFOSETREQUEST,
output_type=_HWCOMPONENTINFOSETRESPONSE,
diff --git a/python/dmi/hw_management_service_pb2_grpc.py b/python/dmi/hw_management_service_pb2_grpc.py
index 4596281..759a668 100644
--- a/python/dmi/hw_management_service_pb2_grpc.py
+++ b/python/dmi/hw_management_service_pb2_grpc.py
@@ -4,6 +4,7 @@
from dmi import hw_management_service_pb2 as dmi_dot_hw__management__service__pb2
from dmi import hw_pb2 as dmi_dot_hw__pb2
+from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class NativeHWManagementServiceStub(object):
@@ -25,6 +26,11 @@
request_serializer=dmi_dot_hw__management__service__pb2.StopManagingDeviceRequest.SerializeToString,
response_deserializer=dmi_dot_hw__management__service__pb2.StopManagingDeviceResponse.FromString,
)
+ self.GetManagedDevices = channel.unary_unary(
+ '/dmi.NativeHWManagementService/GetManagedDevices',
+ request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ response_deserializer=dmi_dot_hw__management__service__pb2.ManagedDevicesResponse.FromString,
+ )
self.GetPhysicalInventory = channel.unary_stream(
'/dmi.NativeHWManagementService/GetPhysicalInventory',
request_serializer=dmi_dot_hw__management__service__pb2.PhysicalInventoryRequest.SerializeToString,
@@ -67,6 +73,13 @@
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
+ def GetManagedDevices(self, request, context):
+ """Returns an object containing a list of devices managed by this entity
+ """
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
def GetPhysicalInventory(self, request, context):
"""Get the HW inventory details of the Device
"""
@@ -101,6 +114,11 @@
request_deserializer=dmi_dot_hw__management__service__pb2.StopManagingDeviceRequest.FromString,
response_serializer=dmi_dot_hw__management__service__pb2.StopManagingDeviceResponse.SerializeToString,
),
+ 'GetManagedDevices': grpc.unary_unary_rpc_method_handler(
+ servicer.GetManagedDevices,
+ request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
+ response_serializer=dmi_dot_hw__management__service__pb2.ManagedDevicesResponse.SerializeToString,
+ ),
'GetPhysicalInventory': grpc.unary_stream_rpc_method_handler(
servicer.GetPhysicalInventory,
request_deserializer=dmi_dot_hw__management__service__pb2.PhysicalInventoryRequest.FromString,
@@ -161,6 +179,23 @@
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
+ def GetManagedDevices(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/dmi.NativeHWManagementService/GetManagedDevices',
+ google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
+ dmi_dot_hw__management__service__pb2.ManagedDevicesResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
def GetPhysicalInventory(request,
target,
options=(),
diff --git a/python/dmi/hw_metrics_mgmt_service_pb2.py b/python/dmi/hw_metrics_mgmt_service_pb2.py
index 843bbf0..b080bb8 100644
--- a/python/dmi/hw_metrics_mgmt_service_pb2.py
+++ b/python/dmi/hw_metrics_mgmt_service_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/hw_metrics_mgmt_service.proto
-
+"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
diff --git a/python/dmi/hw_pb2.py b/python/dmi/hw_pb2.py
index aae31d7..0a29132 100644
--- a/python/dmi/hw_pb2.py
+++ b/python/dmi/hw_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/hw.proto
-
+"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
diff --git a/python/dmi/sw_image_pb2.py b/python/dmi/sw_image_pb2.py
index 9a60384..4fa56dc 100644
--- a/python/dmi/sw_image_pb2.py
+++ b/python/dmi/sw_image_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/sw_image.proto
-
+"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
diff --git a/python/dmi/sw_management_service_pb2.py b/python/dmi/sw_management_service_pb2.py
index 5306586..cc5d459 100644
--- a/python/dmi/sw_management_service_pb2.py
+++ b/python/dmi/sw_management_service_pb2.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dmi/sw_management_service.proto
-
+"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection