@ -39,7 +39,7 @@ import java.util.List;
tags = { "devicemgt_android" } )
tags = { "devicemgt_android" } )
@Api ( value = "Android Device Management" ,
@Api ( value = "Android Device Management" ,
description = "This carries all the resources related to Android device management functionalities")
description = "This carries all the resources related to the Android device management functionalities. ")
@Path ( "/devices" )
@Path ( "/devices" )
@Produces ( MediaType . APPLICATION_JSON )
@Produces ( MediaType . APPLICATION_JSON )
@Consumes ( MediaType . APPLICATION_JSON )
@Consumes ( MediaType . APPLICATION_JSON )
@ -51,13 +51,14 @@ public interface DeviceManagementService {
produces = MediaType . APPLICATION_JSON ,
produces = MediaType . APPLICATION_JSON ,
consumes = MediaType . APPLICATION_JSON ,
consumes = MediaType . APPLICATION_JSON ,
httpMethod = "PUT" ,
httpMethod = "PUT" ,
value = "Update the application list of a device" ,
value = "Updating the Application Details on Android Devices" ,
notes = "Update the details of the applications that are installed on Android devices." ,
tags = "Android Device Management"
tags = "Android Device Management"
)
)
@ApiResponses ( value = {
@ApiResponses ( value = {
@ApiResponse (
@ApiResponse (
code = 200 ,
code = 200 ,
message = "OK. \n Application list has been updated successfully ",
message = "OK. \n Successfully updated the application details. ",
responseHeaders = {
responseHeaders = {
@ResponseHeader (
@ResponseHeader (
name = "Content-Location" ,
name = "Content-Location" ,
@ -71,17 +72,17 @@ public interface DeviceManagementService {
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
@ResponseHeader (
name = "Last-Modified" ,
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time .\n" +
description = "Date and time the resource was last modified .\n" +
"Used by caches, or in conditional requests." ) } ) ,
"Used by caches, or in conditional requests." ) } ) ,
@ApiResponse (
@ApiResponse (
code = 400 ,
code = 400 ,
message = "Bad Request. \n Invalid request or validation error." ) ,
message = "Bad Request. \n Invalid request or validation error." ) ,
@ApiResponse (
@ApiResponse (
code = 404 ,
code = 404 ,
message = "Not Found. \n Resource to be deleted does not exist.") ,
message = "Not Found. \n The specified resource does not exist.") ,
@ApiResponse (
@ApiResponse (
code = 415 ,
code = 415 ,
message = "Unsupported media type. \n The entity of the request was in a not supported format .") ,
message = "Unsupported media type. \n The format of the requested entity was not supported .") ,
@ApiResponse (
@ApiResponse (
code = 500 ,
code = 500 ,
message = "Internal Server Error. \n " +
message = "Internal Server Error. \n " +
@ -91,14 +92,14 @@ public interface DeviceManagementService {
Response updateApplicationList (
Response updateApplicationList (
@ApiParam (
@ApiParam (
name = "id" ,
name = "id" ,
value = " Device Identifier ")
value = " The unique device identifier. ")
@NotNull
@NotNull
@Size ( min = 2 , max = 45 )
@Size ( min = 2 , max = 45 )
@Pattern ( regexp = "^[A-Za-z0-9]*$" )
@Pattern ( regexp = "^[A-Za-z0-9]*$" )
@PathParam ( "id" ) String id ,
@PathParam ( "id" ) String id ,
@ApiParam (
@ApiParam (
name = "applications" ,
name = "applications" ,
value = " List of applications that need to be persisted against the device ")
value = " The properties to update application details. Multiple applications can be updated using comma separated values. ")
List < AndroidApplication > androidApplications ) ;
List < AndroidApplication > androidApplications ) ;
@PUT
@PUT
@ -106,16 +107,18 @@ public interface DeviceManagementService {
@ApiOperation (
@ApiOperation (
produces = MediaType . APPLICATION_JSON ,
produces = MediaType . APPLICATION_JSON ,
httpMethod = "PUT" ,
httpMethod = "PUT" ,
value = "Get the operation list pending for the device ",
value = "Get ting the Pending Operation List ",
responseContainer = "List" ,
responseContainer = "List" ,
notes = "The Android agent communicates with the server to get the operations that are queued up " +
notes = "The Android agent communicates with the server to get the operations that are queued up " +
"at the server end for a given device using via this particular resource" ,
"at the server end via this REST API." +
" While getting the pending operations the details of the operations executed at the device end is shared with the server. " +
"The server then updates the status of the operations that were carried out on the device." ,
response = Operation . class ,
response = Operation . class ,
tags = "Android Device Management" )
tags = "Android Device Management" )
@ApiResponses ( value = {
@ApiResponses ( value = {
@ApiResponse (
@ApiResponse (
code = 200 ,
code = 200 ,
message = "OK. \n Successfully fetched the pending application list of the Android device.",
message = "OK. \n Successfully fetched the pending operations of the Android device.",
response = Operation . class ,
response = Operation . class ,
responseContainer = "List" ,
responseContainer = "List" ,
responseHeaders = {
responseHeaders = {
@ -128,33 +131,36 @@ public interface DeviceManagementService {
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
@ResponseHeader (
name = "Last-Modified" ,
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time .\n" +
description = "Date and time the resource was last modified .\n" +
"Used by caches, or in conditional requests." )
"Used by caches, or in conditional requests." )
} ) ,
} ) ,
@ApiResponse (
@ApiResponse (
code = 304 ,
code = 304 ,
message = "Not Modified. \n Empty body because the client has already the latest version of the requested resource.") ,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.") ,
@ApiResponse (
@ApiResponse (
code = 406 ,
code = 406 ,
message = "Not Acceptable.\n The requested media type is not supported" ) ,
message = "Not Acceptable.\n The requested media type is not supported" ) ,
@ApiResponse (
@ApiResponse (
code = 500 ,
code = 500 ,
message = "Internal Server Error. \n Server error occurred while fetching policie s.")
message = "Internal Server Error. \n Server error occurred while fetching the list of pending operation s.")
} )
} )
@Permission ( name = "Enroll Device" , permission = "/device-mgt/devices/enroll/android" )
@Permission ( name = "Enroll Device" , permission = "/device-mgt/devices/enroll/android" )
Response getPendingOperations (
Response getPendingOperations (
@ApiParam (
@ApiParam (
name = "id" ,
name = "id" ,
value = "Device Identifier" )
value = "The unique device identifier." ,
required = true )
@PathParam ( "id" ) String id ,
@PathParam ( "id" ) String id ,
@ApiParam (
@ApiParam (
name = "If-Modified-Since" ,
name = "If-Modified-Since" ,
value = "Validates if the requested variant has not been modified since the time specified" ,
value = "Checks if the requested variant was modified, since the specified date-time.\n" +
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" +
"Example: Mon, 05 Jan 2014 15:10:00 +0200." ,
required = false )
required = false )
@HeaderParam ( "If-Modified-Since" ) String ifModifiedSince ,
@HeaderParam ( "If-Modified-Since" ) String ifModifiedSince ,
@ApiParam (
@ApiParam (
name = "resultOperations" ,
name = "resultOperations" ,
value = " Device Operation Status ")
value = " Properties to update the device operations and their status. ")
List < ? extends Operation > resultOperations ) ;
List < ? extends Operation > resultOperations ) ;
@POST
@POST
@ -162,17 +168,17 @@ public interface DeviceManagementService {
produces = MediaType . APPLICATION_JSON ,
produces = MediaType . APPLICATION_JSON ,
consumes = MediaType . APPLICATION_JSON ,
consumes = MediaType . APPLICATION_JSON ,
httpMethod = "POST" ,
httpMethod = "POST" ,
value = "Register an Android Device",
value = "Register ing an Android Device",
notes = "When carrying out device registration via an Android device, you need to initially install" +
notes = "When registering an Android device, you need to install" +
" an Android Agent on the device, before being able to register the device with WSO2 EMM. Instead," +
" the Android Agent on the device, before being able to register the device with WSO2 EMM. Instead," +
" you can use this REST API to register an Android device with WSO2 EMM, without having to install" +
" you can use this REST API to register an Android device with WSO2 EMM, without having to install" +
" an Android Agent on the respective device ",
" an Android Agent . This API can be mainly used to test the device enrollment process. ",
tags = "Android Device Management"
tags = "Android Device Management"
)
)
@ApiResponses ( value = {
@ApiResponses ( value = {
@ApiResponse (
@ApiResponse (
code = 201 ,
code = 201 ,
message = "Created. \n Device enrollment has successfully been created ",
message = "Created. \n Successfully created an instance of the device. ",
responseHeaders = {
responseHeaders = {
@ResponseHeader (
@ResponseHeader (
name = "Content-Location" ,
name = "Content-Location" ,
@ -186,11 +192,11 @@ public interface DeviceManagementService {
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
@ResponseHeader (
name = "Last-Modified" ,
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time .\n" +
description = "Date and time the resource was last modified .\n" +
"Used by caches, or in conditional requests." ) } ) ,
"Used by caches, or in conditional requests." ) } ) ,
@ApiResponse (
@ApiResponse (
code = 303 ,
code = 303 ,
message = "See Other. \n Source can be retrieved from the URL specified at the L ocation header.",
message = "See Other. \n The source can be retrieved from the URL specified in the l ocation header.",
responseHeaders = {
responseHeaders = {
@ResponseHeader (
@ResponseHeader (
name = "Content-Location" ,
name = "Content-Location" ,
@ -200,14 +206,16 @@ public interface DeviceManagementService {
message = "Bad Request. \n Invalid request or validation error." ) ,
message = "Bad Request. \n Invalid request or validation error." ) ,
@ApiResponse (
@ApiResponse (
code = 415 ,
code = 415 ,
message = "Unsupported media type. \n The entity of the request was in a not supported format. ") ,
message = "Unsupported media type. \n The format of the requested entity was not supported.\n ") ,
@ApiResponse (
@ApiResponse (
code = 500 ,
code = 500 ,
message = "Internal Server Error. \n " +
message = "Internal Server Error. \n " +
"Server error occurred while adding a new device." )
"Server error occurred while adding a new device." )
} )
} )
@Permission ( name = "Enroll Device" , permission = "/device-mgt/devices/enroll/android" )
@Permission ( name = "Enroll Device" , permission = "/device-mgt/devices/enroll/android" )
Response enrollDevice ( @ApiParam ( name = "device" , value = "Device Information to be enroll" )
Response enrollDevice ( @ApiParam (
name = "device" ,
value = "The properties required to enroll a device." )
@Valid AndroidDevice device ) ;
@Valid AndroidDevice device ) ;
@GET
@GET
@ -215,7 +223,7 @@ public interface DeviceManagementService {
@ApiOperation (
@ApiOperation (
httpMethod = "GET" ,
httpMethod = "GET" ,
value = "Getting the Registration Status of an Android Device" ,
value = "Getting the Registration Status of an Android Device" ,
notes = "Use this REST API to retrieve the registration status of an Android device ",
notes = "Use this REST API to retrieve the registration status of an Android device . ",
tags = "Android Device Management"
tags = "Android Device Management"
)
)
@ApiResponses ( value = {
@ApiResponses ( value = {
@ -232,12 +240,12 @@ public interface DeviceManagementService {
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
@ResponseHeader (
name = "Last-Modified" ,
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time .\n" +
description = "Date and time the resource was last modified .\n" +
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
} ) ,
} ) ,
@ApiResponse (
@ApiResponse (
code = 304 ,
code = 304 ,
message = "Not Modified. \n Empty body because the client has already the latest version of the requested resource.") ,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.") ,
@ApiResponse (
@ApiResponse (
code = 406 ,
code = 406 ,
message = "Not Acceptable.\n The requested media type is not supported" ) ,
message = "Not Acceptable.\n The requested media type is not supported" ) ,
@ -249,11 +257,13 @@ public interface DeviceManagementService {
Response isEnrolled (
Response isEnrolled (
@ApiParam (
@ApiParam (
name = "id" ,
name = "id" ,
value = " Device I dentifier")
value = " The unique device i dentifier")
@PathParam ( "id" ) String id ,
@PathParam ( "id" ) String id ,
@ApiParam (
@ApiParam (
name = "If-Modified-Since" ,
name = "If-Modified-Since" ,
value = "Validates if the requested variant has not been modified since the time specified" ,
value = "Checks if the requested variant was modified, since the specified date-time.\n" +
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" +
"Example: Mon, 05 Jan 2014 15:10:00 +0200" ,
required = false )
required = false )
@HeaderParam ( "If-Modified-Since" ) String ifModifiedSince ) ;
@HeaderParam ( "If-Modified-Since" ) String ifModifiedSince ) ;
@ -262,14 +272,14 @@ public interface DeviceManagementService {
@ApiOperation (
@ApiOperation (
httpMethod = "PUT" ,
httpMethod = "PUT" ,
value = "Updating the Registration Details of an Android Device" ,
value = "Updating the Registration Details of an Android Device" ,
notes = "Use this REST API to update the registration details of an Android device ",
notes = "Use this REST API to update the registration details of an Android device . ",
tags = "Android Device Management"
tags = "Android Device Management"
)
)
@ApiResponses (
@ApiResponses (
value = {
value = {
@ApiResponse (
@ApiResponse (
code = 200 ,
code = 200 ,
message = "OK. \n Device enrollment has been updated successfully ",
message = "OK. \n Successfully updated the device enrollment details. ",
responseHeaders = {
responseHeaders = {
@ResponseHeader (
@ResponseHeader (
name = "Content-Location" ,
name = "Content-Location" ,
@ -283,17 +293,17 @@ public interface DeviceManagementService {
"Used by caches, or in conditional requests." ) ,
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
@ResponseHeader (
name = "Last-Modified" ,
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time .\n" +
description = "Date and time the resource was last modified .\n" +
"Used by caches, or in conditional requests." ) } ) ,
"Used by caches, or in conditional requests." ) } ) ,
@ApiResponse (
@ApiResponse (
code = 400 ,
code = 400 ,
message = "Bad Request. \n Invalid request or validation error." ) ,
message = "Bad Request. \n Invalid request or validation error." ) ,
@ApiResponse (
@ApiResponse (
code = 404 ,
code = 404 ,
message = "Not Found. \n Resource to be deleted does not exist.") ,
message = "Not Found. \n The specified resource does not exist.") ,
@ApiResponse (
@ApiResponse (
code = 415 ,
code = 415 ,
message = "Unsupported media type. \n The entity of the request was in a not supported format .") ,
message = "Unsupported media type. \n The format of the requested entity was not supported .") ,
@ApiResponse (
@ApiResponse (
code = 500 ,
code = 500 ,
message = "Internal Server Error. \n " +
message = "Internal Server Error. \n " +
@ -303,27 +313,27 @@ public interface DeviceManagementService {
Response modifyEnrollment (
Response modifyEnrollment (
@ApiParam (
@ApiParam (
name = "id" ,
name = "id" ,
value = " Device Identifier ")
value = " The unique device identifier. ")
@PathParam ( "id" ) String id ,
@PathParam ( "id" ) String id ,
@ApiParam (
@ApiParam (
name = "device" ,
name = "device" ,
value = " Device information to be modify ") @Valid AndroidDevice androidDevice ) ;
value = " The properties of required to update device enrollment details. ") @Valid AndroidDevice androidDevice ) ;
@DELETE
@DELETE
@Path ( "/{id}" )
@Path ( "/{id}" )
@ApiOperation (
@ApiOperation (
httpMethod = "DELETE" ,
httpMethod = "DELETE" ,
value = "Un - register an Android Device",
value = "Un registering an Android Device",
notes = "Use this REST API to un -register a specific Android device ",
notes = "Use this REST API to un register an Android device. ",
tags = "Android Device Management"
tags = "Android Device Management"
)
)
@ApiResponses ( value = {
@ApiResponses ( value = {
@ApiResponse (
@ApiResponse (
code = 200 ,
code = 200 ,
message = "OK. \n Device has successfully been dis-enrolled ") ,
message = "OK. \n Successfully disenrolled the device. ") ,
@ApiResponse (
@ApiResponse (
code = 404 ,
code = 404 ,
message = "Not Found. \n Resource to be deleted does not exist.") ,
message = "Not Found. \n The specified resource does not exist.") ,
@ApiResponse (
@ApiResponse (
code = 500 ,
code = 500 ,
message = "Internal Server Error. \n " +
message = "Internal Server Error. \n " +
@ -333,7 +343,7 @@ public interface DeviceManagementService {
Response disEnrollDevice (
Response disEnrollDevice (
@ApiParam (
@ApiParam (
name = "id" ,
name = "id" ,
value = " Device Identifier ")
value = " The unique device identifier. ")
@PathParam ( "id" ) String id ) ;
@PathParam ( "id" ) String id ) ;
}
}