Merge branch 'rest-api-improvements' of https://github.com/wso2/carbon-device-mgt-plugins into rest-api-improvements

revert-dabc3590
inoshperera 9 years ago
commit 9f8ca3ea9a

@ -91,4 +91,21 @@ public interface DeviceTypeConfigurationService {
Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
PlatformConfiguration configuration) throws AndroidAgentException;
@GET
@Path("license")
@Produces("text/plain")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Getting the License Agreement for Android Device Registration",
notes = "Use this REST API to retrieve the license agreement that is used for the Android device " +
"registration process",
response = String.class)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Licence agreement"),
@ApiResponse(code = 500, message = "Error occurred while retrieving the license configured for Android " +
"device enrolment")
})
Response getLicense() throws AndroidAgentException;
}

@ -71,7 +71,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
}
}
@GET
@PUT
@Path("/{id}/pending-operations")
@Override
public Response getPendingOperations(@PathParam("id") String id, List<? extends Operation> resultOperations) {

@ -158,4 +158,24 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
return Response.status(Response.Status.CREATED).entity(responseMsg).build();
}
@GET
@Path("license")
@Produces("text/plain")
public Response getLicense() throws AndroidAgentException {
License license = null;
try {
license =
AndroidAPIUtils.getDeviceManagementService().getLicense(
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US);
} catch (DeviceManagementException e) {
String msg = "Error occurred while retrieving the license configured for Android device enrolment";
log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
}
return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build();
}
}

@ -30,13 +30,7 @@
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Operations management related permissions for admin -->
<Permission>
<name>Get Pending Operation</name>
<path>/device-mgt/android/operations/poll</path>
<url>/operation/*</url>
<method>PUT</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Lock</name>
@ -273,7 +267,7 @@
<Permission>
<name>View license</name>
<path>/device-mgt/android/license/view</path>
<url>/device/license</url>
<url>/configuration/license</url>
<method>GET</method>
<scope>emm_android_agent</scope>
</Permission>
@ -282,19 +276,51 @@
<Permission>
<name>Enroll device</name>
<path>/device-mgt/android/devices/enroll</path>
<url>/enrollment</url>
<url>/devices</url>
<method>POST</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Get Enrollment Status</name>
<path>/device-mgt/android/devices/enroll</path>
<url>/enrollment/*</url>
<name>Devices related Operations</name>
<path>/device-mgt/android/devices</path>
<url>/devices/*</url>
<method>GET</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Device is enrolled</name>
<path>/device-mgt/android/devices</path>
<url>/devices/*/status</url>
<method>GET</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Devices related Operations</name>
<path>/device-mgt/android/devices/operations</path>
<url>/devices/*/pending-operations</url>
<method>PUT</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Modify devices</name>
<path>/device-mgt/android/devices/operations</path>
<url>/devices/*</url>
<method>PUT</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Delete devices</name>
<path>/device-mgt/android/devices/operations</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope>emm_android_agent</scope>
</Permission>
<Permission>
<name>Update Enrollment</name>
<path>/device-mgt/android/devices/enroll</path>

Loading…
Cancel
Save