diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index f10a95e3ff..05df689189 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -96,6 +96,11 @@ public interface DeviceManagementService { permissions = {"/permission/admin/device-mgt/admin/devices/list"} ) Response getDevices( + @ApiParam( + name = "name", + value = "The device name, such as shamu, bullhead or angler.", + required = false) + String name, @ApiParam( name = "type", value = "The device type, such as ios, android or windows.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index a150bed327..6a7c3fec47 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -62,6 +62,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @GET @Override public Response getDevices( + @QueryParam("name") String name, @QueryParam("type") String type, @QueryParam("user") String user, @QueryParam("roleName") String roleName, @@ -79,6 +80,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { PaginationResult result; DeviceList devices = new DeviceList(); + if(name != null && !name.isEmpty()){ + request.setDeviceName(name); + } if (type != null && !type.isEmpty()) { request.setDeviceType(type); }