mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixed Android APIs
This commit is contained in:
parent
ba9d85b065
commit
d25e1b2421
@ -76,4 +76,21 @@ public interface DeviceTypeConfigurationService {
|
|||||||
Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
||||||
PlatformConfiguration configuration) throws AndroidAgentException;
|
PlatformConfiguration configuration) throws AndroidAgentException;
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("license")
|
||||||
|
@Produces("text/html")
|
||||||
|
@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")
|
@Path("/{id}/pending-operations")
|
||||||
@Override
|
@Override
|
||||||
public Response getPendingOperations(@PathParam("id") String id, List<? extends Operation> resultOperations) {
|
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();
|
return Response.status(Response.Status.CREATED).entity(responseMsg).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("license")
|
||||||
|
@Produces("text/html")
|
||||||
|
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>
|
<PermissionConfiguration>
|
||||||
<APIVersion></APIVersion>
|
<APIVersion></APIVersion>
|
||||||
<!-- Operations management related permissions for admin -->
|
<!-- 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>
|
<Permission>
|
||||||
<name>Lock</name>
|
<name>Lock</name>
|
||||||
@ -273,7 +267,7 @@
|
|||||||
<Permission>
|
<Permission>
|
||||||
<name>View license</name>
|
<name>View license</name>
|
||||||
<path>/device-mgt/android/license/view</path>
|
<path>/device-mgt/android/license/view</path>
|
||||||
<url>/device/license</url>
|
<url>/configuration/license</url>
|
||||||
<method>GET</method>
|
<method>GET</method>
|
||||||
<scope>emm_android_agent</scope>
|
<scope>emm_android_agent</scope>
|
||||||
</Permission>
|
</Permission>
|
||||||
@ -282,19 +276,51 @@
|
|||||||
<Permission>
|
<Permission>
|
||||||
<name>Enroll device</name>
|
<name>Enroll device</name>
|
||||||
<path>/device-mgt/android/devices/enroll</path>
|
<path>/device-mgt/android/devices/enroll</path>
|
||||||
<url>/enrollment</url>
|
<url>/devices</url>
|
||||||
<method>POST</method>
|
<method>POST</method>
|
||||||
<scope>emm_android_agent</scope>
|
<scope>emm_android_agent</scope>
|
||||||
</Permission>
|
</Permission>
|
||||||
|
|
||||||
<Permission>
|
<Permission>
|
||||||
<name>Get Enrollment Status</name>
|
<name>Devices related Operations</name>
|
||||||
<path>/device-mgt/android/devices/enroll</path>
|
<path>/device-mgt/android/devices</path>
|
||||||
<url>/enrollment/*</url>
|
<url>/devices/*</url>
|
||||||
<method>GET</method>
|
<method>GET</method>
|
||||||
<scope>emm_android_agent</scope>
|
<scope>emm_android_agent</scope>
|
||||||
</Permission>
|
</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>
|
<Permission>
|
||||||
<name>Update Enrollment</name>
|
<name>Update Enrollment</name>
|
||||||
<path>/device-mgt/android/devices/enroll</path>
|
<path>/device-mgt/android/devices/enroll</path>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user