use of org.wso2.ei.dashboard.micro.integrator.delegates.UsersDelegate in project product-mi-tooling by wso2.
the class GroupsApi method getUsers.
@GET
@Path("/{group-id}/users")
@Produces({ "application/json" })
@Operation(summary = "Get users", description = "", tags = { "Users" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of users", content = @Content(schema = @Schema(implementation = Users.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getUsers(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId) throws ManagementApiException {
UsersDelegate usersDelegate = new UsersDelegate();
Users users = usersDelegate.fetchUsers(groupId);
Response.ResponseBuilder responseBuilder = Response.ok().entity(users);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.micro.integrator.delegates.UsersDelegate in project product-mi-tooling by wso2.
the class GroupsApi method addUser.
@POST
@Path("/{group-id}/users")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Add user", description = "", tags = { "Users" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "User insert status", content = @Content(schema = @Schema(implementation = SuccessStatus.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response addUser(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @Valid AddUserRequest request) throws ManagementApiException {
UsersDelegate usersDelegate = new UsersDelegate();
Ack ack = usersDelegate.addUser(groupId, request);
Response.ResponseBuilder responseBuilder = Response.ok().entity(ack);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.micro.integrator.delegates.UsersDelegate in project product-mi-tooling by wso2.
the class GroupsApi method deleteUser.
@DELETE
@Path("/{group-id}/users/{user-id}")
@Produces({ "application/json" })
@Operation(summary = "Delete user", description = "", tags = { "Users" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "User deletion status", content = @Content(schema = @Schema(implementation = SuccessStatus.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response deleteUser(@PathParam("group-id") @Parameter(description = "Group ID") String groupId, @PathParam("user-id") @Parameter(description = "User ID") String userId) throws ManagementApiException {
UsersDelegate usersDelegate = new UsersDelegate();
Ack ack = usersDelegate.deleteUser(groupId, userId);
Response.ResponseBuilder responseBuilder = Response.ok().entity(ack);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
Aggregations