init InspectService method

This commit is contained in:
Pavel Sviderski
2024-12-02 20:36:31 +10:00
parent 6a4a7f2e6a
commit 6eb373e4de
10 changed files with 561 additions and 110 deletions
+21
View File
@@ -685,3 +685,24 @@ func (m *Machine) Inspect(_ context.Context, _ *emptypb.Empty) (*pb.MachineInfo,
},
}, nil
}
func (m *Machine) InspectService(
ctx context.Context, req *pb.InspectServiceRequest,
) (*pb.InspectServiceResponse, error) {
opts := store.ListOptions{ServiceIDOrName: store.ServiceIDOrNameOptions{
ID: req.Id,
Name: req.Id,
}}
records, err := m.store.ListContainers(ctx, opts)
if err != nil {
return nil, status.Errorf(codes.Internal, "list containers: %v", err)
}
fmt.Println("## records: ", records)
return &pb.InspectServiceResponse{
Service: &pb.Service{
Id: req.Id,
},
}, nil
}