@ -60,6 +60,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam ;
import javax.ws.rs.core.MediaType ;
import javax.ws.rs.core.Response ;
import java.util.List ;
/ * *
* Device related REST - API . This can be used to manipulated device related details .
@ -1452,5 +1453,198 @@ public interface DeviceManagementService {
@ApiParam ( name = "deviceOperation" , value = "Operation object with device ids." , required = true )
@Valid OperationRequest operationRequest ) ;
@GET
@Path ( "/status/count/{type}/{status}" )
@ApiOperation (
produces = MediaType . APPLICATION_JSON ,
httpMethod = "GET" ,
value = "Get Device Count with status" ,
notes = "Get specified device count with status." ,
tags = "Device Management" ,
extensions = {
@Extension ( properties = {
@ExtensionProperty ( name = Constants . SCOPE , value = "perm:devices:details" )
} )
}
)
@ApiResponses (
value = {
@ApiResponse (
code = 200 ,
message = "OK. \n Successfully fetched the details of the device." ,
response = int . class ,
responseHeaders = {
@ResponseHeader (
name = "Content-Type" ,
description = "The content type of the body" ) ,
@ResponseHeader (
name = "ETag" ,
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
name = "Last-Modified" ,
description = "Date and time the resource was last modified.\n" +
"Used by caches, or in conditional requests." ) ,
} ) ,
@ApiResponse (
code = 304 ,
message = "Not Modified. Empty body because the client already has the latest version" +
" of the requested resource.\n" ) ,
@ApiResponse (
code = 400 ,
message = "Bad Request. \n Invalid request or validation error." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 404 ,
message = "Not Found. \n A device with the specified device type and id was not found." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 500 ,
message = "Internal Server Error. \n " +
"Server error occurred while retrieving the device details." ,
response = ErrorResponse . class )
} )
Response getDeviceCountByStatus (
@ApiParam (
name = "type" ,
value = "The device type name, such as ios, android, windows or fire-alarm." ,
required = true )
@PathParam ( "type" )
@Size ( max = 45 )
String type ,
@ApiParam (
name = "status" ,
value = "The device identifier of the device you want ot get details." ,
required = true )
@PathParam ( "status" )
@Size ( max = 45 )
String status ) ;
@GET
@Path ( "/status/ids/{type}/{status}" )
@ApiOperation (
produces = MediaType . APPLICATION_JSON ,
httpMethod = "GET" ,
value = "Getting Details of a Device" ,
notes = "Get the details of a device by specifying the device type and device identifier and optionally " +
"the owner." ,
tags = "Device Management" ,
extensions = {
@Extension ( properties = {
@ExtensionProperty ( name = Constants . SCOPE , value = "perm:devices:details" )
} )
}
)
@ApiResponses (
value = {
@ApiResponse (
code = 200 ,
message = "OK. \n Successfully fetched the details of the device." ,
response = String [ ] . class ,
responseHeaders = {
@ResponseHeader (
name = "Content-Type" ,
description = "The content type of the body" ) ,
@ResponseHeader (
name = "ETag" ,
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
name = "Last-Modified" ,
description = "Date and time the resource was last modified.\n" +
"Used by caches, or in conditional requests." ) ,
} ) ,
@ApiResponse (
code = 304 ,
message = "Not Modified. Empty body because the client already has the latest version" +
" of the requested resource.\n" ) ,
@ApiResponse (
code = 400 ,
message = "Bad Request. \n Invalid request or validation error." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 404 ,
message = "Not Found. \n A device with the specified device type and id was not found." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 500 ,
message = "Internal Server Error. \n " +
"Server error occurred while retrieving the device details." ,
response = ErrorResponse . class )
} )
Response getDeviceIdentifiersByStatus (
@ApiParam (
name = "type" ,
value = "The device type name, such as ios, android, windows or fire-alarm." ,
required = true )
@PathParam ( "type" )
@Size ( max = 45 )
String type ,
@ApiParam (
name = "status" ,
value = "The device identifier of the device you want ot get details." ,
required = true )
@PathParam ( "status" )
@Size ( max = 45 )
String status ) ;
@PUT
@Path ( "/status/update/{type}/{status}" )
@ApiOperation (
produces = MediaType . APPLICATION_JSON ,
consumes = MediaType . APPLICATION_JSON ,
httpMethod = "PUT" ,
value = "Changing the Status of a Devices" ,
notes = "Change the status of a devices from one state to another." ,
tags = "Device Management" ,
extensions = {
@Extension ( properties = {
@ExtensionProperty ( name = Constants . SCOPE , value = "perm:devices:change-status" )
} )
}
)
@ApiResponses (
value = {
@ApiResponse (
code = 200 ,
message = "OK. \n Successfully changed the device status." ,
response = Device . class ,
responseHeaders = {
@ResponseHeader (
name = "Content-Type" ,
description = "The content type of the body" ) ,
@ResponseHeader (
name = "ETag" ,
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests." ) ,
@ResponseHeader (
name = "Last-Modified" ,
description = "Date and time the resource has been modified the last time.\n" +
"Used by caches, or in conditional requests." ) ,
} ) ,
@ApiResponse (
code = 304 ,
message = "Not Modified. Empty body because the client already has the latest " +
"version of the requested resource." ) ,
@ApiResponse (
code = 400 ,
message = "Bad Request. \n Invalid request or validation error." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 404 ,
message = "Not Found. \n No device is found under the provided type and id." ,
response = ErrorResponse . class ) ,
@ApiResponse (
code = 500 ,
message = "Internal Server Error. \n " +
"Server error occurred while retrieving information requested device." ,
response = ErrorResponse . class )
} )
Response bulkUpdateDeviceStatus ( @ApiParam ( name = "type" , value = "The device type, such as ios, android or windows." , required = true )
@PathParam ( "type" ) String type ,
@ApiParam ( name = "status" , value = "The device type, such as ios, android or windows." , required = true )
@PathParam ( "status" ) String status ,
@ApiParam ( name = "deviceList" , value = "The payload containing the new name of the device." , required = true )
@Valid List < String > deviceList ) ;
}