code: def get_osds(service, device_class=None):
      
      luminous_or_later = cmp_pkgrevno('ceph-common', '12.0.0') >= 0
      if luminous_or_later and device_class:
          out = check_output(['ceph', '--id', service,
                              'osd', 'crush', 'class',
                              'ls-osd', device_class,
                              '--format=json'])
      else:
          out = check_output(['ceph', '--id', service,
                              'osd', 'ls',
                              '--format=json'])
      if six.PY3:
          out = out.decode('UTF-8')
      return json.loads(out)
docs: Return a list of all Ceph Object Storage Daemons currently in the
      cluster (optionally filtered by storage device class).
  
      :param device_class: Class of storage device for OSD's
      :type device_class: str