|
|
@ -13,10 +13,13 @@ import io.swagger.annotations.Info;
|
|
|
|
import io.swagger.annotations.ResponseHeader;
|
|
|
|
import io.swagger.annotations.ResponseHeader;
|
|
|
|
import io.swagger.annotations.SwaggerDefinition;
|
|
|
|
import io.swagger.annotations.SwaggerDefinition;
|
|
|
|
import io.swagger.annotations.Tag;
|
|
|
|
import io.swagger.annotations.Tag;
|
|
|
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.Scope;
|
|
|
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.Scopes;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DeviceCountByGroup;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DeviceCountByGroup;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardGadgetDataWrapper;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardGadgetDataWrapper;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardPaginationGadgetDataWrapper;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardPaginationGadgetDataWrapper;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.ws.rs.Consumes;
|
|
|
|
import javax.ws.rs.Consumes;
|
|
|
|
import javax.ws.rs.GET;
|
|
|
|
import javax.ws.rs.GET;
|
|
|
@ -44,6 +47,70 @@ import javax.ws.rs.core.Response;
|
|
|
|
@Tag(name = "device_management", description = "Device Analytics Dashboard related APIs.")
|
|
|
|
@Tag(name = "device_management", description = "Device Analytics Dashboard related APIs.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
@Scopes(
|
|
|
|
|
|
|
|
scopes = {
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Device Count Overview",
|
|
|
|
|
|
|
|
description = "Device Count Overview",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:count-overview",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Device Counts by Potential Vulnerabilities",
|
|
|
|
|
|
|
|
description = "Device Counts by Potential Vulnerabilities",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:vulnerabilities",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get the number of devices that have not complied to a policy",
|
|
|
|
|
|
|
|
description = "Get the number of devices that have not complied to a policy",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:non-compliant",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get the number of devices for a given device type, such as connectivity status, "
|
|
|
|
|
|
|
|
+ "potential vulnerability, platform, and ownership",
|
|
|
|
|
|
|
|
description = "Get the number of devices for a given device type, such as connectivity status, "
|
|
|
|
|
|
|
|
+ "potential vulnerability, platform, and ownership",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:by-groups",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get the number of devices that have not complied to a given policy based on a particular",
|
|
|
|
|
|
|
|
description = "Get the number of devices that have not complied to a given policy based on a particular",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:device-counts",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get the number of devices that have not complied to a given policy based on a particular"
|
|
|
|
|
|
|
|
+ " device type.",
|
|
|
|
|
|
|
|
description = "Get the number of devices that have not complied to a given policy based on a " +
|
|
|
|
|
|
|
|
"particular device type.",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:filtered-count",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get the number of devices that have not complied to a given policy over the total"
|
|
|
|
|
|
|
|
+ " number of devices registered with WSO2 EMM.\n",
|
|
|
|
|
|
|
|
description = "Get the number of devices that have not complied to a given policy over the total"
|
|
|
|
|
|
|
|
+ " number of devices registered with WSO2 EMM.\n",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:non-compliant-count",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get device details of devices based on a particular device type.",
|
|
|
|
|
|
|
|
description = "Get device details of devices based on a particular device type.",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:details",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
@Scope(
|
|
|
|
|
|
|
|
name = "Get device details of non-compliant devices which do not comply to a given policy.",
|
|
|
|
|
|
|
|
description = "Get device details of non-compliant devices which do not comply to a given policy.",
|
|
|
|
|
|
|
|
key = "cdmf:dashboard:feature-non-compliant",
|
|
|
|
|
|
|
|
permissions = {"/device-mgt/dashboard/view"}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
@Path("/dashboard")
|
|
|
|
@Path("/dashboard")
|
|
|
|
@Api(value = "Device Analytics Dashboard",
|
|
|
|
@Api(value = "Device Analytics Dashboard",
|
|
|
|
description = "Device Analytics Dashboard related information APIs are described here.")
|
|
|
|
description = "Device Analytics Dashboard related information APIs are described here.")
|
|
|
@ -70,13 +137,12 @@ public interface Dashboard {
|
|
|
|
notes = "Get the details of active, inactive, removed and total number of registered devices in"
|
|
|
|
notes = "Get the details of active, inactive, removed and total number of registered devices in"
|
|
|
|
+ " WSO2 IoT.",
|
|
|
|
+ " WSO2 IoT.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:count-overview")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -127,13 +193,12 @@ public interface Dashboard {
|
|
|
|
httpMethod = "GET",
|
|
|
|
httpMethod = "GET",
|
|
|
|
value = "Get the number of unmonitored and non-compliant devices in WSO2 IoT.",
|
|
|
|
value = "Get the number of unmonitored and non-compliant devices in WSO2 IoT.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:vulnerabilities")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -185,13 +250,12 @@ public interface Dashboard {
|
|
|
|
value = "Get the number of devices that have not complied to a policy that was enforced on a "
|
|
|
|
value = "Get the number of devices that have not complied to a policy that was enforced on a "
|
|
|
|
+ "device.",
|
|
|
|
+ "device.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:non-compliant")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -256,13 +320,12 @@ public interface Dashboard {
|
|
|
|
value = "Get the number of devices for a given device type, such as connectivity status, "
|
|
|
|
value = "Get the number of devices for a given device type, such as connectivity status, "
|
|
|
|
+ "potential vulnerability, platform, and ownership.\n",
|
|
|
|
+ "potential vulnerability, platform, and ownership.\n",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:by-groups")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -346,13 +409,12 @@ public interface Dashboard {
|
|
|
|
value = "Get the number of devices that have not complied to a given policy based on a particular"
|
|
|
|
value = "Get the number of devices that have not complied to a given policy based on a particular"
|
|
|
|
+ " device type.",
|
|
|
|
+ " device type.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:device-counts")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -426,13 +488,12 @@ public interface Dashboard {
|
|
|
|
+ "The device ownership type, such as BYOD or COPE.\n" + "The device platform.\n"
|
|
|
|
+ "The device ownership type, such as BYOD or COPE.\n" + "The device platform.\n"
|
|
|
|
+ "The potential vulnerabilities faced by the devices.",
|
|
|
|
+ "The potential vulnerabilities faced by the devices.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:filtered-count")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -519,13 +580,12 @@ public interface Dashboard {
|
|
|
|
value = "Get the number of devices that have not complied to a given policy over the total"
|
|
|
|
value = "Get the number of devices that have not complied to a given policy over the total"
|
|
|
|
+ " number of devices registered with WSO2 IoT.\n",
|
|
|
|
+ " number of devices registered with WSO2 IoT.\n",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:non-compliant-count")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -595,13 +655,12 @@ public interface Dashboard {
|
|
|
|
httpMethod = "GET",
|
|
|
|
httpMethod = "GET",
|
|
|
|
value = "Get device details of devices based on a particular device type.",
|
|
|
|
value = "Get device details of devices based on a particular device type.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:details")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
@ -698,13 +757,12 @@ public interface Dashboard {
|
|
|
|
httpMethod = "GET",
|
|
|
|
httpMethod = "GET",
|
|
|
|
value = "Get device details of non-compliant devices which do not comply to a given policy.",
|
|
|
|
value = "Get device details of non-compliant devices which do not comply to a given policy.",
|
|
|
|
tags = "Dashboard",
|
|
|
|
tags = "Dashboard",
|
|
|
|
authorizations = {
|
|
|
|
extensions = {
|
|
|
|
@Authorization(
|
|
|
|
@Extension(properties = {
|
|
|
|
value = "permission",
|
|
|
|
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:feature-non-compliant")
|
|
|
|
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view",
|
|
|
|
})
|
|
|
|
description = "View Dashboard")}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponses(value = {
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 200,
|
|
|
|
code = 200,
|
|
|
|