|
|
@ -19,8 +19,12 @@
|
|
|
|
package org.wso2.carbon.device.mgt.mobile.windows.api.services;
|
|
|
|
package org.wso2.carbon.device.mgt.mobile.windows.api.services;
|
|
|
|
|
|
|
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.Scope;
|
|
|
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.Scopes;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.Constants;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.jws.WebService;
|
|
|
|
import javax.jws.WebService;
|
|
|
|
import javax.ws.rs.Consumes;
|
|
|
|
import javax.ws.rs.Consumes;
|
|
|
@ -57,9 +61,43 @@ import java.util.List;
|
|
|
|
@Api(value = "Windows Device Management Administrative Service",
|
|
|
|
@Api(value = "Windows Device Management Administrative Service",
|
|
|
|
description = "Device management related admin APIs.")
|
|
|
|
description = "Device management related admin APIs.")
|
|
|
|
@WebService
|
|
|
|
@WebService
|
|
|
|
@Path("/operation/admin/devices")
|
|
|
|
@Path("/admin/devices")
|
|
|
|
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@Scopes(
|
|
|
|
|
|
|
|
scopes = {
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Lock Device",
|
|
|
|
|
|
|
|
description = "Adding a Device Lock on Windows devices.",
|
|
|
|
|
|
|
|
key = "cdmf:windows:lock-devices",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/devices/owning-device/operations/windows/lock"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Un-enroll Device",
|
|
|
|
|
|
|
|
description = "Unregister an Windows device",
|
|
|
|
|
|
|
|
key = "cdmf:windows:disenroll",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/devices/disenroll/windows"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Factory Reset",
|
|
|
|
|
|
|
|
description = "Factory Resetting Windows Devices",
|
|
|
|
|
|
|
|
key = "cdmf:windows:wipe",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/devices/owning-device/operations/windows/wipe"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Ring Device",
|
|
|
|
|
|
|
|
description = "Ring Windows devices",
|
|
|
|
|
|
|
|
key = "cdmf:windows:ring",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/devices/owning-device/operations/windows/ring"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Lock Reset",
|
|
|
|
|
|
|
|
description = "Lock reset on Windows devices",
|
|
|
|
|
|
|
|
key = "cdmf:windows:lock-reset",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/devices/owning-device/operations/windows/lock-reset"}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
public interface DeviceManagementAdminService {
|
|
|
|
public interface DeviceManagementAdminService {
|
|
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
@POST
|
|
|
@ -71,13 +109,10 @@ public interface DeviceManagementAdminService {
|
|
|
|
notes = "Using this API you have the option of Device Windows device.",
|
|
|
|
notes = "Using this API you have the option of Device Windows device.",
|
|
|
|
response = Activity.class,
|
|
|
|
response = Activity.class,
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:windows:lock-devices")
|
|
|
|
scopes = {@AuthorizationScope(
|
|
|
|
})
|
|
|
|
scope = "/device-mgt/devices/owning-device/operations/windows/lock",
|
|
|
|
|
|
|
|
description = "Lock Device")}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
@ -133,13 +168,10 @@ public interface DeviceManagementAdminService {
|
|
|
|
notes = "Dis-enroll on Android devices",
|
|
|
|
notes = "Dis-enroll on Android devices",
|
|
|
|
response = Activity.class,
|
|
|
|
response = Activity.class,
|
|
|
|
tags = "Windows Device Management Administrative Service.",
|
|
|
|
tags = "Windows Device Management Administrative Service.",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:windows:disenroll")
|
|
|
|
scopes = {@AuthorizationScope(
|
|
|
|
})
|
|
|
|
scope = "/device-mgt/devices/disenroll/windows",
|
|
|
|
|
|
|
|
description = "Dis-enroll the windows devices ")}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
@ -197,13 +229,10 @@ public interface DeviceManagementAdminService {
|
|
|
|
"to restore them back to the original system.",
|
|
|
|
"to restore them back to the original system.",
|
|
|
|
response = Activity.class,
|
|
|
|
response = Activity.class,
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:windows:wipe")
|
|
|
|
scopes = {@AuthorizationScope(
|
|
|
|
})
|
|
|
|
scope = "/device-mgt/devices/owning-device/operations/windows/wipe",
|
|
|
|
|
|
|
|
description = "DeviceWipe")}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
@ -258,13 +287,10 @@ public interface DeviceManagementAdminService {
|
|
|
|
notes = "Ring Windows devices.",
|
|
|
|
notes = "Ring Windows devices.",
|
|
|
|
response = Activity.class,
|
|
|
|
response = Activity.class,
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value="permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:windows:ring")
|
|
|
|
scopes = { @AuthorizationScope(
|
|
|
|
})
|
|
|
|
scope = "/device-mgt/devices/owning-device/operations/windows/ring",
|
|
|
|
|
|
|
|
description = "Ring Device") }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
@ -320,13 +346,10 @@ public interface DeviceManagementAdminService {
|
|
|
|
notes = "Lock reset on Windows devices.Its use to reset the device pass code",
|
|
|
|
notes = "Lock reset on Windows devices.Its use to reset the device pass code",
|
|
|
|
response = Activity.class,
|
|
|
|
response = Activity.class,
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
tags = "Windows Device Management Administrative Service",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value="permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:windows:lock-reset")
|
|
|
|
scopes = { @AuthorizationScope(
|
|
|
|
})
|
|
|
|
scope = "/device-mgt/devices/owning-device/operations/windows/lock-reset",
|
|
|
|
|
|
|
|
description = "Lock reset") }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|