get_devices function

Get the devices or for a tenant.