haibo-duan commented on code in PR #8488:
URL: https://github.com/apache/inlong/pull/8488#discussion_r1259406808
##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/UpdateCommand.java:
##########
@@ -205,4 +213,87 @@ void run() {
}
}
}
+
+ @Parameters(commandDescription = "Update Tenant")
+ private static class UpdateTenant extends AbstractCommandRunner {
+
+ @Parameter()
+ private List<String> params;
+
+ @Parameter(names = {"-n", "--name"}, description = "name to be modify")
+ private String name;
+
+ @Parameter(names = {"-d", "--description"}, description = "new
description")
+ private String description;
+
+ @Override
+ void run() {
+ try {
+ InlongTenantRequest request = new InlongTenantRequest();
+ request.setName(name);
+ ClientUtils.initClientFactory();
+ InlongTenantClient tenantClient =
ClientUtils.clientFactory.getInlongTenantClient();
+ InlongTenantInfo tenantInfo =
tenantClient.getTenantByName(name);
+ if (tenantInfo == null) {
+ throw new BusinessException(name + " not exist, please
check.");
+ }
+ request.setId(tenantInfo.getId());
+ request.setDescription(description);
+ request.setVersion(tenantInfo.getVersion());
+ if (tenantClient.update(request)) {
+ System.out.println("Update user success!");
+ }
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ }
+ }
+ }
+
+ @Parameters(commandDescription = "Update Tenant Role")
+ private static class UpdateTenantRole extends AbstractCommandRunner {
+
+ @Parameter()
+ private List<String> params;
+
+ @Parameter(names = {"-id", "--id"}, description = "id to be modify")
+ private Integer id;
+
+ @Parameter(names = {"-role-code", "--role-code"}, description = "new
role code")
Review Comment:
Why is it - rs? Should it be - rc?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]