Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] User API: Add hint for options available for 'components' field in SwaggerUI #14593

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiKeyAuthDefinition;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.SecurityDefinition;
import io.swagger.annotations.SwaggerDefinition;
Expand Down Expand Up @@ -98,7 +99,7 @@ public class PinotAccessControlUserRestletResource {
@Path("/users")
@Authorize(targetType = TargetType.CLUSTER, action = Actions.Cluster.GET_USER)
@ApiOperation(value = "List all uses in cluster", notes = "List all users in cluster")
public String listUers() {
public String listUsers() {
try {
ZkHelixPropertyStore<ZNRecord> propertyStore = _pinotHelixResourceManager.getPropertyStore();
Map<String, UserConfig> allUserInfo = ZKMetadataProvider.getAllUserInfo(propertyStore);
Expand All @@ -113,7 +114,8 @@ public String listUers() {
@Path("/users/{username}")
@Authorize(targetType = TargetType.CLUSTER, action = Actions.Cluster.GET_USER)
@ApiOperation(value = "Get an user in cluster", notes = "Get an user in cluster")
public String getUser(@PathParam("username") String username, @QueryParam("component") String componentTypeStr) {
public String getUser(@PathParam("username") String username,
@ApiParam(value = "CONTROLLER|SERVER|BROKER") @QueryParam("component") String componentTypeStr) {
try {
ZkHelixPropertyStore<ZNRecord> propertyStore = _pinotHelixResourceManager.getPropertyStore();
ComponentType componentType = Constants.validateComponentType(componentTypeStr);
Expand Down Expand Up @@ -165,7 +167,7 @@ public SuccessResponse addUser(String userConfigStr) {
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Delete a user", notes = "Delete a user")
public SuccessResponse deleteUser(@PathParam("username") String username,
@QueryParam("component") String componentTypeStr) {
@ApiParam(value = "CONTROLLER|SERVER|BROKER") @QueryParam("component") String componentTypeStr) {

List<String> usersDeleted = new LinkedList<>();
String usernameWithComponentType = username + "_" + componentTypeStr;
Expand Down Expand Up @@ -199,7 +201,7 @@ public SuccessResponse deleteUser(@PathParam("username") String username,
@ApiOperation(value = "Update user config for a user", notes = "Update user config for user")
public SuccessResponse updateUserConfig(
@PathParam("username") String username,
@QueryParam("component") String componentTypeStr,
@ApiParam(value = "CONTROLLER|SERVER|BROKER") @QueryParam("component") String componentTypeStr,
@QueryParam("passwordChanged") boolean passwordChanged,
String userConfigString) {

Expand Down
Loading