|
|
|
@ -35,6 +35,7 @@ import org.wso2.carbon.device.mgt.common.Device;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.Feature;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.policy.mgt.Policy;
|
|
|
|
@ -528,7 +529,7 @@ public interface DeviceManagementService {
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 200,
|
|
|
|
|
message = "OK. \n Successfully fetched the location details of the device.",
|
|
|
|
|
response = Device.class,
|
|
|
|
|
response = Device.class, //TODO, This should be DeviceLocation.class
|
|
|
|
|
responseHeaders = {
|
|
|
|
|
@ResponseHeader(
|
|
|
|
|
name = "Content-Type",
|
|
|
|
@ -585,6 +586,82 @@ public interface DeviceManagementService {
|
|
|
|
|
String ifModifiedSince);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Path("/{type}/{id}/info")
|
|
|
|
|
@ApiOperation(
|
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
|
httpMethod = "GET",
|
|
|
|
|
value = "Getting the information of a Device",
|
|
|
|
|
notes = "Get the information of a device by specifying the device type and device identifier.",
|
|
|
|
|
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 information of the device.",
|
|
|
|
|
response = DeviceInfo.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 Location data for the specified device 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 getDeviceInformation(
|
|
|
|
|
@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 = "id",
|
|
|
|
|
value = "The device identifier of the device you want ot get details.",
|
|
|
|
|
required = true)
|
|
|
|
|
@PathParam("id")
|
|
|
|
|
@Size(max = 45)
|
|
|
|
|
String id,
|
|
|
|
|
@ApiParam(
|
|
|
|
|
name = "If-Modified-Since",
|
|
|
|
|
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)
|
|
|
|
|
@HeaderParam("If-Modified-Since")
|
|
|
|
|
String ifModifiedSince);
|
|
|
|
|
|
|
|
|
|
//device rename request would looks like follows
|
|
|
|
|
//POST devices/type/virtual_firealarm/id/us06ww93auzp/rename
|
|
|
|
|
@POST
|
|
|
|
|