Skip to content

Commit

Permalink
feedback from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmclean committed Nov 7, 2024
1 parent 9cf358c commit 76dd0f4
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public CreateGroup(String url, boolean ignoreVersions, String metalake, String g
}

/** Create a new group. */
@Override
public void handle() {
try {
GravitinoClient client = buildClient(metalake);
Expand All @@ -51,7 +52,7 @@ public void handle() {
System.err.println(ErrorMessages.UNKNOWN_METALAKE);
return;
} catch (GroupAlreadyExistsException err) {
System.err.println(ErrorMessages.USER_EXISTS);
System.err.println(ErrorMessages.GROUP_EXISTS);
return;
} catch (Exception exp) {
System.err.println(exp.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public CreateUser(String url, boolean ignoreVersions, String metalake, String us
}

/** Create a new user. */
@Override
public void handle() {
try {
GravitinoClient client = buildClient(metalake);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ public DeleteGroup(String url, boolean ignoreVersions, String metalake, String g
}

/** Delete a group. */
@Override
public void handle() {
boolean deleted = false;

try {
GravitinoClient client = buildClient(metalake);
deleted = client.removeUser(group);
deleted = client.removeGroup(group);
} catch (NoSuchMetalakeException err) {
System.err.println(ErrorMessages.UNKNOWN_METALAKE);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DeleteUser extends Command {
protected final String user;

/**
* Delete a user.
* Deletes a user.
*
* @param url The URL of the Gravitino server.
* @param ignoreVersions If true don't check the client/server versions match.
Expand All @@ -44,6 +44,7 @@ public DeleteUser(String url, boolean ignoreVersions, String metalake, String us
}

/** Delete a user. */
@Override
public void handle() {
boolean deleted = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public GroupDetails(String url, boolean ignoreVersions, String metalake, String
}

/** Displays the roles of a specified group. */
@Override
public void handle() {
List<String> roles = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public ListGroups(String url, boolean ignoreVersions, String metalake) {
}

/** Lists all groups in a metalake. */
@Override
public void handle() {
String[] groups = new String[0];
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public ListUsers(String url, boolean ignoreVersions, String metalake) {
}

/** Lists all users in a metalake. */
@Override
public void handle() {
String[] users = new String[0];
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public MetalakeAuditInfo(String url, boolean ignoreVersions, String metalake) {
}

/** Displays the audit information of a metalake. */
@Override
public void handle() {
Audit audit;
try (GravitinoClient client = buildClient(metalake)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public UserDetails(String url, boolean ignoreVersions, String metalake, String u
}

/** Displays the roles of a specified user. */
@Override
public void handle() {
List<String> roles = null;

Expand Down
8 changes: 4 additions & 4 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ gcli user details --metalake metalake_demo --user new_user
gcli user list --metalake metalake_demo
```

#### Delete a users
#### Delete a user

```bash
gcli user delete --metalake metalake_demo --user new_user
Expand All @@ -365,13 +365,13 @@ gcli user delete --metalake metalake_demo --user new_user
#### Create a group

```bash
gcli group create --metalake metalake_demo --user new_group
gcli group create --metalake metalake_demo --group new_group
```

#### Display a group's details

```bash
gcli group details --metalake metalake_demo --user new_group
gcli group details --metalake metalake_demo --group new_group
```

#### List all groups
Expand All @@ -383,5 +383,5 @@ gcli group list --metalake metalake_demo
#### Delete a group

```bash
gcli group delete --metalake metalake_demo --user new_group
gcli group delete --metalake metalake_demo --group new_group
```

0 comments on commit 76dd0f4

Please sign in to comment.