|
|
@ -27,73 +27,73 @@ import javax.ws.rs.core.MediaType;
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
|
@Path("/admin/groups")
|
|
|
|
//@Path("/admin/groups")
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
//@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
//@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@Api(value = "Group Management Administrative Service", description = "This an API intended to be used by " +
|
|
|
|
//@Api(value = "Group Management Administrative Service", description = "This an API intended to be used by " +
|
|
|
|
"'internal' components to log in as an admin user and do a selected number of operations. " +
|
|
|
|
// "'internal' components to log in as an admin user and do a selected number of operations. " +
|
|
|
|
"Further, this is strictly restricted to admin users only ")
|
|
|
|
// "Further, this is strictly restricted to admin users only ")
|
|
|
|
public interface GroupManagementAdminService {
|
|
|
|
public interface GroupManagementAdminService {
|
|
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
// @GET
|
|
|
|
@ApiOperation(
|
|
|
|
// @ApiOperation(
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
// produces = MediaType.APPLICATION_JSON,
|
|
|
|
httpMethod = "GET",
|
|
|
|
// httpMethod = "GET",
|
|
|
|
value = "Get groups by the name.",
|
|
|
|
// value = "Get groups by the name.",
|
|
|
|
notes = "Get devices the name of device and tenant.",
|
|
|
|
// notes = "Get devices the name of device and tenant.",
|
|
|
|
response = DeviceGroupWrapper.class,
|
|
|
|
// response = DeviceGroupWrapper.class,
|
|
|
|
responseContainer = "List",
|
|
|
|
// responseContainer = "List",
|
|
|
|
tags = "Group Management Administrative Service")
|
|
|
|
// tags = "Group Management Administrative Service")
|
|
|
|
@ApiResponses(value = {
|
|
|
|
// @ApiResponses(value = {
|
|
|
|
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of groups.",
|
|
|
|
// @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of groups.",
|
|
|
|
response = DeviceGroupWrapper.class,
|
|
|
|
// response = DeviceGroupWrapper.class,
|
|
|
|
responseContainer = "List",
|
|
|
|
// responseContainer = "List",
|
|
|
|
responseHeaders = {
|
|
|
|
// responseHeaders = {
|
|
|
|
@ResponseHeader(
|
|
|
|
// @ResponseHeader(
|
|
|
|
name = "Content-Type",
|
|
|
|
// name = "Content-Type",
|
|
|
|
description = "The content type of the body"),
|
|
|
|
// description = "The content type of the body"),
|
|
|
|
@ResponseHeader(
|
|
|
|
// @ResponseHeader(
|
|
|
|
name = "ETag",
|
|
|
|
// name = "ETag",
|
|
|
|
description = "Entity Tag of the response resource.\n" +
|
|
|
|
// description = "Entity Tag of the response resource.\n" +
|
|
|
|
"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 has been modified the last time.\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 has already 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 ErrorResponse. \n Server error occurred while fetching the group list.")
|
|
|
|
// message = "Internal Server ErrorResponse. \n Server error occurred while fetching the group list.")
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
@Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"})
|
|
|
|
// @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"})
|
|
|
|
Response getGroupsOfUser(
|
|
|
|
// Response getGroupsOfUser(
|
|
|
|
@ApiParam(
|
|
|
|
// @ApiParam(
|
|
|
|
name = "username",
|
|
|
|
// name = "username",
|
|
|
|
value = "Username of the user.",
|
|
|
|
// value = "Username of the user.",
|
|
|
|
required = true)
|
|
|
|
// required = true)
|
|
|
|
@QueryParam("username") String username,
|
|
|
|
// @QueryParam("username") String username,
|
|
|
|
@ApiParam(
|
|
|
|
// @ApiParam(
|
|
|
|
name = "If-Modified-Since",
|
|
|
|
// name = "If-Modified-Since",
|
|
|
|
value = "Timestamp of the last modified date",
|
|
|
|
// value = "Timestamp of the last modified date",
|
|
|
|
required = false)
|
|
|
|
// required = false)
|
|
|
|
@HeaderParam("If-Modified-Since") String timestamp,
|
|
|
|
// @HeaderParam("If-Modified-Since") String timestamp,
|
|
|
|
@ApiParam(
|
|
|
|
// @ApiParam(
|
|
|
|
name = "offset",
|
|
|
|
// name = "offset",
|
|
|
|
value = "Starting point within the complete list of items qualified.",
|
|
|
|
// value = "Starting point within the complete list of items qualified.",
|
|
|
|
required = false)
|
|
|
|
// required = false)
|
|
|
|
@QueryParam("offset") int offset,
|
|
|
|
// @QueryParam("offset") int offset,
|
|
|
|
@ApiParam(
|
|
|
|
// @ApiParam(
|
|
|
|
name = "limit",
|
|
|
|
// name = "limit",
|
|
|
|
value = "Maximum size of resource array to return.",
|
|
|
|
// value = "Maximum size of resource array to return.",
|
|
|
|
required = false)
|
|
|
|
// required = false)
|
|
|
|
@QueryParam("limit") int limit);
|
|
|
|
// @QueryParam("limit") int limit);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|